When a node fails
The two ways a node fails, leaving through its error port or crashing its worker, and how each one ends the step and the run.
A node fails in one of two ways, and they end differently:
- The node returns through its
errorport. This is a normal result: the worker finished, the envelope hasport: 'error'and the run follows theerroredge, as for any other port (see Errors). - The worker throws. The state machine moves it to
CRASHEDand the engine records the step as failed. Inside aflow.tryscope, the run continues at its catch node with{ error, source_node, source_operator }; otherwise the whole run ends asfailedwithNode <node_id> (<slug>) failed: <message>.
The engine still stops a crashed worker; stopping an instance that already crashed is a no-op, so the cleanup never hides the original error.
How to choose
- Expect the failure and handle it in the graph: connect the node’s
errorport. Most nodes catch their own errors and leave througherrorwith the message indata. - Protect a part of the graph from crashes: wrap it in
flow.try. - Retry transient failures: use the node’s
executionsettings where the node honours them (see Limits).
Where to see it
The run’s history shows each step with its status: a step that left through error shows its envelope; a crashed step
shows error with the message. The run’s result records the failing node in its error.
Next steps
From draft to an immutable version, and which mode runs what.
Runs and their statusesThe statuses of a run and of its result.
How a node runsEach node is a Link Loom worker: spawn, activate, stop.
Worker state machineSeven states, nine events and the hook each transition runs.
Isolation and sandboxesWorkers, expression contexts and code sandboxes.