Skip to content

End Session Node

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.

EndSessionNodeConfig:

FieldTypeRequiredDescription
runEvaluationbooleanNotrue queues a post-session evaluation of the conversation. false, or leaving it out, ends the session without one (no evaluation is stored and no model is called). See Evaluation below.
requireConfirmationbooleanNoDefault 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.
confirmationPromptTemplatestringNoA 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.

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.

An evaluation is a separate model call that scores the finished conversation. It runs in the background after the session ends, so it never delays a reply.

  • runEvaluation: true — queue an evaluation.
  • runEvaluation: false — end the session and do nothing else. No evaluation is stored. This also saves up to two model calls per session, which matters for chat flows that end a session after every exchange.
  • Omitted — no evaluation (from the release that ships this change; see the note below). Evaluation is an opt-in: set runEvaluation: true on the end_session node that ends the session if you read evaluations, for example an interview or screening agent.

Before 2026-10-01 this field was documented as an opt-in but was not actually read: every end_session evaluated, even when it said false. If you set runEvaluation: false earlier and still saw evaluations, that was why. The first release fixed false; the next one, which this page describes, also makes an omitted field mean no evaluation. If your workflow leaves runEvaluation out and you read its evaluations, add "runEvaluation": true before that release reaches you. Sessions that end through the SDK’s end-session call (sdkEndSession) still return their evaluation as before; this setting is only about the workflow end_session node. An operator can restore the old evaluate-when-omitted behaviour for an environment.

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 }
}
  • requireConfirmation is opt-in and defaults to false. Existing workflows that never set it keep ending immediately — this preserves prior behavior rather than changing it for every workflow at once.
  • confirmationPromptTemplate is rendered as plain text, not JSON — write it exactly as you want the user to read it, the same as a response node’s messageTemplate. 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.
  • runEvaluation is a separate flag from confirmation — you can set either independently. Say true if you read evaluations. An omitted flag means no evaluation. See Evaluation.
  • A workflow must be published to run at all — an end_session node (like every other node) is inert in an unpublished draft. See the Publishing section of Workflows Overview.