Use this template

Error handling

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:

  1. 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.

  2. 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

How to use the template

Step 1: Create AWS credentials

  1. Generate AWS access key and secret access key.
  2. Log in to the SimWorkflow.
  3. Navigate to Credentials.
  4. Click Create credentials button.
  5. Select AWS tab.
  6. Enter Amazon SNS in the Name field.
  7. Enter the Access key in the Access key ID field.
  8. Enter the Secret access key in the Secret access key field.
  9. Click Create credentials button.

Step 2: Create Slack OAuth 2.0 credentials

  1. Ensure you have set up Slack OAuth 2.0 and have access to client ID and client secret.
  2. Navigate to Credentials.
  3. Click Create credentials button.
  4. Select OAuth 2.0 tab.
  5. Select Slack from the Provider dropdown.
  6. Enter Slack to the Name field.
  7. Enter the Client ID in the Client ID field.
  8. Enter the Client Secret in the Client secret field.
  9. Enter chat:write to the Scopes field.
  10. Click Create credentials button.

Step 3: Create SimWorkflow Bearer token credentials

Step 3.1: Create SimWorkflow Personal access token

  1. Navigate to Settings > Personal access tokens.
  2. Enter SimWorkflow to the Name field.
  3. Enter 30 to the Token expiration in days fields.
  4. Click Create personal access token button.
  5. Copy the Token text.

Step 3.2: Create credentials

  1. Navigate to Credentials.
  2. Click Create credentials button.
  3. Select Bearer token tab.
  4. Enter SimWorkflow to the Name field.
  5. Paste the Token to the Bearer token field.
  6. Click Create credentials button.

Step 4: Use this workflow template

  1. Click Use this template button on the top right of this page.
  2. Click Fetch WF details task and select Configuration tab.
  3. Select SimWorkflow (Bearer token) for Credentials field.
  4. Click Slack task and select Configuration tab.
  5. Select Slack (OAuth 2.0) for Credentials field.
  6. Click SMS task and select Configuration tab.
  7. Select Amazon SNS (AWS) for Credentials field.
  8. Click Save button.
  9. Toggle the Enable checkbox to enable the workflow definition.

Step 5: Define variables

  1. Navigate to Workflow definitions.
  2. Click Variables menu item from the three dots (more options) menu of the Error handling workflow definition.

Step 5.1: Email address

  1. Enter emailAddress in the Variable key field.
  2. Enter the email address to receive the notification in the Variable value field.
  3. Click Save variable button.

Step 5.2: Mobile phone number

  1. Enter mobileNumber in the Variable key field.
  2. Enter the mobile number to receive the SMS message in the Variable value field.
  3. Click Save variable button.

Step 5.3: AWS region

  1. Enter awsRegion to the Variable key field.
  2. Enter AWS region to the Variable value field.
  3. Click Save variable button.