End Session Node
This content is not available in your language yet.
The end_session node terminates the conversation. Every workflow eventually reaches one, but how it behaves at that point is configurable: it can end immediately, or ask the user to confirm first, and it can optionally trigger a post-session evaluation.
See Workflows Overview for how this node type fits into the broader node/edge model.
Config fields
Section titled “Config fields”EndSessionNodeConfig:
| Field | Type | Required | Description |
|---|---|---|---|
runEvaluation | boolean | No | Opt-in flag to trigger a post-session evaluation of the conversation when this node runs. |
requireConfirmation | boolean | No | Default false. When true, the node doesn’t end the session on its first pass — it asks the user for confirmation instead, and the session only actually ends once the user’s next message affirms. See Confirmation flow below. |
confirmationPromptTemplate | string | No | A Handlebars template (rendered as plain text, no escaping — same as a response node’s messageTemplate) for the confirmation message shown when requireConfirmation is true. If omitted, a generic confirmation line is used. |
Confirmation flow
Section titled “Confirmation flow”By default (requireConfirmation unset or false), an end_session node ends the conversation the moment execution reaches it — no further user input is needed.
Setting requireConfirmation: true changes this: instead of ending immediately, the workflow renders confirmationPromptTemplate (or the generic fallback) and waits. The session stays active. If the user’s next message affirms, the session then ends for real; if they decline, your workflow logic (typically an earlier condition or router node reacting to the affirmation) should route elsewhere instead of back to this node.
This is the right pattern for any exit that follows a state-changing action — confirming a booking is complete, confirming the user wants to end a support conversation — where you don’t want to close the session out from under them without a final chance to continue.
Worked example
Section titled “Worked example”Ending a session immediately, with no confirmation, after a simple informational exchange:
{ "id": "end", "type": "end_session", "label": "End Session", "config": { "runEvaluation": true }, "position": { "x": 450, "y": 150 }}Ending a session with a confirmation step, after a state-changing action like completing a booking:
{ "id": "confirm_end", "type": "end_session", "label": "Confirm and End", "config": { "requireConfirmation": true, "confirmationPromptTemplate": "Is there anything else I can help you with, or should I close this chat?", "runEvaluation": true }, "position": { "x": 450, "y": 250 }}Gotchas
Section titled “Gotchas”requireConfirmationis opt-in and defaults tofalse. Existing workflows that never set it keep ending immediately — this preserves prior behavior rather than changing it for every workflow at once.confirmationPromptTemplateis rendered as plain text, not JSON — write it exactly as you want the user to read it, the same as a response node’smessageTemplate. See Best Practices for the full breakdown of which fields escape what.- A confirmation in progress is non-terminal. On the event subscription your client listens to, this state is represented as a distinct, non-terminal event — don’t treat it as session end. The session only truly closes, and the terminal event fires, once the user affirms.
runEvaluationis a separate flag from confirmation — you can set either independently. Don’t assume evaluation runs automatically just because a session ends; it only runs if this flag is set on theend_sessionnode that actually terminates the session.- A workflow must be published to run at all — an
end_sessionnode (like every other node) is inert in an unpublished draft. See the Publishing section of Workflows Overview.
Next steps
Section titled “Next steps”- Workflows Overview — the full node/edge model.
- Response Node — for the same plain-text templating rules
confirmationPromptTemplateuses. - Workflow Best Practices — templating rules across all node types.
- LLM Node, Condition Node, Router Node, Sub-Agent Node — other node types.
- Worked Examples & Demos — complete multi-node workflows, including a confirmation-based end session.
- Workflows API Reference — the mutations for creating and publishing workflows.