Skip to main content

Events

Run events​

Subscribe with app.onEvent(handler), or onEvent in the catalog runner's options. Every event has type, runId and timestamp.

typeExtra fieldsWhen
node_startednodeIdA node starts.
node_completednodeId, outputA node finishes; output is the update it returned.
node_failednodeId, error, attempt, categoryA node threw. With a retryPolicy, once per attempt.
node_error_routednodeId, toNodeId, errorEdgeId, error, categoryRetries are spent and the run follows an error edge.
run_suspendednodeId, reasonThe run stopped: human-gate, interrupt (tool approval), timer or signal.
run_resumednodeIdA suspended run continues.
run_completedfinalStateThe run finished.
run_failederrorThe run failed.
run_cancellednodeIdThe run was cancelled before nodeId.
token_deltanodeId, messageId, delta, parentRunId, spawnIdA model token, when token streaming is on. parentRunId and spawnId are set only for a mapAgents sub-agent. Not saved in checkpoints.

category classifies a failure, so an error branch can treat a transient error (a timeout) and a permanent one differently.

Values of channels marked noLog: true are masked in every event.

Stream events​

app.stream(input, mode) yields one of these, depending on mode:

ModetypeFields
"messages"message_deltadelta (text), nodeId, messageId
"messages"tool_calltoolId, input, nodeId: a tool call the model made
"updates"state_updatenodeId, delta (the channels the node changed)
"values"state_valuestate (the full state)
"debug"debugnodeId, payload (a run event)

See Streaming.