If Error

Specify alternate actions to handle an error without stopping your flow.

The If Error function appears as a container in a flow, and it allows you to specify the following:

  • Try: Run one or more actions and/or functions.

  • If Error: Specify alternate actions and/or functions to run if an error occurs in any of the steps in the Try section.

  • Outputs (optional): Output fields that can be used in subsequent steps of the flow. The value assigned to each output depends on whether or not an error occurred.

Use the dropdown to switch between the Try steps and If Error steps.

Try

When you add a new If Error container to a flow, you must first define steps in the Try section. These are one or more actions and/or functions to run. Add cards to this container just as you would elsewhere in a flow.

To add error handling to an existing set of steps in your flow, insert the If Error block to the right of the cards you want in your Try block and then drag them in, one by one, starting with the rightmost card.

To retry a step in your flow automatically before manually fixing an error, see Set error handling for cards in flows.

If Error

The If Error block contains the steps you want to take to handle an error. Add actions and/or functions just as you would elsewhere in a flow.

An Error object is added to each If Error block. This object contains the details of the error in the Try block that results in a switch to the If Error block, including the following:

  • message: Text of the error message (when available).

  • code: Error code (for example, 500).

  • method: ID for the step where the error occurred.

  • flo: ID of the flow.

  • execution: ID of a specific execution of the flow. You can use these values in your error handling steps. For example, you can send an email with details of the error, or conditionally check whether or not to proceed based on whether it's an expected error.

Return and Continue If cards will typically end a flow but behave differently when inside a Try or If Error block. Think of Try or If Error blocks as anonymous helper flows. Just as when you call a helper flow, a Return returns you to the parent. So, a Return or Continue If (when false) inside a Try or If Error block proceeds to the step immediately after the If Error container. Use Return Error or Return Error If, or a Continue If outside the If Error, if you want to halt the flow rather than continue.

Output (Optional)

You can drag outputs from cards that run before the If Error into a Try or If Error block, but you cannot drag outputs from inside the Try or If Error block to cards that are run after the If Error. This is because a step from inside a Try or If Error may not always run. The way to get around this is to use the optional Outputs feature.

  1. To access the Outputs, click View Outputs (on the top-right of the If Error container). This opens up a pane that appears to the right of the Try and If Error blocks.

  2. Click to add a new output. You can type the name and choose the type. Two inputs appear beneath each output.

  3. Drag an output from the Try block to one of the two input fields. This is for the case where error doesn't occurs.

  4. Drag an output from the If Error block to the other input field. This is for the case where an error occurs.

The outputs in this pane can be mapped to subsequent steps in the flow.

Related topics

Functions in Workflows

Elements of Workflows