Error Handling in Automation Workflows
During workflow execution, you may encounter scenarios where the process deviates from the default configured path. This may occur due to errors such as Web Service unavailable, Bad request, authentication failures, or data availability. In such cases, the workflow process is interrupted and the execution fails. To handle such deviations, you can use the Error Boundary Event .
Error event Boundary events are used to handle errors that may occur during workflow execution. The Error Event allows the process to proceed to a certain path based on the encountered error. You can define error codes or validations that you anticipate may occur and define the alternate path or tasks to be executed in case of the error. For example, Consider a workflow to create a new user account in Active Directory (AD). Along with the default behavior to create the new user, the workflow developer must design the workflow to handle the cases when the Active Directory server is not reachable or the requested user is already available in AD.
To handle errors in your workflows, you must:
Identify Errors
The first step is to identify the potential Errors. Errors refer to the possible issues that we may encounter during task execution. These could be the error codes that we receive when the web service operation fails or a user-defined data validation on the response received from the third-party system. You can capture these errors and define an alternate behavior in the process.
There are two ways to handle Errors in Serviceaide Automation:
Configure Error Code
The Error Codes are used to handle Technical errors in Service tasks or Script task executions. The error codes are based on the error messages and codes received from the integration or the executed script. ESA allows you to define a default error configuration that catches any technical error that fails and terminates the workflow.
To configure an Error code, do the following:
On your workflow, select the required workflow step.
Navigate to the On Failure tab in the Properties Panel.
In the Error Codes section, define the error codes to be handled.
Configure the Default error handler:
Select Configure Default Error Handler to define default behavior for any error that causes task failure.
Add the Error Message. This message appears in the execution logs.
If you wish to parse the output and extract information from the response received from the web operation, select Extract Output Parameters.
Click on + to add new parameters.
Add Parameter Name and Data type.
To extract from a JSON path, select Extractor Type and Expression.
You may also set a Workflow variable when the error occurs.
On Set Workflow Variables, click on +.
Select the required Workflow Variable.
Select the Mapping mode and Source to assign value to the selected Workflow Variable.
You may add as many Error Codes as you want. The defined error codes are evaluated only when the associated Service Task or Script Task fails.
Configure Business Validation
Business Validations are the user-defined data rules defined to handle a specific data scenario. These rules are added when you want to configure an alternate behavior in case a specific type of data is received from the web service.
The Business Validation are evaluated only when yje associated Service Task is successfully executed and no error is received.
To configure a Buisness Validation, do the following:
On your workflow, select the required workflow step.
Navigate to the On Success tab in the Properties Panel.
On the Business Validations tab, click on + to add rules.
Add Error Code and Error Message.
Under Conditions, add the rule.
Select the Operand Type
Based on the Operand Type, select the Source and the required Parameter.
Add the Rule to be applied.
You may also Set a Workflow variable when the error occurs.
On Set Workflow Variables, click on +.
Select the required Workflow Variable.
Select the Mapping mode and Source to assign value to the selected Workflow Variable.
Create Error Boundary Event
Once the error codes are defined, the next step is to add the Error Boundary event to the Service Task. The Error boundary event represents the number of alternate paths required in case of any deviation from the default behavior. You may add as many Error codes and validations as you need to a Service Task. Each Error Boundary event should be mapped to a error code and validation. Based on the execution status of the task, the events are evaluated and executed.
To add an Error boundary, follow the below steps:
Select the Error Boundary in the left pane and drag it to the Service Task.
On the Properties Panel of the error boundary, add the event Name and select the error code or Business Validation in the Error Code list.
The Error Code or Business Validation assigned to the event is evaluated when the execution reaches the event.
You may add as many Error Boundary events as you want. However, only one of the event and associated path is executed.
The Events are evaluated in sequence of their definition. The very first rule that evaluates to true is executed.
Configure Alternate Path
Once the Error Event Boundary is added, you can now define the behavior or series of tasks that should be executed when the associated rule is evaluated to True. You may add Service Tasks, Scripts, or decision gateways as part of the flow. For more information on how to configure the workflow steps, refer to Design Automation Workflow.
Â