- 20 Feb 2024
- 1 Minute to read
- DarkLight
Get notification on failed workflows
- Updated on 20 Feb 2024
- 1 Minute to read
- DarkLight
When a workflow fails, you must identify and fix the issue quickly. You have several options to receive a notification when a workflow fails.
- Workflow failure notifications are on the workflow level, and you must set the notification method and recipients for each workflow. Alternatively, you can set a global System Event alert upon workflow failure.
- Only published workflows will generate a failure notification.
Set up notifications
- Go to the Workflows page.
- Click the three-dot menu button.
- Select Manage notifications.
Email and webhook
Set the email address list and webhooks in the manage notification window.
Both organizational and external email addresses are supported. The email notification includes information about the execution failure:
- Workspace name
- Workflow name
- The entity that triggered the workflow
- Event ID
- Date and time the workflow failed
- Step on which the workflow failed
Webhook
A JSON event containing the failure information is sent to all webhooks listed in the manage notifications window for a given workflow.
Torq webhooks and external webhooks are supported. Be sure to use authentication headers as needed.
{
"account_name": "acme-prod",
"description": "env: environment variable \\\"RECIPIENT\\\" should not be empty",
"error": "failed parsing environment variables",
"execution_id": "0839a47c-338b-43cb-85e8-6b0d12e8fa27",
"failed_step_name": "ask_a_question",
"timestamp": "Tuesday, 14-Jun-22 09:46:07 UTC",
"triggered_by": "Scheduled Event - e1a24a77-63b1-43e0-85e8-bb64cfe0b12e",
"workflow_id": "05ca53bc-429d-48a9-85e8-0b7cc8b386ce",
"workflow_name": "workflow_name"
}
Workflow execution failure as a trigger
You can set the workflow execution failure to trigger a Torq workflow to implement an automatic response.
- Create a webhook integration.
- Copy the endpoint of your webhook integration and add it to the Webhooks list in the Manage notifications window for a workflow.
- Create a new workflow and set the webhook integration you created in step 1 as the trigger. The execution failure information is available in the workflow by using
$.event.body
. - Publish the workflow.
Slack message
You can send DMs and messages to channels by sending emails to Slack integration email addresses.
To attach an email address to a DM or channel, follow these steps in Slack.
- Right-click the DM or channel you want to message and select View conversation details or View channel details.
- Go to the Integrations tab.
- Click Send emails to this channel or Send emails to this conversation.
- Copy the email address.
- In Torq, add the email address to the Emails list in a workflow's Manage notifications.
The Slack message will include information about the execution failure.