# InstanceId
Source: https://docs.maelstrom-ai.co/0.2/reference/protocol/variables/instanceid/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **InstanceId**: (`value`) => [`InstanceId`](https://docs.maelstrom-ai.co/0.2/reference/protocol/type-aliases/instanceid/)

Defined in: packages/protocol/src/lib/instance.ts:8

Brands a string as an InstanceId without changing its value.

Unlike `SessionId` and `MessageId`, this factory has no auto-gen path: an InstanceId always originates from an external source (LLM execution plan, persisted layout, wire frame) where the ID is already chosen. Generating one client-side would mean inventing an identity for an entity Maelstrom didn’t create, which is never what callers want.

## Parameters

### value

`string`

## Returns

[`InstanceId`](https://docs.maelstrom-ai.co/0.2/reference/protocol/type-aliases/instanceid/)

## Example

```ts
const id = InstanceId('calendar-main');
const byId = new Map<InstanceId, Vessel>();
```
