Try / Catch
Defines a scope for error handling.
Opens an error scope: passes the payload unchanged through do, and the engine sends exceptions thrown by any node after it to the node connected to its catch edge.
This operator marks the beginning of a "Try" block. Any errors occurring in the downstream nodes connected to the 'do' port will be caught and routed to the corresponding "Catch" handler (structurally defined in the workflow graph).
Behavior:
- Normal Flow: Passes payload to 'do'.
- Error Scoping: The engine registers this node as the error handler for its children.
- Catch: Errors in children trigger the configured 'Catch' operator (if any).
Use Cases:
- Wrapping a risky API call.
- Implementing "Compensating Transactions" for a specific step.
- Graceful degradation (fallback logic).
How it works
- Returns the resolved payload through
dowithmeta.scopetry_start. - The engine registers a scope whose catch node is the first node connected from this node with
from.portcatch(or none). - When a later node throws, the engine walks the graph backwards from it; if this try node is an ancestor and has a catch node, the engine queues the catch node instead of failing the run.
- The catch node receives
{ error, source_node, source_operator }; the failing node output is stored as{ error, stack }.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-try-sync",
"label": "Try sync",
"operator_slug": "flow.try",
"operator_version": "1.0.0",
"config": {}
}{
"ok": true,
"data": {
"order_id": "ord_123",
"amount": 1250,
"status": "active"
},
"port": "do",
"meta": {
"scope": "try_start"
}
}Configuration
This node has no configuration fields.
Output ports
do default Always: the start of the protected branch.
{
"order_id": "ord_123",
"amount": 1250,
"status": "active"
}error Only if resolving the config throws, which in practice does not happen.
{
"error": "<message>"
}In expressions
What a later node can read from this node's output with $("Try / Catch").item.json.<path> (write your node's label instead of Try / Catch). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through do, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Try / Catch").item.json.payload | — | |
$("Try / Catch").item.json.order_id | — | |
$("Try / Catch").item.json.amount | — | |
$("Try / Catch").item.json.status | — |
— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Input contract
-
payloadobject Optional
Output contract
-
payloadobject Optional
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "flow.try",
"name": "Try / Catch",
"category": "flow",
"version": "1.0.0",
"description": "Defines a scope for error handling.\n\n This operator marks the beginning of a \"Try\" block. Any errors occurring in the downstream nodes connected to the 'do' port will be caught and routed to the corresponding \"Catch\" handler (structurally defined in the workflow graph).\n\n **Behavior:**\n - **Normal Flow:** Passes payload to 'do'.\n - **Error Scoping:** The engine registers this node as the error handler for its children.\n - **Catch:** Errors in children trigger the configured 'Catch' operator (if any).\n\n **Use Cases:**\n - Wrapping a risky API call.\n - Implementing \"Compensating Transactions\" for a specific step.\n - Graceful degradation (fallback logic).",
"capabilities": [
"error-handling",
"scope",
"try-catch"
],
"config_schema": {
"type": "object",
"properties": {}
},
"input_contract_schema": {
"type": "object",
"properties": {
"payload": {
"type": "object"
}
}
},
"output_contract_schema": {
"type": "object",
"properties": {
"payload": {
"type": "object"
}
}
},
"ports": [
{
"port_id": "do",
"label": "Do",
"is_default": true,
"description": "Start of the Try block."
}
],
"execution_mode": "sync",
"tags": [
"error",
"try",
"catch",
"scope"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"properties": {}
}{
"type": "object",
"properties": {
"payload": {
"type": "object"
}
}
}{
"type": "object",
"properties": {
"payload": {
"type": "object"
}
}
}[
{
"port_id": "do",
"label": "Do",
"is_default": true,
"description": "Start of the Try block."
}
]Execution
- Execution
sync- Stateful
- No
- Capabilities
error-handlingscopetry-catch- Tags
errortrycatchscope
Notes and limits
- Only thrown exceptions are caught. Most nodes report failures as an envelope on their own
errorport (for exampledata.transformorflow.if); those follow that port and never reach the catch node. Thrown failures include an operator that cannot be resolved, invalidcredential_bindings, and workers that rethrow (such assommatic.app.execute). catchis not a declared port of this node: the engine looks for an edge withfrom.portcatch. Without it the scope is registered but exceptions still fail the run.- The scope lasts until the run ends and covers every node that has the try node as an ancestor, including the catch branch: an exception inside the catch node is routed to it again until the 100-step limit fails the run.
Reviewed against the orchestrator code · 31e874b · 2026-11-26