Workflow Automation

Datadog Workflow Automation allows you to automate your end-to-end processes by connecting Datadog with the rest of your tech stack. Build workflows to auto-remediate your alerts, streamline your incident and security processes, and reduce manual toil. Workflow Automation supports over 1,000+ OOTB actions, including AWS, JIRA, ServiceNow, GitHub, and OpenAI. Learn more in our Workflow Automation docs here.

GET https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}https://api.datadoghq.eu/api/v2/workflows/{workflow_id}https://api.ddog-gov.com/api/v2/workflows/{workflow_id}https://api.datadoghq.com/api/v2/workflows/{workflow_id}https://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}https://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}

Overview

Get a workflow by ID. This API requires an application key scoped with the workflows_read permission. This endpoint requires the workflows_read permission.

Arguments

Path Parameters

Name

Type

Description

workflow_id [required]

string

The ID of the workflow.

Response

Successfully got a workflow.

The response object after getting a workflow.

Expand All

Field

Type

Description

data

object

Data related to the workflow.

attributes [required]

object

The definition of WorkflowDataAttributes object.

createdAt

date-time

When the workflow was created.

description

string

Description of the workflow.

name [required]

string

Name of the workflow.

published

boolean

Set the workflow to published or unpublished. Workflows in an unpublished state will only be executable via manual runs. Automatic triggers such as Schedule will not execute the workflow until it is published.

spec [required]

object

The spec defines what the workflow does.

annotations

[object]

A list of annotations used in the workflow. These are like sticky notes for your workflow!

display [required]

object

The definition of AnnotationDisplay object.

bounds

object

The definition of AnnotationDisplayBounds object.

height

double

The bounds height.

width

double

The bounds width.

x

double

The bounds x.

y

double

The bounds y.

id [required]

string

The Annotation id.

markdownTextAnnotation [required]

object

The definition of AnnotationMarkdownTextAnnotation object.

text

string

The markdownTextAnnotation text.

connectionEnvs

[object]

A list of connections or connection groups used in the workflow.

connectionGroups

[object]

The ConnectionEnv connectionGroups.

connectionGroupId [required]

string

The ConnectionGroup connectionGroupId.

label [required]

string

The ConnectionGroup label.

tags [required]

[string]

The ConnectionGroup tags.

connections

[object]

The ConnectionEnv connections.

connectionId [required]

string

The Connection connectionId.

label [required]

string

The Connection label.

env [required]

enum

The definition of ConnectionEnvEnv object. Allowed enum values: default

handle

string

Unique identifier used to trigger workflows automatically in Datadog.

inputSchema

object

A list of input parameters for the workflow. These can be used as dynamic runtime values in your workflow.

parameters

[object]

The InputSchema parameters.

defaultValue

The InputSchemaParameters defaultValue.

description

string

The InputSchemaParameters description.

label

string

The InputSchemaParameters label.

name [required]

string

The InputSchemaParameters name.

type [required]

enum

The definition of InputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

outputSchema

object

A list of output parameters for the workflow.

parameters

[object]

The OutputSchema parameters.

defaultValue

The OutputSchemaParameters defaultValue.

description

string

The OutputSchemaParameters description.

label

string

The OutputSchemaParameters label.

name [required]

string

The OutputSchemaParameters name.

type [required]

enum

The definition of OutputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

value

The OutputSchemaParameters value.

steps

[object]

A Step is a sub-component of a workflow. Each Step performs an action.

actionId [required]

string

The unique identifier of an action.

completionGate

object

Used to create conditions before running subsequent actions.

completionCondition [required]

object

The definition of CompletionCondition object.

operand1 [required]

The CompletionCondition operand1.

operand2

The CompletionCondition operand2.

operator [required]

enum

The definition of CompletionConditionOperator object. Allowed enum values: OPERATOR_EQUAL,OPERATOR_NOT_EQUAL,OPERATOR_GREATER_THAN,OPERATOR_LESS_THAN,OPERATOR_GREATER_THAN_OR_EQUAL_TO,OPERATOR_LESS_THAN_OR_EQUAL_TO,OPERATOR_CONTAINS,OPERATOR_DOES_NOT_CONTAIN,OPERATOR_IS_NULL,OPERATOR_IS_NOT_NULL,OPERATOR_IS_EMPTY,OPERATOR_IS_NOT_EMPTY

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

connectionLabel

string

The unique identifier of a connection defined in the spec.

display

object

The definition of StepDisplay object.

bounds

object

The definition of StepDisplayBounds object.

x

double

The bounds x.

y

double

The bounds y.

errorHandlers

[object]

The Step errorHandlers.

fallbackStepName [required]

string

The ErrorHandler fallbackStepName.

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

name [required]

string

Name of the step.

outboundEdges

[object]

A list of subsequent actions to run.

branchName [required]

string

The OutboundEdge branchName.

nextStepName [required]

string

The OutboundEdge nextStepName.

parameters

[object]

A list of inputs for an action.

name [required]

string

The Parameter name.

value [required]

The Parameter value.

readinessGate

object

Used to merge multiple branches into a single branch.

thresholdType [required]

enum

The definition of ReadinessGateThresholdType object. Allowed enum values: ANY,ALL

triggers

[ <oneOf>]

The list of triggers that activate this workflow. At least one trigger is required, and each trigger type may appear at most once.

Option 1

object

Schema for an API-based trigger.

apiTrigger [required]

object

Trigger a workflow VIA an API. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 2

object

Schema for an App-based trigger.

appTrigger [required]

object

Trigger a workflow VIA an App.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 3

object

Schema for a Case-based trigger.

caseTrigger [required]

object

Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 4

object

Schema for a Change Event-based trigger.

changeEventTrigger [required]

object

Trigger a workflow VIA a Change Event.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 5

object

Schema for a Dashboard-based trigger.

dashboardTrigger [required]

object

Trigger a workflow VIA a Dashboard.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 6

object

Schema for a GitHub webhook-based trigger.

githubWebhookTrigger [required]

object

Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a webhookSecret. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 7

object

Schema for an Incident-based trigger.

incidentTrigger [required]

object

Trigger a workflow VIA an Incident. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 8

object

Schema for a Monitor-based trigger.

monitorTrigger [required]

object

Trigger a workflow VIA a Monitor. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 9

object

Schema for a Schedule-based trigger.

scheduleTrigger [required]

object

Trigger a workflow VIA a Schedule. The workflow must be published.

rruleExpression [required]

string

Recurrence rule expression for scheduling.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 10

object

Schema for a Security-based trigger.

securityTrigger [required]

object

Trigger a workflow VIA a Security Signal or Finding. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 11

object

Schema for a Slack-based trigger.

slackTrigger [required]

object

Trigger a workflow VIA Slack. The workflow must be published.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 12

object

Schema for a Workflow-based trigger.

startStepNames

[string]

A list of steps that run first after a trigger fires.

workflowTrigger [required]

object

Trigger a workflow VIA the Datadog UI. Only required if no other trigger exists.

tags

[string]

Tags of the workflow.

updatedAt

date-time

When the workflow was last updated.

webhookSecret

string

If a Webhook trigger is defined on this workflow, a webhookSecret is required and should be provided here.

id

string

The workflow identifier

relationships

object

The definition of WorkflowDataRelationships object.

creator

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

owner

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

type [required]

enum

The definition of WorkflowDataType object. Allowed enum values: workflows

{
  "data": {
    "attributes": {
      "createdAt": "2019-09-19T10:00:00.000Z",
      "description": "string",
      "name": "",
      "published": false,
      "spec": {
        "annotations": [
          {
            "display": {
              "bounds": {
                "height": "number",
                "width": "number",
                "x": "number",
                "y": "number"
              }
            },
            "id": "",
            "markdownTextAnnotation": {
              "text": "string"
            }
          }
        ],
        "connectionEnvs": [
          {
            "connectionGroups": [
              {
                "connectionGroupId": "",
                "label": "",
                "tags": [
                  ""
                ]
              }
            ],
            "connections": [
              {
                "connectionId": "",
                "label": ""
              }
            ],
            "env": "default"
          }
        ],
        "handle": "string",
        "inputSchema": {
          "parameters": [
            {
              "defaultValue": "undefined",
              "description": "string",
              "label": "string",
              "name": "",
              "type": "STRING"
            }
          ]
        },
        "outputSchema": {
          "parameters": [
            {
              "defaultValue": "undefined",
              "description": "string",
              "label": "string",
              "name": "",
              "type": "STRING",
              "value": "undefined"
            }
          ]
        },
        "steps": [
          {
            "actionId": "",
            "completionGate": {
              "completionCondition": {
                "operand1": "undefined",
                "operand2": "undefined",
                "operator": "OPERATOR_EQUAL"
              },
              "retryStrategy": {
                "kind": "RETRY_STRATEGY_LINEAR",
                "linear": {
                  "interval": "",
                  "maxRetries": 0
                }
              }
            },
            "connectionLabel": "string",
            "display": {
              "bounds": {
                "x": "number",
                "y": "number"
              }
            },
            "errorHandlers": [
              {
                "fallbackStepName": "",
                "retryStrategy": {
                  "kind": "RETRY_STRATEGY_LINEAR",
                  "linear": {
                    "interval": "",
                    "maxRetries": 0
                  }
                }
              }
            ],
            "name": "",
            "outboundEdges": [
              {
                "branchName": "",
                "nextStepName": ""
              }
            ],
            "parameters": [
              {
                "name": "",
                "value": "undefined"
              }
            ],
            "readinessGate": {
              "thresholdType": "ANY"
            }
          }
        ],
        "triggers": [
          {
            "apiTrigger": {
              "rateLimit": {
                "count": "integer",
                "interval": "string"
              }
            },
            "startStepNames": [
              ""
            ]
          }
        ]
      },
      "tags": [],
      "updatedAt": "2019-09-19T10:00:00.000Z",
      "webhookSecret": "string"
    },
    "id": "string",
    "relationships": {
      "creator": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "owner": {
        "data": {
          "id": "",
          "type": "users"
        }
      }
    },
    "type": "workflows"
  }
}

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.ap1.datadoghq.com/api/v2/workflowshttps://api.datadoghq.eu/api/v2/workflowshttps://api.ddog-gov.com/api/v2/workflowshttps://api.datadoghq.com/api/v2/workflowshttps://api.us3.datadoghq.com/api/v2/workflowshttps://api.us5.datadoghq.com/api/v2/workflows

Overview

Create a new workflow, returning the workflow ID. This API requires an application key scoped with the workflows_write permission. This endpoint requires the workflows_write permission.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Data related to the workflow.

attributes [required]

object

The definition of WorkflowDataAttributes object.

createdAt

date-time

When the workflow was created.

description

string

Description of the workflow.

name [required]

string

Name of the workflow.

published

boolean

Set the workflow to published or unpublished. Workflows in an unpublished state will only be executable via manual runs. Automatic triggers such as Schedule will not execute the workflow until it is published.

spec [required]

object

The spec defines what the workflow does.

annotations

[object]

A list of annotations used in the workflow. These are like sticky notes for your workflow!

display [required]

object

The definition of AnnotationDisplay object.

bounds

object

The definition of AnnotationDisplayBounds object.

height

double

The bounds height.

width

double

The bounds width.

x

double

The bounds x.

y

double

The bounds y.

id [required]

string

The Annotation id.

markdownTextAnnotation [required]

object

The definition of AnnotationMarkdownTextAnnotation object.

text

string

The markdownTextAnnotation text.

connectionEnvs

[object]

A list of connections or connection groups used in the workflow.

connectionGroups

[object]

The ConnectionEnv connectionGroups.

connectionGroupId [required]

string

The ConnectionGroup connectionGroupId.

label [required]

string

The ConnectionGroup label.

tags [required]

[string]

The ConnectionGroup tags.

connections

[object]

The ConnectionEnv connections.

connectionId [required]

string

The Connection connectionId.

label [required]

string

The Connection label.

env [required]

enum

The definition of ConnectionEnvEnv object. Allowed enum values: default

handle

string

Unique identifier used to trigger workflows automatically in Datadog.

inputSchema

object

A list of input parameters for the workflow. These can be used as dynamic runtime values in your workflow.

parameters

[object]

The InputSchema parameters.

defaultValue

The InputSchemaParameters defaultValue.

description

string

The InputSchemaParameters description.

label

string

The InputSchemaParameters label.

name [required]

string

The InputSchemaParameters name.

type [required]

enum

The definition of InputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

outputSchema

object

A list of output parameters for the workflow.

parameters

[object]

The OutputSchema parameters.

defaultValue

The OutputSchemaParameters defaultValue.

description

string

The OutputSchemaParameters description.

label

string

The OutputSchemaParameters label.

name [required]

string

The OutputSchemaParameters name.

type [required]

enum

The definition of OutputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

value

The OutputSchemaParameters value.

steps

[object]

A Step is a sub-component of a workflow. Each Step performs an action.

actionId [required]

string

The unique identifier of an action.

completionGate

object

Used to create conditions before running subsequent actions.

completionCondition [required]

object

The definition of CompletionCondition object.

operand1 [required]

The CompletionCondition operand1.

operand2

The CompletionCondition operand2.

operator [required]

enum

The definition of CompletionConditionOperator object. Allowed enum values: OPERATOR_EQUAL,OPERATOR_NOT_EQUAL,OPERATOR_GREATER_THAN,OPERATOR_LESS_THAN,OPERATOR_GREATER_THAN_OR_EQUAL_TO,OPERATOR_LESS_THAN_OR_EQUAL_TO,OPERATOR_CONTAINS,OPERATOR_DOES_NOT_CONTAIN,OPERATOR_IS_NULL,OPERATOR_IS_NOT_NULL,OPERATOR_IS_EMPTY,OPERATOR_IS_NOT_EMPTY

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

connectionLabel

string

The unique identifier of a connection defined in the spec.

display

object

The definition of StepDisplay object.

bounds

object

The definition of StepDisplayBounds object.

x

double

The bounds x.

y

double

The bounds y.

errorHandlers

[object]

The Step errorHandlers.

fallbackStepName [required]

string

The ErrorHandler fallbackStepName.

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

name [required]

string

Name of the step.

outboundEdges

[object]

A list of subsequent actions to run.

branchName [required]

string

The OutboundEdge branchName.

nextStepName [required]

string

The OutboundEdge nextStepName.

parameters

[object]

A list of inputs for an action.

name [required]

string

The Parameter name.

value [required]

The Parameter value.

readinessGate

object

Used to merge multiple branches into a single branch.

thresholdType [required]

enum

The definition of ReadinessGateThresholdType object. Allowed enum values: ANY,ALL

triggers

[ <oneOf>]

The list of triggers that activate this workflow. At least one trigger is required, and each trigger type may appear at most once.

Option 1

object

Schema for an API-based trigger.

apiTrigger [required]

object

Trigger a workflow VIA an API. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 2

object

Schema for an App-based trigger.

appTrigger [required]

object

Trigger a workflow VIA an App.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 3

object

Schema for a Case-based trigger.

caseTrigger [required]

object

Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 4

object

Schema for a Change Event-based trigger.

changeEventTrigger [required]

object

Trigger a workflow VIA a Change Event.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 5

object

Schema for a Dashboard-based trigger.

dashboardTrigger [required]

object

Trigger a workflow VIA a Dashboard.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 6

object

Schema for a GitHub webhook-based trigger.

githubWebhookTrigger [required]

object

Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a webhookSecret. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 7

object

Schema for an Incident-based trigger.

incidentTrigger [required]

object

Trigger a workflow VIA an Incident. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 8

object

Schema for a Monitor-based trigger.

monitorTrigger [required]

object

Trigger a workflow VIA a Monitor. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 9

object

Schema for a Schedule-based trigger.

scheduleTrigger [required]

object

Trigger a workflow VIA a Schedule. The workflow must be published.

rruleExpression [required]

string

Recurrence rule expression for scheduling.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 10

object

Schema for a Security-based trigger.

securityTrigger [required]

object

Trigger a workflow VIA a Security Signal or Finding. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 11

object

Schema for a Slack-based trigger.

slackTrigger [required]

object

Trigger a workflow VIA Slack. The workflow must be published.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 12

object

Schema for a Workflow-based trigger.

startStepNames

[string]

A list of steps that run first after a trigger fires.

workflowTrigger [required]

object

Trigger a workflow VIA the Datadog UI. Only required if no other trigger exists.

tags

[string]

Tags of the workflow.

updatedAt

date-time

When the workflow was last updated.

webhookSecret

string

If a Webhook trigger is defined on this workflow, a webhookSecret is required and should be provided here.

id

string

The workflow identifier

relationships

object

The definition of WorkflowDataRelationships object.

creator

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

owner

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

type [required]

enum

The definition of WorkflowDataType object. Allowed enum values: workflows

{
  "data": {
    "attributes": {
      "description": "A sample workflow.",
      "name": "Example Workflow",
      "published": true,
      "spec": {
        "connectionEnvs": [
          {
            "connections": [
              {
                "connectionId": "11111111-1111-1111-1111-111111111111",
                "label": "INTEGRATION_DATADOG"
              }
            ],
            "env": "default"
          }
        ],
        "handle": "my-handle",
        "inputSchema": {
          "parameters": [
            {
              "defaultValue": "default",
              "name": "input",
              "type": "STRING"
            }
          ]
        },
        "outputSchema": {
          "parameters": [
            {
              "name": "output",
              "type": "ARRAY_OBJECT",
              "value": "outputValue"
            }
          ]
        },
        "steps": [
          {
            "actionId": "com.datadoghq.dd.monitor.listMonitors",
            "connectionLabel": "INTEGRATION_DATADOG",
            "name": "Step1",
            "outboundEdges": [
              {
                "branchName": "main",
                "nextStepName": "Step2"
              }
            ],
            "parameters": [
              {
                "name": "tags",
                "value": "service:monitoring"
              }
            ]
          },
          {
            "actionId": "com.datadoghq.core.noop",
            "name": "Step2"
          }
        ],
        "triggers": [
          {
            "monitorTrigger": {
              "rateLimit": {
                "count": 1,
                "interval": "3600s"
              }
            },
            "startStepNames": [
              "Step1"
            ]
          },
          {
            "startStepNames": [
              "Step1"
            ],
            "githubWebhookTrigger": {}
          }
        ]
      },
      "tags": [
        "team:infra",
        "service:monitoring",
        "foo:bar"
      ]
    },
    "type": "workflows"
  }
}

Response

Successfully created a workflow.

The response object after creating a new workflow.

Expand All

Field

Type

Description

data [required]

object

Data related to the workflow.

attributes [required]

object

The definition of WorkflowDataAttributes object.

createdAt

date-time

When the workflow was created.

description

string

Description of the workflow.

name [required]

string

Name of the workflow.

published

boolean

Set the workflow to published or unpublished. Workflows in an unpublished state will only be executable via manual runs. Automatic triggers such as Schedule will not execute the workflow until it is published.

spec [required]

object

The spec defines what the workflow does.

annotations

[object]

A list of annotations used in the workflow. These are like sticky notes for your workflow!

display [required]

object

The definition of AnnotationDisplay object.

bounds

object

The definition of AnnotationDisplayBounds object.

height

double

The bounds height.

width

double

The bounds width.

x

double

The bounds x.

y

double

The bounds y.

id [required]

string

The Annotation id.

markdownTextAnnotation [required]

object

The definition of AnnotationMarkdownTextAnnotation object.

text

string

The markdownTextAnnotation text.

connectionEnvs

[object]

A list of connections or connection groups used in the workflow.

connectionGroups

[object]

The ConnectionEnv connectionGroups.

connectionGroupId [required]

string

The ConnectionGroup connectionGroupId.

label [required]

string

The ConnectionGroup label.

tags [required]

[string]

The ConnectionGroup tags.

connections

[object]

The ConnectionEnv connections.

connectionId [required]

string

The Connection connectionId.

label [required]

string

The Connection label.

env [required]

enum

The definition of ConnectionEnvEnv object. Allowed enum values: default

handle

string

Unique identifier used to trigger workflows automatically in Datadog.

inputSchema

object

A list of input parameters for the workflow. These can be used as dynamic runtime values in your workflow.

parameters

[object]

The InputSchema parameters.

defaultValue

The InputSchemaParameters defaultValue.

description

string

The InputSchemaParameters description.

label

string

The InputSchemaParameters label.

name [required]

string

The InputSchemaParameters name.

type [required]

enum

The definition of InputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

outputSchema

object

A list of output parameters for the workflow.

parameters

[object]

The OutputSchema parameters.

defaultValue

The OutputSchemaParameters defaultValue.

description

string

The OutputSchemaParameters description.

label

string

The OutputSchemaParameters label.

name [required]

string

The OutputSchemaParameters name.

type [required]

enum

The definition of OutputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

value

The OutputSchemaParameters value.

steps

[object]

A Step is a sub-component of a workflow. Each Step performs an action.

actionId [required]

string

The unique identifier of an action.

completionGate

object

Used to create conditions before running subsequent actions.

completionCondition [required]

object

The definition of CompletionCondition object.

operand1 [required]

The CompletionCondition operand1.

operand2

The CompletionCondition operand2.

operator [required]

enum

The definition of CompletionConditionOperator object. Allowed enum values: OPERATOR_EQUAL,OPERATOR_NOT_EQUAL,OPERATOR_GREATER_THAN,OPERATOR_LESS_THAN,OPERATOR_GREATER_THAN_OR_EQUAL_TO,OPERATOR_LESS_THAN_OR_EQUAL_TO,OPERATOR_CONTAINS,OPERATOR_DOES_NOT_CONTAIN,OPERATOR_IS_NULL,OPERATOR_IS_NOT_NULL,OPERATOR_IS_EMPTY,OPERATOR_IS_NOT_EMPTY

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

connectionLabel

string

The unique identifier of a connection defined in the spec.

display

object

The definition of StepDisplay object.

bounds

object

The definition of StepDisplayBounds object.

x

double

The bounds x.

y

double

The bounds y.

errorHandlers

[object]

The Step errorHandlers.

fallbackStepName [required]

string

The ErrorHandler fallbackStepName.

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

name [required]

string

Name of the step.

outboundEdges

[object]

A list of subsequent actions to run.

branchName [required]

string

The OutboundEdge branchName.

nextStepName [required]

string

The OutboundEdge nextStepName.

parameters

[object]

A list of inputs for an action.

name [required]

string

The Parameter name.

value [required]

The Parameter value.

readinessGate

object

Used to merge multiple branches into a single branch.

thresholdType [required]

enum

The definition of ReadinessGateThresholdType object. Allowed enum values: ANY,ALL

triggers

[ <oneOf>]

The list of triggers that activate this workflow. At least one trigger is required, and each trigger type may appear at most once.

Option 1

object

Schema for an API-based trigger.

apiTrigger [required]

object

Trigger a workflow VIA an API. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 2

object

Schema for an App-based trigger.

appTrigger [required]

object

Trigger a workflow VIA an App.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 3

object

Schema for a Case-based trigger.

caseTrigger [required]

object

Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 4

object

Schema for a Change Event-based trigger.

changeEventTrigger [required]

object

Trigger a workflow VIA a Change Event.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 5

object

Schema for a Dashboard-based trigger.

dashboardTrigger [required]

object

Trigger a workflow VIA a Dashboard.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 6

object

Schema for a GitHub webhook-based trigger.

githubWebhookTrigger [required]

object

Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a webhookSecret. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 7

object

Schema for an Incident-based trigger.

incidentTrigger [required]

object

Trigger a workflow VIA an Incident. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 8

object

Schema for a Monitor-based trigger.

monitorTrigger [required]

object

Trigger a workflow VIA a Monitor. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 9

object

Schema for a Schedule-based trigger.

scheduleTrigger [required]

object

Trigger a workflow VIA a Schedule. The workflow must be published.

rruleExpression [required]

string

Recurrence rule expression for scheduling.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 10

object

Schema for a Security-based trigger.

securityTrigger [required]

object

Trigger a workflow VIA a Security Signal or Finding. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 11

object

Schema for a Slack-based trigger.

slackTrigger [required]

object

Trigger a workflow VIA Slack. The workflow must be published.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 12

object

Schema for a Workflow-based trigger.

startStepNames

[string]

A list of steps that run first after a trigger fires.

workflowTrigger [required]

object

Trigger a workflow VIA the Datadog UI. Only required if no other trigger exists.

tags

[string]

Tags of the workflow.

updatedAt

date-time

When the workflow was last updated.

webhookSecret

string

If a Webhook trigger is defined on this workflow, a webhookSecret is required and should be provided here.

id

string

The workflow identifier

relationships

object

The definition of WorkflowDataRelationships object.

creator

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

owner

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

type [required]

enum

The definition of WorkflowDataType object. Allowed enum values: workflows

{
  "data": {
    "attributes": {
      "createdAt": "2019-09-19T10:00:00.000Z",
      "description": "string",
      "name": "",
      "published": false,
      "spec": {
        "annotations": [
          {
            "display": {
              "bounds": {
                "height": "number",
                "width": "number",
                "x": "number",
                "y": "number"
              }
            },
            "id": "",
            "markdownTextAnnotation": {
              "text": "string"
            }
          }
        ],
        "connectionEnvs": [
          {
            "connectionGroups": [
              {
                "connectionGroupId": "",
                "label": "",
                "tags": [
                  ""
                ]
              }
            ],
            "connections": [
              {
                "connectionId": "",
                "label": ""
              }
            ],
            "env": "default"
          }
        ],
        "handle": "string",
        "inputSchema": {
          "parameters": [
            {
              "defaultValue": "undefined",
              "description": "string",
              "label": "string",
              "name": "",
              "type": "STRING"
            }
          ]
        },
        "outputSchema": {
          "parameters": [
            {
              "defaultValue": "undefined",
              "description": "string",
              "label": "string",
              "name": "",
              "type": "STRING",
              "value": "undefined"
            }
          ]
        },
        "steps": [
          {
            "actionId": "",
            "completionGate": {
              "completionCondition": {
                "operand1": "undefined",
                "operand2": "undefined",
                "operator": "OPERATOR_EQUAL"
              },
              "retryStrategy": {
                "kind": "RETRY_STRATEGY_LINEAR",
                "linear": {
                  "interval": "",
                  "maxRetries": 0
                }
              }
            },
            "connectionLabel": "string",
            "display": {
              "bounds": {
                "x": "number",
                "y": "number"
              }
            },
            "errorHandlers": [
              {
                "fallbackStepName": "",
                "retryStrategy": {
                  "kind": "RETRY_STRATEGY_LINEAR",
                  "linear": {
                    "interval": "",
                    "maxRetries": 0
                  }
                }
              }
            ],
            "name": "",
            "outboundEdges": [
              {
                "branchName": "",
                "nextStepName": ""
              }
            ],
            "parameters": [
              {
                "name": "",
                "value": "undefined"
              }
            ],
            "readinessGate": {
              "thresholdType": "ANY"
            }
          }
        ],
        "triggers": [
          {
            "apiTrigger": {
              "rateLimit": {
                "count": "integer",
                "interval": "string"
              }
            },
            "startStepNames": [
              ""
            ]
          }
        ]
      },
      "tags": [],
      "updatedAt": "2019-09-19T10:00:00.000Z",
      "webhookSecret": "string"
    },
    "id": "string",
    "relationships": {
      "creator": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "owner": {
        "data": {
          "id": "",
          "type": "users"
        }
      }
    },
    "type": "workflows"
  }
}

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": { "connectionEnvs": [ { "connections": [ { "connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG" } ], "env": "default" } ], "handle": "my-handle", "inputSchema": { "parameters": [ { "defaultValue": "default", "name": "input", "type": "STRING" } ] }, "outputSchema": { "parameters": [ { "name": "output", "type": "ARRAY_OBJECT", "value": "outputValue" } ] }, "steps": [ { "actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [ { "branchName": "main", "nextStepName": "Step2" } ], "parameters": [ { "name": "tags", "value": "service:monitoring" } ] }, { "actionId": "com.datadoghq.core.noop", "name": "Step2" } ], "triggers": [ { "monitorTrigger": { "rateLimit": { "count": 1, "interval": "3600s" } }, "startStepNames": [ "Step1" ] }, { "startStepNames": [ "Step1" ], "githubWebhookTrigger": {} } ] }, "tags": [ "team:infra", "service:monitoring", "foo:bar" ] }, "type": "workflows" } } EOF

PATCH https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}https://api.datadoghq.eu/api/v2/workflows/{workflow_id}https://api.ddog-gov.com/api/v2/workflows/{workflow_id}https://api.datadoghq.com/api/v2/workflows/{workflow_id}https://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}https://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}

Overview

Update a workflow by ID. This API requires an application key scoped with the workflows_write permission. This endpoint requires the workflows_write permission.

Arguments

Path Parameters

Name

Type

Description

workflow_id [required]

string

The ID of the workflow.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Data related to the workflow being updated.

attributes [required]

object

The definition of WorkflowDataUpdateAttributes object.

createdAt

date-time

When the workflow was created.

description

string

Description of the workflow.

name

string

Name of the workflow.

published

boolean

Set the workflow to published or unpublished. Workflows in an unpublished state will only be executable via manual runs. Automatic triggers such as Schedule will not execute the workflow until it is published.

spec

object

The spec defines what the workflow does.

annotations

[object]

A list of annotations used in the workflow. These are like sticky notes for your workflow!

display [required]

object

The definition of AnnotationDisplay object.

bounds

object

The definition of AnnotationDisplayBounds object.

height

double

The bounds height.

width

double

The bounds width.

x

double

The bounds x.

y

double

The bounds y.

id [required]

string

The Annotation id.

markdownTextAnnotation [required]

object

The definition of AnnotationMarkdownTextAnnotation object.

text

string

The markdownTextAnnotation text.

connectionEnvs

[object]

A list of connections or connection groups used in the workflow.

connectionGroups

[object]

The ConnectionEnv connectionGroups.

connectionGroupId [required]

string

The ConnectionGroup connectionGroupId.

label [required]

string

The ConnectionGroup label.

tags [required]

[string]

The ConnectionGroup tags.

connections

[object]

The ConnectionEnv connections.

connectionId [required]

string

The Connection connectionId.

label [required]

string

The Connection label.

env [required]

enum

The definition of ConnectionEnvEnv object. Allowed enum values: default

handle

string

Unique identifier used to trigger workflows automatically in Datadog.

inputSchema

object

A list of input parameters for the workflow. These can be used as dynamic runtime values in your workflow.

parameters

[object]

The InputSchema parameters.

defaultValue

The InputSchemaParameters defaultValue.

description

string

The InputSchemaParameters description.

label

string

The InputSchemaParameters label.

name [required]

string

The InputSchemaParameters name.

type [required]

enum

The definition of InputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

outputSchema

object

A list of output parameters for the workflow.

parameters

[object]

The OutputSchema parameters.

defaultValue

The OutputSchemaParameters defaultValue.

description

string

The OutputSchemaParameters description.

label

string

The OutputSchemaParameters label.

name [required]

string

The OutputSchemaParameters name.

type [required]

enum

The definition of OutputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

value

The OutputSchemaParameters value.

steps

[object]

A Step is a sub-component of a workflow. Each Step performs an action.

actionId [required]

string

The unique identifier of an action.

completionGate

object

Used to create conditions before running subsequent actions.

completionCondition [required]

object

The definition of CompletionCondition object.

operand1 [required]

The CompletionCondition operand1.

operand2

The CompletionCondition operand2.

operator [required]

enum

The definition of CompletionConditionOperator object. Allowed enum values: OPERATOR_EQUAL,OPERATOR_NOT_EQUAL,OPERATOR_GREATER_THAN,OPERATOR_LESS_THAN,OPERATOR_GREATER_THAN_OR_EQUAL_TO,OPERATOR_LESS_THAN_OR_EQUAL_TO,OPERATOR_CONTAINS,OPERATOR_DOES_NOT_CONTAIN,OPERATOR_IS_NULL,OPERATOR_IS_NOT_NULL,OPERATOR_IS_EMPTY,OPERATOR_IS_NOT_EMPTY

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

connectionLabel

string

The unique identifier of a connection defined in the spec.

display

object

The definition of StepDisplay object.

bounds

object

The definition of StepDisplayBounds object.

x

double

The bounds x.

y

double

The bounds y.

errorHandlers

[object]

The Step errorHandlers.

fallbackStepName [required]

string

The ErrorHandler fallbackStepName.

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

name [required]

string

Name of the step.

outboundEdges

[object]

A list of subsequent actions to run.

branchName [required]

string

The OutboundEdge branchName.

nextStepName [required]

string

The OutboundEdge nextStepName.

parameters

[object]

A list of inputs for an action.

name [required]

string

The Parameter name.

value [required]

The Parameter value.

readinessGate

object

Used to merge multiple branches into a single branch.

thresholdType [required]

enum

The definition of ReadinessGateThresholdType object. Allowed enum values: ANY,ALL

triggers

[ <oneOf>]

The list of triggers that activate this workflow. At least one trigger is required, and each trigger type may appear at most once.

Option 1

object

Schema for an API-based trigger.

apiTrigger [required]

object

Trigger a workflow VIA an API. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 2

object

Schema for an App-based trigger.

appTrigger [required]

object

Trigger a workflow VIA an App.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 3

object

Schema for a Case-based trigger.

caseTrigger [required]

object

Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 4

object

Schema for a Change Event-based trigger.

changeEventTrigger [required]

object

Trigger a workflow VIA a Change Event.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 5

object

Schema for a Dashboard-based trigger.

dashboardTrigger [required]

object

Trigger a workflow VIA a Dashboard.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 6

object

Schema for a GitHub webhook-based trigger.

githubWebhookTrigger [required]

object

Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a webhookSecret. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 7

object

Schema for an Incident-based trigger.

incidentTrigger [required]

object

Trigger a workflow VIA an Incident. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 8

object

Schema for a Monitor-based trigger.

monitorTrigger [required]

object

Trigger a workflow VIA a Monitor. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 9

object

Schema for a Schedule-based trigger.

scheduleTrigger [required]

object

Trigger a workflow VIA a Schedule. The workflow must be published.

rruleExpression [required]

string

Recurrence rule expression for scheduling.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 10

object

Schema for a Security-based trigger.

securityTrigger [required]

object

Trigger a workflow VIA a Security Signal or Finding. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 11

object

Schema for a Slack-based trigger.

slackTrigger [required]

object

Trigger a workflow VIA Slack. The workflow must be published.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 12

object

Schema for a Workflow-based trigger.

startStepNames

[string]

A list of steps that run first after a trigger fires.

workflowTrigger [required]

object

Trigger a workflow VIA the Datadog UI. Only required if no other trigger exists.

tags

[string]

Tags of the workflow.

updatedAt

date-time

When the workflow was last updated.

webhookSecret

string

If a Webhook trigger is defined on this workflow, a webhookSecret is required and should be provided here.

id

string

The workflow identifier

relationships

object

The definition of WorkflowDataRelationships object.

creator

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

owner

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

type [required]

enum

The definition of WorkflowDataType object. Allowed enum values: workflows

{
  "data": {
    "attributes": {
      "description": "A sample workflow.",
      "name": "Example Workflow",
      "published": true,
      "spec": {
        "connectionEnvs": [
          {
            "connections": [
              {
                "connectionId": "11111111-1111-1111-1111-111111111111",
                "label": "INTEGRATION_DATADOG"
              }
            ],
            "env": "default"
          }
        ],
        "handle": "my-handle",
        "inputSchema": {
          "parameters": [
            {
              "defaultValue": "default",
              "name": "input",
              "type": "STRING"
            }
          ]
        },
        "outputSchema": {
          "parameters": [
            {
              "name": "output",
              "type": "ARRAY_OBJECT",
              "value": "outputValue"
            }
          ]
        },
        "steps": [
          {
            "actionId": "com.datadoghq.dd.monitor.listMonitors",
            "connectionLabel": "INTEGRATION_DATADOG",
            "name": "Step1",
            "outboundEdges": [
              {
                "branchName": "main",
                "nextStepName": "Step2"
              }
            ],
            "parameters": [
              {
                "name": "tags",
                "value": "service:monitoring"
              }
            ]
          },
          {
            "actionId": "com.datadoghq.core.noop",
            "name": "Step2"
          }
        ],
        "triggers": [
          {
            "monitorTrigger": {
              "rateLimit": {
                "count": 1,
                "interval": "3600s"
              }
            },
            "startStepNames": [
              "Step1"
            ]
          },
          {
            "startStepNames": [
              "Step1"
            ],
            "githubWebhookTrigger": {}
          }
        ]
      },
      "tags": [
        "team:infra",
        "service:monitoring",
        "foo:bar"
      ]
    },
    "id": "22222222-2222-2222-2222-222222222222",
    "type": "workflows"
  }
}

Response

Successfully updated a workflow.

The response object after updating a workflow.

Expand All

Field

Type

Description

data

object

Data related to the workflow being updated.

attributes [required]

object

The definition of WorkflowDataUpdateAttributes object.

createdAt

date-time

When the workflow was created.

description

string

Description of the workflow.

name

string

Name of the workflow.

published

boolean

Set the workflow to published or unpublished. Workflows in an unpublished state will only be executable via manual runs. Automatic triggers such as Schedule will not execute the workflow until it is published.

spec

object

The spec defines what the workflow does.

annotations

[object]

A list of annotations used in the workflow. These are like sticky notes for your workflow!

display [required]

object

The definition of AnnotationDisplay object.

bounds

object

The definition of AnnotationDisplayBounds object.

height

double

The bounds height.

width

double

The bounds width.

x

double

The bounds x.

y

double

The bounds y.

id [required]

string

The Annotation id.

markdownTextAnnotation [required]

object

The definition of AnnotationMarkdownTextAnnotation object.

text

string

The markdownTextAnnotation text.

connectionEnvs

[object]

A list of connections or connection groups used in the workflow.

connectionGroups

[object]

The ConnectionEnv connectionGroups.

connectionGroupId [required]

string

The ConnectionGroup connectionGroupId.

label [required]

string

The ConnectionGroup label.

tags [required]

[string]

The ConnectionGroup tags.

connections

[object]

The ConnectionEnv connections.

connectionId [required]

string

The Connection connectionId.

label [required]

string

The Connection label.

env [required]

enum

The definition of ConnectionEnvEnv object. Allowed enum values: default

handle

string

Unique identifier used to trigger workflows automatically in Datadog.

inputSchema

object

A list of input parameters for the workflow. These can be used as dynamic runtime values in your workflow.

parameters

[object]

The InputSchema parameters.

defaultValue

The InputSchemaParameters defaultValue.

description

string

The InputSchemaParameters description.

label

string

The InputSchemaParameters label.

name [required]

string

The InputSchemaParameters name.

type [required]

enum

The definition of InputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

outputSchema

object

A list of output parameters for the workflow.

parameters

[object]

The OutputSchema parameters.

defaultValue

The OutputSchemaParameters defaultValue.

description

string

The OutputSchemaParameters description.

label

string

The OutputSchemaParameters label.

name [required]

string

The OutputSchemaParameters name.

type [required]

enum

The definition of OutputSchemaParametersType object. Allowed enum values: STRING,NUMBER,BOOLEAN,OBJECT,ARRAY_STRING,ARRAY_NUMBER,ARRAY_BOOLEAN,ARRAY_OBJECT

value

The OutputSchemaParameters value.

steps

[object]

A Step is a sub-component of a workflow. Each Step performs an action.

actionId [required]

string

The unique identifier of an action.

completionGate

object

Used to create conditions before running subsequent actions.

completionCondition [required]

object

The definition of CompletionCondition object.

operand1 [required]

The CompletionCondition operand1.

operand2

The CompletionCondition operand2.

operator [required]

enum

The definition of CompletionConditionOperator object. Allowed enum values: OPERATOR_EQUAL,OPERATOR_NOT_EQUAL,OPERATOR_GREATER_THAN,OPERATOR_LESS_THAN,OPERATOR_GREATER_THAN_OR_EQUAL_TO,OPERATOR_LESS_THAN_OR_EQUAL_TO,OPERATOR_CONTAINS,OPERATOR_DOES_NOT_CONTAIN,OPERATOR_IS_NULL,OPERATOR_IS_NOT_NULL,OPERATOR_IS_EMPTY,OPERATOR_IS_NOT_EMPTY

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

connectionLabel

string

The unique identifier of a connection defined in the spec.

display

object

The definition of StepDisplay object.

bounds

object

The definition of StepDisplayBounds object.

x

double

The bounds x.

y

double

The bounds y.

errorHandlers

[object]

The Step errorHandlers.

fallbackStepName [required]

string

The ErrorHandler fallbackStepName.

retryStrategy [required]

object

The definition of RetryStrategy object.

kind [required]

enum

The definition of RetryStrategyKind object. Allowed enum values: RETRY_STRATEGY_LINEAR

linear

object

The definition of RetryStrategyLinear object.

interval [required]

string

The RetryStrategyLinear interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

maxRetries [required]

double

The RetryStrategyLinear maxRetries.

name [required]

string

Name of the step.

outboundEdges

[object]

A list of subsequent actions to run.

branchName [required]

string

The OutboundEdge branchName.

nextStepName [required]

string

The OutboundEdge nextStepName.

parameters

[object]

A list of inputs for an action.

name [required]

string

The Parameter name.

value [required]

The Parameter value.

readinessGate

object

Used to merge multiple branches into a single branch.

thresholdType [required]

enum

The definition of ReadinessGateThresholdType object. Allowed enum values: ANY,ALL

triggers

[ <oneOf>]

The list of triggers that activate this workflow. At least one trigger is required, and each trigger type may appear at most once.

Option 1

object

Schema for an API-based trigger.

apiTrigger [required]

object

Trigger a workflow VIA an API. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 2

object

Schema for an App-based trigger.

appTrigger [required]

object

Trigger a workflow VIA an App.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 3

object

Schema for a Case-based trigger.

caseTrigger [required]

object

Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 4

object

Schema for a Change Event-based trigger.

changeEventTrigger [required]

object

Trigger a workflow VIA a Change Event.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 5

object

Schema for a Dashboard-based trigger.

dashboardTrigger [required]

object

Trigger a workflow VIA a Dashboard.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 6

object

Schema for a GitHub webhook-based trigger.

githubWebhookTrigger [required]

object

Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a webhookSecret. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 7

object

Schema for an Incident-based trigger.

incidentTrigger [required]

object

Trigger a workflow VIA an Incident. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 8

object

Schema for a Monitor-based trigger.

monitorTrigger [required]

object

Trigger a workflow VIA a Monitor. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 9

object

Schema for a Schedule-based trigger.

scheduleTrigger [required]

object

Trigger a workflow VIA a Schedule. The workflow must be published.

rruleExpression [required]

string

Recurrence rule expression for scheduling.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 10

object

Schema for a Security-based trigger.

securityTrigger [required]

object

Trigger a workflow VIA a Security Signal or Finding. For automatic triggering a handle must be configured and the workflow must be published.

rateLimit

object

Defines a rate limit for a trigger.

count

int64

The TriggerRateLimit count.

interval

string

The TriggerRateLimit interval. The expected format is the number of seconds ending with an s. For example, 1 day is 86400s

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 11

object

Schema for a Slack-based trigger.

slackTrigger [required]

object

Trigger a workflow VIA Slack. The workflow must be published.

startStepNames

[string]

A list of steps that run first after a trigger fires.

Option 12

object

Schema for a Workflow-based trigger.

startStepNames

[string]

A list of steps that run first after a trigger fires.

workflowTrigger [required]

object

Trigger a workflow VIA the Datadog UI. Only required if no other trigger exists.

tags

[string]

Tags of the workflow.

updatedAt

date-time

When the workflow was last updated.

webhookSecret

string

If a Webhook trigger is defined on this workflow, a webhookSecret is required and should be provided here.

id

string

The workflow identifier

relationships

object

The definition of WorkflowDataRelationships object.

creator

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

owner

object

The definition of WorkflowUserRelationship object.

data

object

The definition of WorkflowUserRelationshipData object.

id [required]

string

The user identifier

type [required]

enum

The definition of WorkflowUserRelationshipType object. Allowed enum values: users

type [required]

enum

The definition of WorkflowDataType object. Allowed enum values: workflows

{
  "data": {
    "attributes": {
      "createdAt": "2019-09-19T10:00:00.000Z",
      "description": "string",
      "name": "string",
      "published": false,
      "spec": {
        "annotations": [
          {
            "display": {
              "bounds": {
                "height": "number",
                "width": "number",
                "x": "number",
                "y": "number"
              }
            },
            "id": "",
            "markdownTextAnnotation": {
              "text": "string"
            }
          }
        ],
        "connectionEnvs": [
          {
            "connectionGroups": [
              {
                "connectionGroupId": "",
                "label": "",
                "tags": [
                  ""
                ]
              }
            ],
            "connections": [
              {
                "connectionId": "",
                "label": ""
              }
            ],
            "env": "default"
          }
        ],
        "handle": "string",
        "inputSchema": {
          "parameters": [
            {
              "defaultValue": "undefined",
              "description": "string",
              "label": "string",
              "name": "",
              "type": "STRING"
            }
          ]
        },
        "outputSchema": {
          "parameters": [
            {
              "defaultValue": "undefined",
              "description": "string",
              "label": "string",
              "name": "",
              "type": "STRING",
              "value": "undefined"
            }
          ]
        },
        "steps": [
          {
            "actionId": "",
            "completionGate": {
              "completionCondition": {
                "operand1": "undefined",
                "operand2": "undefined",
                "operator": "OPERATOR_EQUAL"
              },
              "retryStrategy": {
                "kind": "RETRY_STRATEGY_LINEAR",
                "linear": {
                  "interval": "",
                  "maxRetries": 0
                }
              }
            },
            "connectionLabel": "string",
            "display": {
              "bounds": {
                "x": "number",
                "y": "number"
              }
            },
            "errorHandlers": [
              {
                "fallbackStepName": "",
                "retryStrategy": {
                  "kind": "RETRY_STRATEGY_LINEAR",
                  "linear": {
                    "interval": "",
                    "maxRetries": 0
                  }
                }
              }
            ],
            "name": "",
            "outboundEdges": [
              {
                "branchName": "",
                "nextStepName": ""
              }
            ],
            "parameters": [
              {
                "name": "",
                "value": "undefined"
              }
            ],
            "readinessGate": {
              "thresholdType": "ANY"
            }
          }
        ],
        "triggers": [
          {
            "apiTrigger": {
              "rateLimit": {
                "count": "integer",
                "interval": "string"
              }
            },
            "startStepNames": [
              ""
            ]
          }
        ]
      },
      "tags": [],
      "updatedAt": "2019-09-19T10:00:00.000Z",
      "webhookSecret": "string"
    },
    "id": "string",
    "relationships": {
      "creator": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "owner": {
        "data": {
          "id": "",
          "type": "users"
        }
      }
    },
    "type": "workflows"
  }
}

Bad request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # Path parameters
export workflow_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": { "connectionEnvs": [ { "connections": [ { "connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG" } ], "env": "default" } ], "handle": "my-handle", "inputSchema": { "parameters": [ { "defaultValue": "default", "name": "input", "type": "STRING" } ] }, "outputSchema": { "parameters": [ { "name": "output", "type": "ARRAY_OBJECT", "value": "outputValue" } ] }, "steps": [ { "actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [ { "branchName": "main", "nextStepName": "Step2" } ], "parameters": [ { "name": "tags", "value": "service:monitoring" } ] }, { "actionId": "com.datadoghq.core.noop", "name": "Step2" } ], "triggers": [ { "monitorTrigger": { "rateLimit": { "count": 1, "interval": "3600s" } }, "startStepNames": [ "Step1" ] }, { "startStepNames": [ "Step1" ], "githubWebhookTrigger": {} } ] }, "tags": [ "team:infra", "service:monitoring", "foo:bar" ] }, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows" } } EOF

DELETE https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}https://api.datadoghq.eu/api/v2/workflows/{workflow_id}https://api.ddog-gov.com/api/v2/workflows/{workflow_id}https://api.datadoghq.com/api/v2/workflows/{workflow_id}https://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}https://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}

Overview

Delete a workflow by ID. This API requires an application key scoped with the workflows_write permission. This endpoint requires the workflows_write permission.

Arguments

Path Parameters

Name

Type

Description

workflow_id [required]

string

The ID of the workflow.

Response

Successfully deleted a workflow.

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

GET https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instanceshttps://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances

Overview

List all instances of a given workflow. This API requires an application key scoped with the workflows_read permission. This endpoint requires the workflows_read permission.

OAuth apps require the workflows_read authorization scope to access this endpoint.

Arguments

Path Parameters

Name

Type

Description

workflow_id [required]

string

The ID of the workflow.

Query Strings

Name

Type

Description

page[size]

integer

Size for a given page. The maximum allowed value is 100.

page[number]

integer

Specific page number to return.

Response

OK

Response returned when listing workflow instances.

Expand All

Field

Type

Description

<any-key>

{
  "data": [
    {
      "id": "string"
    }
  ],
  "meta": {
    "page": {
      "totalCount": "integer"
    }
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List workflow instances returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.workflow_automation_api import WorkflowAutomationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = WorkflowAutomationApi(api_client)
    response = api_instance.list_workflow_instances(
        workflow_id="ccf73164-1998-4785-a7a3-8d06c7e5f558",
    )

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# List workflow instances returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new
p api_instance.list_workflow_instances("ccf73164-1998-4785-a7a3-8d06c7e5f558")

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// List workflow instances returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewWorkflowAutomationApi(apiClient)
	resp, r, err := api.ListWorkflowInstances(ctx, "ccf73164-1998-4785-a7a3-8d06c7e5f558", *datadogV2.NewListWorkflowInstancesOptionalParameters())

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `WorkflowAutomationApi.ListWorkflowInstances`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `WorkflowAutomationApi.ListWorkflowInstances`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// List workflow instances returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.WorkflowAutomationApi;
import com.datadog.api.client.v2.model.WorkflowListInstancesResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient);

    try {
      WorkflowListInstancesResponse result =
          apiInstance.listWorkflowInstances("ccf73164-1998-4785-a7a3-8d06c7e5f558");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WorkflowAutomationApi#listWorkflowInstances");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// List workflow instances returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::ListWorkflowInstancesOptionalParams;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .list_workflow_instances(
            "ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(),
            ListWorkflowInstancesOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * List workflow instances returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WorkflowAutomationApi(configuration);

const params: v2.WorkflowAutomationApiListWorkflowInstancesRequest = {
  workflowId: "ccf73164-1998-4785-a7a3-8d06c7e5f558",
};

apiInstance
  .listWorkflowInstances(params)
  .then((data: v2.WorkflowListInstancesResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instanceshttps://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances

Overview

Execute the given workflow. This API requires an application key scoped with the workflows_run permission. This endpoint requires the workflows_run permission.

OAuth apps require the workflows_run authorization scope to access this endpoint.

Arguments

Path Parameters

Name

Type

Description

workflow_id [required]

string

The ID of the workflow.

Request

Body Data (required)

Expand All

Field

Type

Description

meta

object

Additional information for creating a workflow instance.

payload

object

The input parameters to the workflow.

{
  "meta": {
    "payload": {
      "input": "value"
    }
  }
}

Response

Created

Response returned upon successful workflow instance creation.

Expand All

Field

Type

Description

<any-key>

{
  "data": {
    "id": "string"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                          # Path parameters
export workflow_id="CHANGE_ME"
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "meta": { "payload": { "input": "value" } } } EOF
// Execute a workflow returns "Created" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.WorkflowInstanceCreateRequest{
		Meta: &datadogV2.WorkflowInstanceCreateMeta{
			Payload: map[string]interface{}{
				"input": "value",
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewWorkflowAutomationApi(apiClient)
	resp, r, err := api.CreateWorkflowInstance(ctx, "ccf73164-1998-4785-a7a3-8d06c7e5f558", body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `WorkflowAutomationApi.CreateWorkflowInstance`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `WorkflowAutomationApi.CreateWorkflowInstance`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Execute a workflow returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.WorkflowAutomationApi;
import com.datadog.api.client.v2.model.WorkflowInstanceCreateMeta;
import com.datadog.api.client.v2.model.WorkflowInstanceCreateRequest;
import com.datadog.api.client.v2.model.WorkflowInstanceCreateResponse;
import java.util.Map;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient);

    WorkflowInstanceCreateRequest body =
        new WorkflowInstanceCreateRequest()
            .meta(
                new WorkflowInstanceCreateMeta()
                    .payload(Map.ofEntries(Map.entry("input", "value"))));

    try {
      WorkflowInstanceCreateResponse result =
          apiInstance.createWorkflowInstance("ccf73164-1998-4785-a7a3-8d06c7e5f558", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WorkflowAutomationApi#createWorkflowInstance");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
"""
Execute a workflow returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.workflow_automation_api import WorkflowAutomationApi
from datadog_api_client.v2.model.workflow_instance_create_meta import WorkflowInstanceCreateMeta
from datadog_api_client.v2.model.workflow_instance_create_request import WorkflowInstanceCreateRequest

body = WorkflowInstanceCreateRequest(
    meta=WorkflowInstanceCreateMeta(
        payload=dict([("input", "value")]),
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = WorkflowAutomationApi(api_client)
    response = api_instance.create_workflow_instance(workflow_id="ccf73164-1998-4785-a7a3-8d06c7e5f558", body=body)

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Execute a workflow returns "Created" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new

body = DatadogAPIClient::V2::WorkflowInstanceCreateRequest.new({
  meta: DatadogAPIClient::V2::WorkflowInstanceCreateMeta.new({
    payload: {
      "input": "value",
    },
  }),
})
p api_instance.create_workflow_instance("ccf73164-1998-4785-a7a3-8d06c7e5f558", body)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Execute a workflow returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;
use datadog_api_client::datadogV2::model::WorkflowInstanceCreateMeta;
use datadog_api_client::datadogV2::model::WorkflowInstanceCreateRequest;
use serde_json::Value;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    let body =
        WorkflowInstanceCreateRequest::new().meta(WorkflowInstanceCreateMeta::new().payload(
            BTreeMap::from([("input".to_string(), Value::from("value"))]),
        ));
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .create_workflow_instance("ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Execute a workflow returns "Created" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WorkflowAutomationApi(configuration);

const params: v2.WorkflowAutomationApiCreateWorkflowInstanceRequest = {
  body: {
    meta: {
      payload: {
        input: "value",
      },
    },
  },
  workflowId: "ccf73164-1998-4785-a7a3-8d06c7e5f558",
};

apiInstance
  .createWorkflowInstance(params)
  .then((data: v2.WorkflowInstanceCreateResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

GET https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}

Overview

Get a specific execution of a given workflow. This API requires an application key scoped with the workflows_read permission. This endpoint requires the workflows_read permission.

OAuth apps require the workflows_read authorization scope to access this endpoint.

Arguments

Path Parameters

Name

Type

Description

workflow_id [required]

string

The ID of the workflow.

instance_id [required]

string

The ID of the workflow instance.

Response

OK

The state of the given workflow instance.

Expand All

Field

Type

Description

<any-key>

{
  "data": {
    "attributes": {
      "id": "string"
    }
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
export instance_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances/${instance_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get a workflow instance returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.workflow_automation_api import WorkflowAutomationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = WorkflowAutomationApi(api_client)
    response = api_instance.get_workflow_instance(
        workflow_id="ccf73164-1998-4785-a7a3-8d06c7e5f558",
        instance_id="305a472b-71ab-4ce8-8f8d-75db635627b5",
    )

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Get a workflow instance returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new
p api_instance.get_workflow_instance("ccf73164-1998-4785-a7a3-8d06c7e5f558", "305a472b-71ab-4ce8-8f8d-75db635627b5")

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Get a workflow instance returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewWorkflowAutomationApi(apiClient)
	resp, r, err := api.GetWorkflowInstance(ctx, "ccf73164-1998-4785-a7a3-8d06c7e5f558", "305a472b-71ab-4ce8-8f8d-75db635627b5")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `WorkflowAutomationApi.GetWorkflowInstance`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `WorkflowAutomationApi.GetWorkflowInstance`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Get a workflow instance returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.WorkflowAutomationApi;
import com.datadog.api.client.v2.model.WorklflowGetInstanceResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient);

    try {
      WorklflowGetInstanceResponse result =
          apiInstance.getWorkflowInstance(
              "ccf73164-1998-4785-a7a3-8d06c7e5f558", "305a472b-71ab-4ce8-8f8d-75db635627b5");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WorkflowAutomationApi#getWorkflowInstance");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Get a workflow instance returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .get_workflow_instance(
            "ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(),
            "305a472b-71ab-4ce8-8f8d-75db635627b5".to_string(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Get a workflow instance returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WorkflowAutomationApi(configuration);

const params: v2.WorkflowAutomationApiGetWorkflowInstanceRequest = {
  workflowId: "ccf73164-1998-4785-a7a3-8d06c7e5f558",
  instanceId: "305a472b-71ab-4ce8-8f8d-75db635627b5",
};

apiInstance
  .getWorkflowInstance(params)
  .then((data: v2.WorklflowGetInstanceResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"

PUT https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancel

Overview

Cancels a specific execution of a given workflow. This API requires an application key scoped with the workflows_run permission. This endpoint requires the workflows_run permission.

Arguments

Path Parameters

Name

Type

Description

workflow_id [required]

string

The ID of the workflow.

instance_id [required]

string

The ID of the workflow instance.

Response

OK

Information about the canceled instance.

Expand All

Field

Type

Description

data

object

Data about the canceled instance.

id

string

The id of the canceled instance

{
  "data": {
    "id": "string"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
export instance_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances/${instance_id}/cancel" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Cancel a workflow instance returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.workflow_automation_api import WorkflowAutomationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = WorkflowAutomationApi(api_client)
    response = api_instance.cancel_workflow_instance(
        workflow_id="ccf73164-1998-4785-a7a3-8d06c7e5f558",
        instance_id="305a472b-71ab-4ce8-8f8d-75db635627b5",
    )

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Cancel a workflow instance returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new
p api_instance.cancel_workflow_instance("ccf73164-1998-4785-a7a3-8d06c7e5f558", "305a472b-71ab-4ce8-8f8d-75db635627b5")

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Cancel a workflow instance returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewWorkflowAutomationApi(apiClient)
	resp, r, err := api.CancelWorkflowInstance(ctx, "ccf73164-1998-4785-a7a3-8d06c7e5f558", "305a472b-71ab-4ce8-8f8d-75db635627b5")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `WorkflowAutomationApi.CancelWorkflowInstance`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `WorkflowAutomationApi.CancelWorkflowInstance`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Cancel a workflow instance returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.WorkflowAutomationApi;
import com.datadog.api.client.v2.model.WorklflowCancelInstanceResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient);

    try {
      WorklflowCancelInstanceResponse result =
          apiInstance.cancelWorkflowInstance(
              "ccf73164-1998-4785-a7a3-8d06c7e5f558", "305a472b-71ab-4ce8-8f8d-75db635627b5");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WorkflowAutomationApi#cancelWorkflowInstance");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
// Cancel a workflow instance returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .cancel_workflow_instance(
            "ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(),
            "305a472b-71ab-4ce8-8f8d-75db635627b5".to_string(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
 * Cancel a workflow instance returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.WorkflowAutomationApi(configuration);

const params: v2.WorkflowAutomationApiCancelWorkflowInstanceRequest = {
  workflowId: "ccf73164-1998-4785-a7a3-8d06c7e5f558",
  instanceId: "305a472b-71ab-4ce8-8f8d-75db635627b5",
};

apiInstance
  .cancelWorkflowInstance(params)
  .then((data: v2.WorklflowCancelInstanceResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"