From 54f3b7e57392a6c3a6760fa868afec7ef8d30c06 Mon Sep 17 00:00:00 2001 From: Phillip Markert Date: Thu, 30 Jul 2026 18:49:10 -0400 Subject: [PATCH] feat(client): support startingWorkflowNodeId in session config Add `startingWorkflowNodeId` to `BaseSessionConfig` and wire it through `constructOverrides` so it is emitted as `starting_workflow_node_id` in the `conversation_initiation_client_data` WebSocket event. This allows callers using the private WebSocket or WebRTC session paths (signed URL / conversation token) to target a specific agent workflow node at conversation start, matching the behaviour already available on the server-side outbound-call API (`ConversationInitiationClientDataRequestInput`). Also adds the field to `ConversationInitiationClientToOrchestratorEvent` in `@elevenlabs/types` so the type system is consistent end-to-end. --- packages/client/src/utils/BaseConnection.ts | 2 ++ packages/client/src/utils/overrides.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/packages/client/src/utils/BaseConnection.ts b/packages/client/src/utils/BaseConnection.ts index cbdc3e50..ecf2f4be 100644 --- a/packages/client/src/utils/BaseConnection.ts +++ b/packages/client/src/utils/BaseConnection.ts @@ -65,6 +65,8 @@ export type BaseSessionConfig = { textOnly?: boolean; userId?: string; environment?: string; + /** If set, the ElevenLabs agent workflow will start at this node id instead of the default entry node. */ + startingWorkflowNodeId?: string; }; export type ConnectionType = "websocket" | "webrtc"; diff --git a/packages/client/src/utils/overrides.ts b/packages/client/src/utils/overrides.ts index b67dd67a..ec8f30df 100644 --- a/packages/client/src/utils/overrides.ts +++ b/packages/client/src/utils/overrides.ts @@ -59,5 +59,9 @@ export function constructOverrides( }; } + if (config.startingWorkflowNodeId) { + overridesEvent.starting_workflow_node_id = config.startingWorkflowNodeId; + } + return overridesEvent; }