On this page
Sommatic Docs
Open portal

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.

View as Markdown
Open in

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:

JSON
{ "ok": false, "port": "error", "data": { "error": "…" } }

What happens next depends on the graph:

The error port…Result
has an edgeThe engine follows it. The next node receives the failed node’s output as $json; its exact shape depends on the node.
has no edgeThat 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

SituationRun status
No more edges to follow and the last node did not leave through errorcompleted
A node failed, its error edge led to recovery nodes, and the last node did not leave through errorcompleted
The last node that ran left through errorfailed
A node raised an error the engine could not routefailed
The run went over 100 stepsfailed (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:

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.chain in sync mode leaves through error when the sub-workflow goes longer than timeout_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.

Next steps

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs