The Catch node is part of the Flow I-O nodes category and allows you to capture errors that occur during the execution of a flow in Studio and handle them in a dedicated flow, so you can provide a response to the user instead of stopping the execution.
Prior concepts
Remember that a flow is a path between an input node and an output node, for example, a Step In and a Step Close, or an HTTP In and an HTTP Response. If an error occurs during its execution in Studio, the flow stops, and no response is provided to the user. To avoid this, the Catch node is used, which allows you to capture those errors and handle them in a dedicated flow.
Important: No new errors should be generated in that resolution flow, so it is recommended to return a text response if it is an integration flow with the bot or an error code if you are developing an endpoint.
Node configuration
The fields required to configure it are described below:
- Catch errors from (required): Defines which nodes' errors will be captured. It has three options:
- All nodes: This is the default setting. The node captures the errors thrown by any node in the tab where it is installed.
- In the same group: The node captures the errors of the nodes that belong to the same group.
- Selected nodes: This is the recommended scheme. It lets you indicate which nodes the Catch node will detect errors from, which can be chosen from a list or directly on the flow using the "Select nodes" button.
- Ignore errors handled by other Catch nodes (optional): A checkbox that is selected so the node ignores errors that are already handled by other Catch nodes.
- Name (optional): Allows you to rename the node within the flow.
Key points
- To avoid duplicating control flows, it is recommended to have a single Catch node with the "all nodes" configuration per tab and to have the “Ignore errors handled by other Catch Nodes” checkbox selected.
- If the error occurs in a subflow, it will be captured by the Catch nodes installed in it. If there are none, the error will propagate to the main flow that called it.
You can download an example flow at this link.
In the following video, we show you how to configure the node in Studio: