diff --git a/worker.md b/worker.md index f8bc0ed..88ddaf0 100644 --- a/worker.md +++ b/worker.md @@ -255,6 +255,27 @@ Backend's response to a `patchSession` message. } ``` +### 5.5. Set Session ID + +Allows the backend to instruct the worker to associate a session ID with a subscription. This is useful for linking detection events to a specific session. + +- **Type:** `setSessionId` + +**Payload:** + +```json +{ + "type": "setSessionId", + "payload": { + "subscriptionIdentifier": "display-001;cam-002", + "sessionId": 12345 + } +} +``` + +> **Note:** +> - The worker should store the session ID for the given subscription and use it in subsequent detection or patch messages as appropriate. + ## 6. Example Communication Log This section shows a typical sequence of messages between the backend and the worker. Patch messages are not included, as they are only used when the worker cannot keep up.