Action error evaluation
-
- UpdatedJan 30, 2025
- 4 minutes to read
- Yokohama
- Create Workflows
Enable actions to catch step failures and continue running. Identify when specific error conditions occur and return your own action status code, status message, and error state.
Benefits
Enable action error evaluation to gain these benefits.
- Catch step failures and allow an action to continue running. Specify the failure behavior of each step you add to an action.
- Create your own error conditions. Specify when an action returns an error state as well as the status codes and messages they return.
- Provide more error handling information and options to flow designers. Use your own action status codes and messages to identify issues and provide details for corrective actions.
Action error evaluation step components
Each step offers these error evaluation components.

- 1. If this step fails option
- Option to continue running the next step or go to error evaluation. This option has no effect on the Step Status.
- 2. Step Status
- Object data pill containing runtime details about the step. Each step in an action returns a Step Status.
- 3. Step Status > Code
- Integer data pill indicating whether the step produced an error. A step returns a value of 1 when it produces an error for any reason. For example, a step can produce an error if it is missing mandatory input data or returns output in the wrong data type. A step returns a value of 0 when it runs successfully. You cannot customize these codes.
- 4. Step Status > Message
- String data pill containing the error message produced by the step or system operation. You cannot customize the step status message.
Action error evaluation configuration components
Action error evaluation consists of these configuration components.

- 5. Error Evaluation section
- Section containing possible error conditions. When an action runs, it evaluates the
available error conditions from top to bottom looking for a possible match. An
action returns the Action Status specified by the first matching error
condition. If there is no matching error condition, the Action status is set to
the Step Status of the last step run.
Note: Data stream actions have an error evaluation section for REST, SOAP, and JDBC steps. For more information see Data Stream actions and pagination.
- 6. Add error condition option
- Option to add an error condition. Each error condition is equivalent to an else if flow logic block. Only one error condition can be true at a time.
- 7. Error condition configuration
- Options available to configure an error condition.
- Label you want to use to identify this error condition
- Conditions that must be met to match this error condition
- Error state you want the action to return to flow
- Action Status Code you want the action to return to flow
- Action Status Message you want the action to return to flow
- 8. Action Status
- Object data pill containing runtime details about the action. An action always returns an Action Status.
- 9. Action Status > Code
- Integer data pill containing the code returned by the first matching error condition or the last step run. You can return your own code when you create a custom error condition.
- 10. Action Status > Message
- String data pill containing the message produced by a matching error condition or the last step run. You can return your own message when you create a custom error condition.
Flow and action error handling resources
For more information about using error handling in actions and flows, see the ServiceNow® Community post Flow and Action Error Handling Overview: Why and how to test for errors - Worfklow Automation CoE.
- Flow and Action Error Handling Level 1: Retry and Action Error Evaluation - Workflow Automation CoE
- Flow and Action Error Handling Level 2: Flow Logic - Workflow Automation CoE
- Flow and Action Error Handling Level 3: Flow Error Handling - Workflow Automation CoE
- Flow and Action Error Handling Level 4: Good Practices and Summary - Workflow Automation CoE
General guidelines
Follow these general guidelines to achieve the benefits offered by action error evaluation.
- Allow only independent steps to continue running
- Allow a step to continue running if it does not return data required by a later step. If a step provides data necessary for later steps, then you know that the later steps cannot run successfully.
- Avoid more than 10 error conditions
- While there is no limit to the number of error conditions you can create, each error condition requires evaluation. The more error conditions your action has to evaluate, the potentially slower your action can run.
- Identify specific step failures
- You can use the Step Status to identify when a specific step fails. Identifying a specific step can be useful when your action contains multiple instances of the same type of step. You may also want to identify a specific step so that a flow error handler can take specific corrective actions for the failure.
- Put specific error conditions before general error conditions
- Error evaluation stops when the action finds a matching error condition. Putting general error conditions first may prevent the action from ever matching specific error conditions.
- Use descriptive error condition labels
- Identify an error condition without having to edit it. By default, you can only see error conditions when you edit them.