Errors
How failures move through a workflow — the error port every node has, what the engine does when a node fails, how a run ends completed or failed, and what flow.try, retries and timeouts do and do not do.
Errors in Sommatic AI are part of the graph. A node that fails says so through its error port, and you decide what
happens next by connecting that port, or not.
The error port
Almost every node in the catalog declares an error port. When the node cannot do its work (the API
answered 500, the document had no text, the expression in a condition threw), it returns:
{ "ok": false, "port": "error", "data": { "error": "…" } }What happens next depends on the graph:
The error port… | Result |
|---|---|
| has an edge | The engine follows it. The next node receives the failed node’s output as $json; its exact shape depends on the node. |
| has no edge | That branch stops. If it was the last node of the run, the run ends failed. |
Typical recovery branches open a task with human.task.create, send a notice, write
a status with integrations.mongodb.operation or try an alternative
path.
When a node raises an error
Sometimes a node does not return an envelope at all: its process fails, a required resource is missing or the
operator cannot be resolved. The engine records the node with status error and stops the run as failed, with the
message Node <node_id> (<operator>) failed: ….
How a run ends
| Situation | Run status |
|---|---|
No more edges to follow and the last node did not leave through error | completed |
A node failed, its error edge led to recovery nodes, and the last node did not leave through error | completed |
The last node that ran left through error | failed |
| A node raised an error the engine could not route | failed |
| The run went over 100 steps | failed (Max step ceiling reached (100)) |
The run result keeps an outcome_category (success or error) and, on failure, an error_summary with the
message.
flow.try
flow.try marks the start of a scope: it passes its input to its only port, do, and the
engine registers the scope. The engine can send an error raised inside that scope to a catch node connected to the
try node’s catch port, but flow.try does not declare that port, so the studio does not offer it. Handle failures
with the error port of each node.
Retries
The engine does not retry nodes. Retries exist only inside the nodes that implement them:
io.httpretries rate limits (429), server errors (5xx) and network failures, never other4xxresponses, with at most 5 attempts.integrations.microsoft.azure.blob,integrations.mongodb.operationandai.classify.triagehonor Retry On Fail and Max Retries from the node’s Settings tab.
Other nodes show those settings but ignore them. Continue On Fail is not applied by any node: connect the error
port instead.
Timeouts
- Timeout (ms) in a node’s settings (300000 by default) is honored by long-running operators such as extraction and inline code.
workflow.chaininsyncmode leaves througherrorwhen the sub-workflow goes longer thantimeout_ms(30000 by default) without any sign of progress.
Conditions that fail
When the condition of flow.if throws, the node leaves through error without data. Nodes on
that branch should read what they need with $('Node label').item.json instead of $json. More cases are in
expression gotchas.