Trigger a workflow
You can trigger a workflow manually, or using a variety of automated methods such as a recurring schedule, a Datadog Monitor, or a Security Signal Notification Rule. Before you can trigger an automatic workflow, you must associate the workflow with a unique service account. For more information on service accounts, see Service accounts for Workflows.
Manually trigger a workflow
To trigger a workflow manually:
- From the workflow page, click Run.
- Enter the values for existing trigger variables.
- When you’re ready to run the workflow, click Save & Run.
Manually trigger a workflow from a Dashboard
To trigger a workflow from a Dashboard, add the Run Workflow widget:
- From your Dashboard, click Add Widget.
- Search for
workflows
and add the Run Workflow widget. - Under Select the workflow, find your workflow in the dropdown menu.
- Enter a title for the widget and click Save
To run the workflow:
- Click Run Workflow on your dashboard widget.
- Under Execution parameters, enter the required trigger variables for your workflow.
- Click Run to run the workflow.
Trigger a workflow from a Monitor
To trigger a workflow from a Monitor:
- On the workflow canvas, click Add an Automated Trigger and select @mention.
- Click Create to create a service account. For more information, see Service Accounts for Workflows.
- Next to @workflow-, enter a mention name for the trigger. Your mention name must be unique.
- Save your Workflow.
- Navigate to the Monitors page in Datadog.
- Find the monitor you’d like to use to trigger the workflow and edit it, or create a new monitor.
- In the message section, add the full workflow mention name:
- The mention name should start with
@workflow-
. For example, @workflow-my-workflow
- To pass trigger variables into the workflow, use a comma-separated list with the syntax
@workflow-name(key=value, key=value)
. For example, @workflow-my-workflow(name="Bits", alert_threshold=threshold)
- Save the monitor.
Each time the monitor threshold is hit, the monitor triggers a workflow run.
Trigger a workflow from a Security Signal Notification Rule
You can set up a workflow to trigger every time a Security Signal Notification Rule fires.
To trigger a workflow from a Notification Rule:
- On the workflow canvas, click Add an Automated Trigger and select @mention.
- Click Create to create a service account. For more information, see Service Accounts for Workflows.
- Next to @workflow-, enter a mention name for the trigger. Your mention name must be unique.
- Save your Workflow.
- From the Setup & Configuration page, find the Detection Rule you’d like to use to trigger your workflow, or create a new rule.
- In the Recipient section, add the full workflow mention name. For example,
@workflow-my-workflow
. - Click Save and Activate.
Each time the Notification Rule fires, it triggers a workflow run.
Trigger a workflow on a schedule
To schedule a workflow run:
- On the workflow canvas, click Add an Automated Trigger and select Schedule.
- Click Create to create a service account. For more information, see Service Accounts for Workflows.
- Enter a time and frequency for the run.
- (Optional) Enter a description for the workflow in the Memo field.
- Click Save.
Further reading
Additional helpful documentation, links, and articles: