nœuds / builtin / flow
Try / Catch
Guard the work after it, and route a failure instead of ending the run
Ce contenu n’est pas encore disponible dans votre langue.
Guard the steps after it, so a failure goes down a separate branch instead of ending the run.
What it does
Section titled “What it does”Try / Catch has two outputs, Try and Catch. Items go out of Try unchanged, and the steps you connect there are guarded.
If any guarded step fails, the rest of the guarded steps are skipped and the Catch branch runs instead. It receives one item describing the failure:
nodeLabel: the name of the node that failed.message: its error message.input: the data that node was given.
The guarded part is everything the Try branch reaches, up to the node where the Try and Catch branches join again. Whatever comes after that join runs in both cases. If the branches never join, everything after Try is guarded to the end of the workflow.
Good to know:
- A node set to retry uses up all its attempts first; Catch only sees what retrying could not fix. See Error handling.
- A failure inside the Catch branch is not caught by the same Try / Catch. It goes to an outer Try / Catch, if any, or ends the run.
When to use it
Section titled “When to use it”- Wrap a step that can fail now and then, such as an API call or reading a page that may change, so the rest of the run still happens.
- Send yourself a message when a step fails, with the error and the data that caused it.
- Fall back to another way of getting the data when the first one fails.
To react when a whole workflow fails, from another workflow, use Error Trigger.
Inputs and settings
Section titled “Inputs and settings”| Réglage | Type | Ce que cela fait |
|---|---|---|
| Note | Text | What this boundary is protecting, for whoever reads the canvas next. |
Note is shown on the node to explain what it guards, for example Fetching the order from the API. It does not change how the node behaves.
Outputs
Section titled “Outputs”-
Try -
Catch
Try carries the incoming items. Catch carries the failure item described above: read it in the catch branch with {{ $input.nodeLabel }} and {{ $input.message }}.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”Get warned when an API call fails, without losing the run:
- Schedule runs the workflow every morning.
- Try / Catch with Note
Fetch today's orders. - From Try: Http Request calls
https://api.example.com/orders, then Google Sheets appends the orders. - From Catch: Slack posts
{{ $input.nodeLabel }} failed: {{ $input.message }}.
Common issues
Section titled “Common issues”- The run still stops when a step fails. The failing step is not inside the guarded part: it is before the Try / Catch, after the point where Try and Catch join, or in the Catch branch itself. Move the Try / Catch earlier, or connect the step from Try.
- Steps after the failure were skipped. That is expected: once a guarded step fails, the remaining guarded steps don’t run. Put steps that must always run after the node where both branches join.
- The Catch branch never runs. Nothing failed, or the node retried until it succeeded. Check the run log.
Related nodes
Section titled “Related nodes”- Stop and Error: fail on purpose, for Catch to handle.
- Error Trigger: run another workflow when a whole run fails.
- IF: branch on a value before it causes a failure.