---
title: Getting Started with Workflow Automation
description: >-
  Automate end-to-end processes triggered by Datadog alerts. Create workflows
  that integrate with Jira and Slack for faster issue resolution.
breadcrumbs: Docs > Getting Started > Getting Started with Workflow Automation
---

# Getting Started with Workflow Automation

## Overview{% #overview %}

With Workflow Automation, you can automate end-to-end processes in response to Datadog alerts and security signals. Workflow Automation is powered by real-time observability data, enabling you to resolve issues faster and proactively maintain the availability and security of your systems.

Follow this guide to create a custom workflow triggered by a monitor alert. When it is triggered, the workflow creates a task in Jira and sends a notification to Slack with a link to the Jira ticket. This guide covers passing data from one step in your workflow to another step, saving and publishing your workflow, and viewing the workflow's run history.

## Prerequisites{% #prerequisites %}

Before getting started, you need the Jira and Slack integrations installed on your [Datadog account](https://www.datadoghq.com/free-datadog-trial/). For installation instructions, see the [Slack](https://docs.datadoghq.com/integrations/slack/) and [Jira integration](https://docs.datadoghq.com/integrations/jira/) documentation.

Account credentials and authentication that you set up in the Jira and Slack integration tiles automatically propagate to the Jira and Slack actions in Workflow Automation. Some integrations require additional configuration for authentication. For more information, see [Connections](https://docs.datadoghq.com/service_management/workflows/connections/).

## Build the workflow{% #build-the-workflow %}

### Create a workflow with a monitor trigger{% #create-a-workflow-with-a-monitor-trigger %}

You can trigger a workflow from an alert, such as a monitor or security signal, from a schedule, or manually. In this case, create a workflow with a monitor trigger.

Create a workflow:

1. From the **[Workflow Automation](https://app.datadoghq.com/workflow)** page, click **New Workflow**.
1. Enter a name and description for the workflow. The example workflow uses the following name and description:Name: `Create a Jira Ticket`.Description: `Create a Jira issue and Slack notification when there is a monitor alert`.

Add and configure the monitor:

1. On the workflow canvas, click **Add Trigger** and select **Monitor**.
1. In the **Configure** tab, next to `@workflow-`, enter a unique ID for your workflow: `Create-Jira-Ticket`.Workflow handles always begin with `@workflow-`. Later, you use this handle to connect the workflow to a monitor notification.
1. Click **Save** to save your workflow.

{% image
   source="https://datadog-docs.imgix.net/images/getting_started/workflow_automation/trigger1.018152fb8f6203098b1e31261a856543.png?auto=format"
   alt="Trigger for Workflows" /%}

### Add the Jira and Slack actions{% #add-the-jira-and-slack-actions %}

Add and configure the Jira step:

1. On the workflow canvas, click the **+** icon.

1. Search for the Jira action and select **Create issue**.

1. On the workflow canvas, click the **Create issue** step.

1. In the **Configure** tab, select a **Jira Account**. The account should correspond to the Jira URL found in the **Accounts** section of the Jira integration tile.

1. Enter the **Project** and **Issue type** for the Jira issue that the workflow creates.

1. Enter a **Summary** and **Description** for the Jira issue, using context variables to pass in data from the monitor that triggers the workflow. You can access a context variable in a step by enclosing it in double braces (`{{`).The following example description uses the source, trigger, and workflow variables to pass along:

   - the source that triggered the monitor alert
   - a link to the affected monitor
   - the workflow name, and the workflow ID

   ```
   The CPU usage is above the 95% threshold for {{ Trigger.hostname }}
   
   Please investigate - see this Datadog Dashboard to view all workflow executions:
   https://app.datadoghq.com/dash/integration/workflow_automation?refresh_mode=sliding&from_ts=1698164453793&to_ts=1698168053793&live=true.
   
   The workflow that created this Jira issue is
   {{ WorkflowName }} : {{ WorkflowId }}
   
   The monitor that triggered the workflow can be found here: {{ Source.url }}
   ```

For more information on context variables, see **[Context variables](https://docs.datadoghq.com/workflows/build/#context-variables)**.

1. Test the Jira action by clicking **Test** in the **Configure** tab. Testing the action creates a real Jira ticket.

1. Click **Save** to save your workflow.

Next, add the Slack step:

1. Click the plus icon on the workflow canvas to add another step.

1. Search for Slack and select **Send message**.

1. Enter the **Slack Workspace name**.

1. Enter the **Slack Channel name**.

1. For a more useful Slack notification, use step output variables. Step output variables allow you to pass data from the Jira step to the Slack step in your workflow. Use the following message text to include the Jira issue key, the monitor name, and the Jira issue in the Slack message:

   ```
   The monitor named {{ Source.monitor.name }} triggered and created a new Jira issue
   {{ Steps.Create_issue.issueKey }}: {{ Steps.Create_issue.issueUrl }}
   
   The workflow that created this Jira issue is {{ WorkflowName }}
   ```

1. To test the action, click **Test** in the **Configure** tab. Testing an action creates a real Slack message.

1. To view your workflow's name in the monitor's notification dropdown, save and publish your workflow. Click **Publish** from the workflow's page.

## Test and publish the workflow{% #test-and-publish-the-workflow %}

{% alert level="info" %}
Testing a workflow connected to active Slack and Jira accounts creates actual Slack messages and Jira tickets.
{% /alert %}

Click **Save** to apply your changes to the workflow. Next, manually trigger the workflow to test it.

To trigger the workflow manually, click **Run** from the workflow page, and enter the values for the trigger variables.

{% image
   source="https://datadog-docs.imgix.net/images/getting_started/workflow_automation/run_workflow.5baf834e89c0a0b4b1f447086b9b52f5.png?auto=format"
   alt="Trigger a workflow manually" /%}

Confirm that running the workflow creates a Jira ticket and sends a Slack message.

Scheduled and triggered workflows don't trigger automatically until you publish them. To publish the workflow, click **Publish** from the workflow's page.

## Update the monitor that triggers your workflow{% #update-the-monitor-that-triggers-your-workflow %}

1. Navigate to the [Monitors page](https://app.datadoghq.com/monitors/manage) in Datadog.
1. Find the monitor you'd like to use to trigger the workflow and edit it, or create a new monitor.
1. In the **Configure notifications & automations** section, click **Add Workflow**.
1. Use the workflow mention name (`@workflow-Create-Jira-Ticket`) to search for your workflow and select it from the drop-down.
   - You can pass trigger variables into the workflow using a comma-separated list with the syntax `@workflow-name(key=value, key=value)`. For example, `@workflow-Create-Jira-Ticket(hostname={{host.name}})`.
1. Click **Test Notifications** to test the workflow and all of this monitor's notifications.
1. Save the monitor.

{% image
   source="https://datadog-docs.imgix.net/images/getting_started/workflow_automation/monitor_trigger.376ce0c5e8aa7644ba170a82912f27c6.png?auto=format"
   alt="Trigger a workflow from a Monitor" /%}

Each time the monitor threshold is hit, the monitor triggers a workflow run.

## Run history{% #run-history %}

After you trigger the workflow, you can watch its progress and debug failed steps in the **Run History** view. Select an executed step to see the inputs, outputs, execution context, and error messages. The example below shows a step that failed due to an invalid Jira configuration.

{% video
   url="https://datadog-docs.imgix.net/images//getting_started/workflow_automation/testing_the_workflow.mp4" /%}

To make edits to your workflow, click **Configuration**. To get back to the run history view, click **Run History**.

To view a list of previous workflow executions and whether each execution succeeded or failed, use the initial run history view. Return to the initial execution history at any time by clicking on the workflow canvas.

## Conclusion{% #conclusion %}

When the monitor triggers the workflow, it creates a Jira issue for your engineering team to review. Here is an example Jira issue:

{% image
   source="https://datadog-docs.imgix.net/images/getting_started/workflow_automation/jira_ticket.efda83505e12de925452dd5d5da62aa1.png?auto=format"
   alt="Jira ticket that is generated from the workflow" /%}

The workflow also creates a Slack message to notify your team of the Jira issue and monitor alert. Here is an example Slack notification:

{% image
   source="https://datadog-docs.imgix.net/images/getting_started/workflow_automation/slack-message.93668598a7d3eb7ca377a26d1005239a.png?auto=format"
   alt="Slack message that is generated from the workflow" /%}

## What's next?{% #whats-next %}

- Explore the list of all available workflow actions in the [Action Catalog](https://docs.datadoghq.com/actions/actions_catalog/).
- Build a workflow from an out of the box [blueprint](https://docs.datadoghq.com/workflows/build).
- Use the [HTTP action](https://docs.datadoghq.com/service_management/workflows/actions/#http) to make a request to any endpoint.
- Implement [data transformation](https://docs.datadoghq.com/service_management/workflows/actions/#data-transformation) actions to perform necessary operations on the information flowing through your workflow.

## Further reading{% #further-reading %}

- [Automate end-to-end processes and quickly respond to events with Datadog Workflows](https://www.datadoghq.com/blog/automate-end-to-end-processes-with-datadog-workflows/)
- [Access and authentication](https://docs.datadoghq.com/actions/workflows/access_and_auth/)
- [Automate security workflows](https://docs.datadoghq.com/security/cloud_security_management/workflows/)
