Skip to main content

Catch

Catches the exceptions thrown by the node(s) in the current scope and handles them accordingly.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.

Options

  • Nodes - Select the node names from which you want to catch the thrown exceptions.

Output

  • Error Details - The error payload containing error information, source node details, and any associated data.

How It Works

The Catch node implements error handling by subscribing to error events from specified nodes:

  1. During flow initialization:
    • Subscribes to error events from selected nodes (or all nodes in scope if "All" is selected)
    • Registers itself as a catching node for those nodes
    • Marks those nodes as "caught" in the robot service
  2. When a node throws an error:
    • The error event is published to the messaging system
    • The Catch node receives the error payload
    • Extracts the payload from the error message
    • Outputs the error details for handling
  3. The flow continues from the Catch node with error information
  4. On close, unsubscribes from all error events

Requirements

  • At least one node must be selected to catch errors from (or select "All" for scope-wide catching)
  • Nodes to catch must be in the same scope as the Catch node
  • Caught nodes must not have Continue On Error enabled (otherwise errors are suppressed)

Error Handling

Error CodeDescriptionSolution
Core.Triggers.Catch.ErrOnCreateFailed to parse node configurationVerify node configuration is valid JSON
Core.Triggers.Catch.ErrSubscribeFailed to subscribe to error eventsCheck messaging system is functioning
Core.Triggers.Catch.ErrOnMessageMessage parsing failedCheck error payload format is valid

Note: Catch nodes themselves can have errors, but these typically indicate system-level issues.

Usage Examples

Example 1: Handle API Call Failures

Catch and handle API errors gracefully:

[API Call Node] → (if error occurs)

[Catch]
Nodes: "API Call Node"
Output: errorDetails

[Log: `API error: ${errorDetails.error.message}`]

[Send Email: "API call failed, retrying later"]

[Stop: Success]

Example 2: Catch All Errors in Scope

Handle any error in a Sub Flow:

[Sub Flow: "DataProcessing"]
Inside Sub Flow:
- [Read File]
- [Parse Data]
- [Validate Data]
- [Save to Database]
- [Catch]
Nodes: All

[Log Error Details]

[Update Status: Failed]

Example 3: Multiple Error Handlers

Different handling for different node types:

[Database Operation] → (error) → [Catch DB] → [Retry with backoff]
[API Call] → (error) → [Catch API] → [Use fallback service]
[File Operation] → (error) → [Catch File] → [Create directory and retry]

Usage Notes

  • When a node has Continue On Error enabled, errors are not caught even with a Catch node
  • Catch works at the scope level - it catches errors from nodes in the same scope
  • Selecting "All" catches errors from all nodes in the current scope
  • The error payload contains: error type, message, source node ID, source node name, and original payload
  • Multiple Catch nodes can catch errors from the same node
  • Catch doesn't prevent the error - it provides a way to handle it
  • Sub Flows have their own error catching scope
  • Caught errors don't propagate to parent scopes unless re-thrown

Tips

  • Use Catch to implement graceful error handling instead of letting errors stop the flow
  • Log error details before handling for debugging and audit trails
  • Use Catch with decision nodes to implement different recovery strategies per error type
  • In Sub Flows, use Catch to handle errors locally before they propagate
  • Select specific nodes for targeted error handling instead of catching all
  • Access error details via the output payload for context-aware error handling
  • Combine Catch with Log and Stop nodes for proper error reporting
  • Don't rely on Catch if Continue On Error is enabled on source nodes
  • Use Catch in loops to handle individual item failures without stopping the entire process
  • Consider using multiple Catch nodes for different error categories
  • Test error paths thoroughly - Catch is only useful if error handling logic is correct
  • Stop - For terminating flow after catching errors
  • Log - For logging error details
  • Sub Flow - Creates error handling scopes
  • Should Stop - For checking if flow should terminate