이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.
Workflow Automation is not supported for your selected Datadog site ().
You can trigger a workflow manually or automatically and a workflow can have multiple triggers. This allows you to trigger a workflow from a variety of different sources, like a Datadog monitor and a Datadog dashboard.
A workflow can either run with the identity of the user who owns it, or with the identity of a service account associated with the workflow. For more information on service accounts, see Service accounts for Workflow Automation.
Manual triggers
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.
Dashboard triggers
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. Only published workflows with dashboard triggers appear in the list.
Map dashboard template variables to workflow input parameters. This allows the values of your dashboard template variables to be mapped directly to the input parameters when you run the workflow.
Enter a title for the widget and click Save.
To run the workflow:
Click Run Workflow on your dashboard widget.
Under Execution parameters, any template variables you mapped to workflow inputs are automatically populated. Enter the values for any unmapped execution parameters, or edit the existing values if needed.
Click Run to run the workflow.
Monitor triggers
Add a monitor trigger to your workflow
Add a monitor trigger to your workflow:
If your workflow doesn’t have any triggers, click Add Trigger > Monitor.
If your workflow already has one or more triggers and you’re adding the monitor as an additional trigger, click the Add Trigger (lightning bolt) icon and select Monitor.
Make sure the trigger is connected to a step in the workflow. You can connect the trigger to a step by clicking and dragging the plus icon (+) under the trigger.
Click the trigger and take note of the Mention handle.
Monitor triggers are set to trigger automatically by default. If you don’t want the workflow to trigger automatically, toggle the Automatic triggering option.
Save your Workflow.
Click Publish to publish your workflow. Workflows don’t run automatically until you’ve published them. Published workflows accrue costs based on workflow executions. For more information, see the Datadog Pricing page.
Find the monitor you’d like to use to trigger the workflow and edit it, or create a new monitor.
In the Configure notifications & automations section, click + Add Workflow.
Use the workflow mention name to search for your workflow and select it from the dropdown. Only workflows with monitor triggers appear in the list. A mention for the monitor appears in the notification message field, in the format @workflow-name if it takes no input parameters or @workflow-name(param="") if it takes input parameters.
If the workflow takes input parameters:
Click Configure Inputs next to the monitor name and ID.
Enter values for the input parameters. Note: Values can include monitor message template variables. To see a list of available variables, click Use Message Template Variables in the upper-right of the Configure notifications & automations section. The parameters populate in the mention within the notification message field. For example, if you configure a workflow named @workflow-test-inputs to have the following parameters:the mention changes to @workflow-test-inputs(im_a_string="abc", im_a_number=123, im_a_boolean=true, i_have_a_default_value="override this").
Save the monitor.
Each time the monitor threshold is reached, the monitor triggers a workflow run.
To trigger a workflow from an incident notification rule, you must first add an incident trigger to your workflow:
Add an incident trigger to your workflow:
If your workflow doesn’t have any triggers, click Add Trigger > Incident.
If your workflow already has one or more triggers and you’re adding the security trigger as an additional trigger, click the Add Trigger (lightning bolt) icon and select Incident.
Make sure the trigger is connected to a step in the workflow. You can connect the trigger to a step by clicking and dragging the plus icon (+) under the trigger.
Click the trigger and take note of the Mention handle.
Incident triggers are set to trigger automatically by default. If you don’t want the workflow to trigger automatically, toggle the Automatic triggering option.
Save your Workflow.
Click Publish to publish your workflow. Workflows don’t run automatically until you’ve published them. Published workflows accrue costs based on workflow executions. For more information, see the Datadog Pricing page.
Add the workflow to your incident notification rule:
Configure a Severity, Service, and Other attributes for your notification rule.
Under Notify, paste the workflow handle that you copied earlier.
In the Recipient section, use the workflow mention name to find your workflow. For example, @workflow-my-workflow. The workflow must have an incident trigger before you can trigger it from an incident.
Enter a Template and configure the Renotify settings for the notification rule.
Click Save.
Security triggers
You can trigger a workflow automatically for any Security Signal, or manually trigger a Workflow from a Cloud SIEM Security Signal panel. Before you can add a workflow to a Security Signal, the workflow must have a security trigger.
Security Signal Notification Rule triggers
You can set up a workflow to trigger every time a Security Signal Notification Rule fires.
To trigger a workflow from a notification rule, you must first add a security trigger to your workflow:
Add a security trigger to your workflow:
If your workflow doesn’t have any triggers, click Add Trigger > Security.
If your workflow already has one or more triggers and you’re adding the security trigger as an additional trigger, click the Add Trigger (lightning bolt) icon and select Security.
Make sure the trigger is connected to a step in the workflow. You can connect the trigger to a step by clicking and dragging the plus icon (+) under the trigger.
Click the trigger and take note of the Mention handle.
Security triggers are set to trigger automatically by default. If you don’t want the workflow to trigger automatically, toggle the Automatic triggering option.
Save your workflow.
Click Publish to publish your workflow. Workflows don’t run automatically until you’ve published them. Published workflows accrue costs based on workflow executions. For more information, see the Datadog Pricing page.
Add the workflow to your notification rule:
From the Configuration page, find the notification rule you’d like to use to trigger your workflow, or create a new rule.
In the Recipient section, use the workflow mention name to find your workflow. For example, @workflow-my-workflow.
Select the workflow from the drop-down. Only workflows with security triggers appear in the list.
Click Save.
Each time the notification rule fires, it triggers a workflow run.
Cloud SIEM Security Signal triggers
You can manually start a workflow from a Cloud SIEM Security Signal panel.
Click Run Workflow at the top of the Security Signal panel.
In the search modal, enter the name of the workflow you want to run and select it. Only workflows with security triggers appear in the list.
If your workflow requires input parameters, enter the values as required. You can copy the values from the Signal object JSON displayed next to the input parameters, and paste them into the parameter fields.
Click Run.
You can see the workflow run status in the Workflow section of the Security Signal.
Note: Your GitHub account must have permission to create webhooks to use this feature.
You can trigger a workflow from GitHub using the following steps.
Add a GitHub trigger to your workflow:
If your workflow doesn’t have any triggers, click Add Trigger > GitHub.
If your workflow already has one or more triggers and you’re adding GitHub as an additional trigger, click the Add Trigger (lightning bolt) icon and select GitHub.
Navigate to the GitHub repo you want to use to trigger your workflow.
In GitHub, click Settings, click Webhooks, and then click Add webhook.
In the Configure tab of your workflow, copy the Payload URL. Paste it into the Payload URL field on the GitHub webhook creation page.
In GitHub, set the Content type of your webhook to application/json.
In GitHub, create a secret that is at least 16 characters long, then copy this secret to the Secret field of your workflow trigger.
In GitHub, choose which events you would like to trigger your webhook, then click Add webhook.
Optionally, in your workflow, click the plus (+) to add a Rate Limit.
Click Save on your workflow.
Click Publish to publish the workflow. A workflow must be published before you can trigger it from GitHub. Published workflows accrue costs based on workflow executions. For more information, see the Datadog Pricing page.
API triggers
Triggering a workflow using an API call requires an API key and an application key with the workflows_run scope. For information on adding a scope to an application key, see Scopes.
Unscoped keys do not include the workflows_run scope by default. Ensure that you're following security best practice and use an application key with the minimum scopes needed to perform the desired task.
You can trigger a workflow by sending a POST request with the workflow ID to the endpoint https://api.datadoghq.com/api/v2/workflows/WORKFLOW-ID/instances. When you add an API trigger to a workflow, the trigger interface gives you an example cURL request that you can use to trigger the workflow.
To add an API trigger to a workflow:
Click Add Trigger > API.
On the workflow canvas, click API and note the example workflow cURL request, which includes the required headers and data to trigger your workflow.
A cURL request to trigger a workflow looks something like this:
If the workflow includes input parameters, include them in the request payload. The following example uses two input parameters, example_input1 and example_input2:
Click Publish to publish the workflow. A workflow must be published before you can trigger it with a POST request. Published workflows accrue costs based on workflow executions. For more information, see the Datadog Pricing page.
Scheduled triggers
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 Use a service account.
Enter a time and frequency for the run.
(Optional) Enter a description for the workflow in the Memo field.
Click Save.
Click Publish. Scheduled workflows don’t run until you’ve published them. Published workflows accrue costs based on workflow executions. For more information, see the Datadog Pricing page.
Trigger a workflow from a workflow
You can trigger a child workflow from another workflow using the Trigger Workflow action. For example, if you have a complex series of steps that you need to reuse in several workflows, there’s no need to recreate those steps for all of your workflows. Instead, add the steps to a new workflow and trigger it in your other workflows using the Trigger Workflow action.
For billing purposes, triggering a child workflow registers as a new workflow execution.
If the child workflow has input parameters, these parameters appear as required fields in the Trigger Workflow action. In the example below, the service_name input parameter is required because service_name is set as an input parameter in the child workflow.
Access the result of a child workflow
You can pass the result of a child workflow back to the parent workflow by defining Output parameters in the child workflow. Use the WorkflowOutputs context variable in the parent workflow to retrieve the output parameters of the child workflow. For example, given a child workflow named Example_workflow with an output parameter named exampleList, use Steps.Example_workflow.workflowOutputs.exampleList to access the result of the child workflow.
Run history
After you trigger a workflow, the workflow page switches to the workflow’s Run History. Click Configuration or Run History in the top-left to switch between the configuration and run history views. Use run history to watch the progress of a triggered workflow or debug a failed step.