<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

How to Add Error Handling to a Flow in Okta Workflows

Workflows
Okta Classic Engine
Okta Identity Engine

Overview

When a card execution fails, the flow execution will stop. Any cards after the error card will not be executed. This article details how to add error handling to a flow and continue execution when an error occurs.

Applies To

  • Okta Workflows
  • Okta Identity Engine (OIE)
  • Okta Classic Engine

Cause

In the screenshot below, the API call fails, the flow stops executing, and the Assign card is not processed.

Card execution error  
Card execution error

 

Another example where flow execution stops is when the Read User card returns an error (for an invalid user ID).

Card execution error  
Card execution error

 

Solution

How is error handling added to a flow in Okta Workflows?

 

Configure the Error Handling - If Error card to gracefully handle errors and continue the flow execution by placing the primary action cards in the Try section and the error processing cards in the If Error section.

The If Error card has two sections: Try and If Error. If something is tried and fails, the if error logic will be called, allowing continuity in the execution flow.

Using the API example from above, this is how the Try section looks:

  1. Place the primary action cards inside the Try section of the Error Handling - If Error card to execute the initial logic.
    If Error card – Try section
    If Error card – Try section
  2. Add the necessary cards to the If Error section of the Error Handling - If Error card to process the error if the action in the Try section returns an error.
    If Error card – section to handle error
    If Error card – section to handle error
  3. The If Error card allows defining the output. In this example, based on the path taken, the Number will be set to either 100 or -100.
    1. Learn how to create outputs for an If/Else card
    2. Learn How to Handle an External API Call Error in Workflows
  4. If the flow generates an error, the If Error card handles the error, and the flow execution continues. The Assign card outside of If Error was processed.
    Flow execution continues after an error
    Flow execution continues after an error

 

Alternatively, apply the same error handling logic using a Read User card by placing it inside the Try section, configuring the If Error section, and reviewing the flow execution.

  1. Place the Read User card inside the Try section of the If Error card to apply the error handling logic to user read operations.
    If Error card – Try section
    If Error card – Try section
  2. Configure the If Error section with the appropriate cards to handle the Read User card error.
    If Error card – section to handle error
    If Error card – section to handle error
  3. Review the flow execution to ensure it continues and processes the Assign card outside the If Error block despite the Read User card resulting in an error.

 

Related References

Loading
How to Add Error Handling to a Flow in Okta Workflows | Okta Support