Interaction
Description
The Interaction node (interaction) pauses the execution of a Request-Response scenario. When a request reaches the node:
- the current state of the execution (all variables available at the node) is stored under a new, unique
continuationId, - the scenario immediately returns the Pause response to the caller - this is the HTTP response of the original request,
- the nodes after the Interaction node are executed only when the scenario is resumed with a call to its
/resumeendpoint, carrying thecontinuationIdand additional input. The response of the/resumecall is the response produced by the scenario after the Interaction node.
It is useful for multi-step interactions, e.g. returning a preliminary decision and asking the caller for a confirmation, a missing piece of data or a one-time code before the processing continues.
Parameters and configuration
| Name | Description |
|---|---|
| Pause response | Response returned to the caller when the execution pauses at this node. Include #continuationId in it - the caller needs this id to resume the scenario, and it is returned nowhere else. #scenarioVersionId (a String) is available too. Written with the JSON template editor or as a SpEL expression; a new node starts with a JSON template returning the continuationId. |
| Question | Optional. What the user of an AI agent is asked when the scenario is called as an MCP tool and pauses at this node - see Asking the user of an AI agent. It may use the variables available at the node, e.g. 'Refund order ' + #input.orderId + '?'. Callers that cannot ask a person ignore it. |
| Output variable name | The name of the variable holding the additional input sent in the /resume call (a String). |
In the Pause response expression two additional variables are available:
| Variable | Description |
|---|---|
#continuationId | Unique, single-use identifier of the paused execution (a String). |
#scenarioVersionId | The version of the scenario that paused the execution (a String). |
After the node, all variables available before the node (e.g. #input) are restored, and the output variable holds the additional input of the /resume call.
Resuming the scenario
The scenario is resumed with a POST request to the /resume path of the scenario's endpoint (the scenario's invocation URL followed by /resume), with a JSON body:
{
"continuationId": "a7f1c2e4-...",
"additionalInput": "confirmed"
}
| Field | Description |
|---|---|
continuationId | The id returned in the pause response. |
additionalInput | A String passed to the scenario in the Interaction node's output variable. To pass structured data, send a JSON document as a string and parse it in the scenario. |
/resumeis secured the same way as the main endpoint of the scenario - if Basic Auth is configured for the scenario,/resumerequires it too; a validcontinuationIdalone is not enough.- A
continuationIdcan be used only once. Two/resumecalls with the same id - even concurrent ones - resume the execution at most once; the other one gets400. Treat/resumeas non-idempotent: retrying it after a timeout may find the continuation already consumed. - A
/resumecall with an unknowncontinuationIdgets400with a message explaining that the id was never issued, has already been resumed, has expired, or was dropped because the cache of paused executions was full. - The
/resumeoperation is included in the scenario's OpenAPI definition.
Asking the user of an AI agent
When the scenario is a tool of an MCP server and the agent's MCP client can
ask its user a question (MCP revision 2026-07-28 with the elicitation capability), a pause is not returned to the
agent as a result. The client shows its user the Question with one field to fill in, and the answer resumes the
scenario: the agent sees a single tool call that ends with the response produced after the node. Nothing changes in
the scenario - the answer arrives in the output variable exactly as the additionalInput of a /resume call does.
- Without a Question the user is asked a generic one that names the tool, so write one.
- The user has
request-response.continuationTtl(and the MCP server'smcp.requestState.ttl, 5 minutes by default) to answer. After that the tool call ends with an error and has to be made again. - A user who declines or dismisses the question ends the tool call with an error; the scenario is not resumed and has no branch for it.
- A call that pauses at more than one node at once (after a Split or a For Each), or pauses and also reaches a Response node, cannot be put as one question: the tool call ends with an error and nothing is asked. Ask one question at a time; several Interaction nodes one after another are asked in turn.
- Other MCP clients, and every caller that is not an MCP client, get the Pause response as before.
Any caller can get the same description of a pause the MCP server uses: a request with the header
X-Nussknacker-Describe-Interactions: true is answered, when the scenario pauses, with
{"interactions": [{"continuationId", "scenarioVersionId", "nodeId", "kind", "question", "choices"}], "otherResults": 0}
and the response header X-Nussknacker-Paused: true, instead of the pause response. The description always carries
the continuationId, also when the pause response leaves it out, so leaving it out does not keep a caller that may
call the scenario from resuming it.
Example
A payment scenario asks the customer to confirm a large transfer:
- Pause response:
{
"status": "CONFIRMATION_REQUIRED",
"continuationId": #continuationId
} - Output variable name:
confirmation
After the Interaction node, a Choice node checks #confirmation == 'confirmed' and leads to Response nodes returning {"status": "EXECUTED"} or {"status": "CANCELLED"}. #input (the original request) is still available there.
The caller first sends the payment request and receives {"status": "CONFIRMATION_REQUIRED", "continuationId": "..."}, then calls /resume with this continuationId and "additionalInput": "confirmed", and receives {"status": "EXECUTED"}.
Testing
In scenario tests (test cases) the Interaction node can be mocked: the mock value is used as the node's output variable (the resumed input), so the whole flow, including the part after the Interaction node, is executed in one test run.
Additional considerations
- Paused executions are kept in memory of the runtime, for at most
request-response.continuationTtl(default 5 minutes) and up torequest-response.continuationMaxCacheSizeentries (default100000); when the cache is full, the oldest paused execution is dropped. A paused execution is lost when the runtime is restarted. - Behaviour around redeployments and on Kubernetes (single replica required, no draining) differs per engine - see the Lite operations guide. The component can be disabled on an environment with
componentsUiConfig.interaction.disabled: true.