Action error evaluation
Summarize
Summary of Action error evaluation
Action error evaluation in ServiceNow enables actions to detect when individual steps fail and continue running, while allowing customization of action status codes, messages, and error states. This capability helps you specify failure behavior for each action step and create tailored error handling logic to improve troubleshooting and corrective responses within your flows.
Show less
Key Features
- Catch step failures and continue: Decide whether an action continues running after a step fails, without affecting the step’s status.
- Step Status data pills: Access runtime details including error codes (0 for success, 1 for error) and system-generated error messages for each step, which are not customizable.
- Error Evaluation section: Configure multiple error conditions with labels, matching criteria, error states, custom action status codes, and messages that the action returns when conditions are met.
- Custom error conditions: Create specific conditions to return custom error codes and messages that provide detailed handling information to flow designers.
- Action Status data pills: Retrieve runtime status of the entire action, including the code and message from the first matching error condition or last step run.
- Flexible error evaluation order: Error conditions are evaluated sequentially from top to bottom, stopping at the first match, which allows prioritization of specific error handling.
Practical Guidelines for ServiceNow Customers
- Allow only independent steps to continue: Permit continuation only if subsequent steps do not depend on the failed step’s output.
- Limit error conditions: Avoid creating more than 10 error conditions to prevent performance degradation from excessive evaluation.
- Identify specific step failures: Use step status data pills to pinpoint exactly which step failed, useful for actions with repetitive step types and for enabling precise corrective flow responses.
- Order error conditions carefully: Place specific error conditions before general ones to ensure correct matching during evaluation.
- Use descriptive labels: Apply clear labels to error conditions to facilitate identification and maintenance without needing to edit the condition.
- Add error conditions prudently: Enable actions to return custom statuses that flows can interpret as errors or successes, improving flow error handling decisions.
Benefits for Your ServiceNow Implementation
By leveraging action error evaluation, you gain more robust and flexible error handling within your automation flows. It improves your ability to diagnose issues, maintain flow continuity despite step failures when appropriate, and deliver clearer status information for faster resolution. This ultimately enhances the reliability and manageability of your ServiceNow 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
- 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
- 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.