Action error evaluation

  • Release version: Zurich
  • Updated July 31, 2025
  • 4 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Action error evaluation

    Action error evaluation in ServiceNow enables you to catch step failures within actions and continue running the action while identifying specific error conditions. This capability allows you to define custom action status codes, messages, and error states to provide detailed error handling and improve flow management.

    Show full answer Show less

    Key Features

    • Continue Running Steps: You can configure steps to continue running even if previous steps fail, facilitating more resilient workflows.
    • Custom Error Conditions: Create and configure specific error conditions with labels, status codes, messages, and error states to precisely identify and handle failures.
    • Error Evaluation Process: Actions evaluate error conditions sequentially from top to bottom, returning the status of the first matching condition, or the status of the last step if none match.
    • Step Status Data: Each step returns a Step Status object with a code (0 for success, 1 for error) and a message, providing runtime details for error detection.
    • Action Status Data: Actions return an Action Status object reflecting the outcome based on error conditions or the last executed step, customizable through your error condition definitions.
    • Error Condition Configuration: Easily add multiple error conditions acting as conditional branches and specify how the action should respond when those conditions are met.

    Practical Guidelines

    • Allow only independent steps to continue running to avoid cascading failures from missing critical data.
    • Limit error conditions to fewer than 10 to maintain optimal action performance since each condition is evaluated sequentially.
    • Place specific error conditions before general ones to ensure precise error identification and handling.
    • Use descriptive labels for error conditions to quickly identify them without needing to edit the configuration.
    • Identify specific step failures via Step Status to enable targeted corrective actions in flow error handlers.

    Benefits for ServiceNow Customers

    By leveraging action error evaluation, you gain enhanced control and visibility over action execution and error handling in workflows. This improves your ability to diagnose issues, apply corrective measures, and maintain smooth automation processes. Custom status codes and messages provide clear, actionable information for troubleshooting and flow decision-making.

    Additional Resources

    For deeper understanding and advanced techniques, consult ServiceNow Community resources and Workflow Automation CoE posts on flow and action error handling, covering retry strategies, flow logic, error handling best practices, and testing methodologies.

    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.

    Figure 1. Error evaluation step components
    Sample step configured to Don't stop the action and go to the next step if this step fails.
    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.

    Figure 2. Error evaluation configuration components
    Sample Error Evaluation section with an error condition. The sample error condition returns an Action Status Code of 100 and an Action Status Message of No Incident Task Created.
    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 .
    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

    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.