Error handling
- Overview
- How the template works
- Benefits of the template
- How to use the template
Overview
Any workflow can encounter runtime errors. Errors can arise because of workflow definition issues, task failures or because of transient issues, such as network partition events.
When an error occurs, SimWorkflow by default will fail the whole workflow.
This error handling workflow can be used as error handling workflow to send email, SMS, and Slack notifications whenever an error arises during workflow execution.
How the template works
When the workflow is triggered (by the failed workflow), this error handling workflow takes the following actions:
-
Retrieval of Failed Workflow Details: The workflow retrieves detailed information about the failed workflow, including what went wrong, which tasks were affected, and any other relevant information.
-
Parallel Notification Dispatch: Using parallel task, the workflow sends notifications simultaneously via email, SMS, and Slack. This ensures that stakeholders are promptly informed about the error, allowing for quick response and resolution.
Benefits of the template
-
Efficient Error Handling: By promptly alerting stakeholders about errors, the template facilitates quick response and resolution, minimizing downtime and disruptions.
-
Comprehensive Alerting: The use of multiple communication channels ensures that stakeholders receive notifications through their preferred means, maximizing the chances of timely response.
-
Transparency and Collaboration: Detailed error information retrieval fosters transparency and enables stakeholders to work together to address the issue effectively.
How to use the template
Step 1: Create AWS credentials
- Generate AWS access key and secret access key.
- Log in to the SimWorkflow.
- Navigate to Credentials.
- Click Create credentials button.
- Select AWS tab.
- Enter Amazon SNS in the Name field.
- Enter the Access key in the Access key ID field.
- Enter the Secret access key in the Secret access key field.
- Click Create credentials button.
Step 2: Create Slack OAuth 2.0 credentials
- Ensure you have set up Slack OAuth 2.0 and have access to client ID and client secret.
- Navigate to Credentials.
- Click Create credentials button.
- Select OAuth 2.0 tab.
- Select Slack from the Provider dropdown.
- Enter Slack to the Name field.
- Enter the Client ID in the Client ID field.
- Enter the Client Secret in the Client secret field.
- Enter chat:write to the Scopes field.
- Click Create credentials button.
Step 3: Create SimWorkflow Bearer token credentials
Step 3.1: Create SimWorkflow Personal access token
- Navigate to Settings > Personal access tokens.
- Enter SimWorkflow to the Name field.
- Enter 30 to the Token expiration in days fields.
- Click Create personal access token button.
- Copy the Token text.
Step 3.2: Create credentials
- Navigate to Credentials.
- Click Create credentials button.
- Select Bearer token tab.
- Enter SimWorkflow to the Name field.
- Paste the Token to the Bearer token field.
- Click Create credentials button.
Step 4: Use this workflow template
- Click Use this template button on the top right of this page.
- Click Fetch WF details task and select Configuration tab.
- Select SimWorkflow (Bearer token) for Credentials field.
- Click Slack task and select Configuration tab.
- Select Slack (OAuth 2.0) for Credentials field.
- Click SMS task and select Configuration tab.
- Select Amazon SNS (AWS) for Credentials field.
- Click Save button.
- Toggle the Enable checkbox to enable the workflow definition.
Step 5: Define variables
- Navigate to Workflow definitions.
- Click Variables menu item from the three dots (more options) menu of the Error handling workflow definition.
Step 5.1: Email address
- Enter emailAddress in the Variable key field.
- Enter the email address to receive the notification in the Variable value field.
- Click Save variable button.
Step 5.2: Mobile phone number
- Enter mobileNumber in the Variable key field.
- Enter the mobile number to receive the SMS message in the Variable value field.
- Click Save variable button.
Step 5.3: AWS region
- Enter awsRegion to the Variable key field.
- Enter AWS region to the Variable value field.
- Click Save variable button.