For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/api/latest/workflow-automation/get-an-existing-workflow.md. A documentation index is available at /llms.txt.

Get an existing Workflow

GET https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}https://api.ap2.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.us2.ddog-gov.com/api/v2/workflows/{workflow_id}https://api.uk1.datadoghq.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 a registered application key. Alternatively, you can configure these permissions in the UI. 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.

runAsUserMode

enum

The effective type of identity used to run the workflow. Allowed enum values: owner,service_account,initiator

sensitivePrivileges

boolean

Whether the workflow requires sensitive privileges to run. Only the workflow owner can update this field. This allows it to run actions that use Execution Policies.

spec [required]

object

A complete Workflow Automation definition, including its triggers, steps, and connections.

annotations

[object]

Up to 100 text annotations displayed on the workflow canvas.

display [required]

object

The annotation's position and size on the workflow canvas.

bounds

object

Canvas coordinates and dimensions for an annotation on the workflow canvas.

height

double

The annotation's height on the canvas.

width

double

The annotation's width on the canvas.

x

double

The annotation's horizontal canvas coordinate.

y

double

The annotation's vertical canvas coordinate.

id [required]

string

The unique identifier of this annotation within the workflow.

markdownTextAnnotation [required]

object

Markdown content displayed in an annotation.

text

string

The annotation's Markdown content.

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. Input parameters are available under the Trigger object and can be referenced in workflow steps using {{ Trigger.<parameter_name> }}.

parameters

[object]

The InputSchema parameters.

allowExtraValues

boolean

The InputSchemaParameters allowExtraValues.

allowedValues

The InputSchemaParameters allowedValues.

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

Show 2 more,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 [required]

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]

int32

The RetryStrategyLinear maxRetries.

connectionLabel

string

The unique identifier of a connection defined in the spec.

display

object

The position of a step on the workflow canvas. Omit display from every step to use automatic layout, or provide it for every step to preserve a manual layout.

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 [required]

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]

int32

The RetryStrategyLinear maxRetries.

name [required]

string

Name of the step.

outboundEdges

[object]

A list of subsequent actions to run. This list is empty for a terminal step.

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.

Object 1

object

Schema for an agent-based trigger.

agentTrigger [required]

object

Trigger a workflow from an agent via the MCP execute tool. Workflow can be executed from Bits Chat, Bits Agent Builder, Claude Code, Codex, Cursor, and any other coding agent using the Datadog MCP.

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]

Names of existing workflow steps that run first after a trigger fires.

Object 2

object

Schema for an API-based trigger.

apiTrigger [required]

object

Trigger a workflow from an API request. 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]

Names of existing workflow steps that run first after a trigger fires.

Object 3

object

Schema for an App-based trigger.

appTrigger [required]

object

Trigger a workflow from an App.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 4

object

Schema for a Case-based trigger.

caseTrigger [required]

object

Trigger a workflow from 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]

Names of existing workflow steps that run first after a trigger fires.

Object 5

object

Schema for a Change Event-based trigger.

changeEventTrigger [required]

object

Trigger a workflow from a Change Event.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 6

object

Schema for a Database Monitoring-based trigger.

databaseMonitoringTrigger [required]

object

Trigger a workflow from Database Monitoring.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 7

object

Schema for a Datastore-based trigger.

datastoreTrigger [required]

object

Trigger a workflow from a Datastore. 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]

Names of existing workflow steps that run first after a trigger fires.

Object 8

object

Schema for a Dashboard-based trigger.

dashboardTrigger [required]

object

Trigger a workflow from a Dashboard.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 9

object

Schema for a Form-based trigger.

formTrigger [required]

object

Trigger a workflow from a Form.

formId

string

The form UUID.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 10

object

Schema for a GitHub webhook-based trigger.

githubWebhookTrigger [required]

object

Trigger a workflow from a 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]

Names of existing workflow steps that run first after a trigger fires.

Object 11

object

Schema for an incident declared trigger.

incidentCreatedTrigger [required]

object

Trigger a workflow when an incident is declared.

incidentType

string

The type of incident that triggers the workflow.

tagCondition

object

Conditions that determine which incidents trigger the workflow.

tagValues

[object]

Incident tags and values used to filter matching incidents.

tag [required]

string

The incident tag to match.

values [required]

[string]

The accepted values for the incident tag.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 12

object

Schema for an incident impact created trigger.

incidentImpactCreatedTrigger [required]

object

Trigger a workflow when an impact is created for an incident.

executionLimit

object

The maximum number of times to execute a workflow for an incident.

count [required]

int32

The maximum number of workflow executions.

incidentType

string

The type of incident that triggers the workflow.

tagCondition

object

Conditions that determine which incidents trigger the workflow.

tagValues

[object]

Incident tags and values used to filter matching incidents.

tag [required]

string

The incident tag to match.

values [required]

[string]

The accepted values for the incident tag.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 13

object

Schema for an incident impact updated trigger.

incidentImpactUpdatedTrigger [required]

object

Trigger a workflow when an impact is updated for an incident.

executionLimit

object

The maximum number of times to execute a workflow for an incident.

count [required]

int32

The maximum number of workflow executions.

incidentType

string

The type of incident that triggers the workflow.

tagCondition

object

Conditions that determine which incidents trigger the workflow.

tagValues

[object]

Incident tags and values used to filter matching incidents.

tag [required]

string

The incident tag to match.

values [required]

[string]

The accepted values for the incident tag.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 14

object

Schema for an incident postmortem updated trigger.

incidentPostmortemUpdatedTrigger [required]

object

Trigger a workflow when a postmortem is updated for an incident.

executionLimit

object

The maximum number of times to execute a workflow for an incident.

count [required]

int32

The maximum number of workflow executions.

incidentType

string

The type of incident that triggers the workflow.

tagCondition

object

Conditions that determine which incidents trigger the workflow.

tagValues

[object]

Incident tags and values used to filter matching incidents.

tag [required]

string

The incident tag to match.

values [required]

[string]

The accepted values for the incident tag.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 15

object

Schema for an incident responder created trigger.

incidentResponderCreatedTrigger [required]

object

Trigger a workflow when a responder is created for an incident.

executionLimit

object

The maximum number of times to execute a workflow for an incident.

count [required]

int32

The maximum number of workflow executions.

incidentType

string

The type of incident that triggers the workflow.

tagCondition

object

Conditions that determine which incidents trigger the workflow.

tagValues

[object]

Incident tags and values used to filter matching incidents.

tag [required]

string

The incident tag to match.

values [required]

[string]

The accepted values for the incident tag.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 16

object

Schema for an incident declared or updated trigger.

incidentSavedTrigger [required]

object

Trigger a workflow when an incident is declared or updated.

executionLimit

object

The maximum number of times to execute a workflow for an incident.

count [required]

int32

The maximum number of workflow executions.

incidentType

string

The type of incident that triggers the workflow.

serialExecution

object

Whether to execute the workflow serially for an incident.

enabled [required]

boolean

Whether serial execution is enabled.

tagCondition

object

Conditions that determine which incidents trigger the workflow.

tagValues

[object]

Incident tags and values used to filter matching incidents.

tag [required]

string

The incident tag to match.

values [required]

[string]

The accepted values for the incident tag.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 17

object

Schema for an incident schedule trigger.

incidentScheduleTrigger [required]

object

Trigger a workflow on a schedule for an incident.

incidentType

string

The type of incident that triggers the workflow.

rrule [required]

string

The recurrence rule for the schedule, expressed as an iCalendar RRULE string.

tagCondition

object

Conditions that determine which incidents trigger the workflow.

tagValues

[object]

Incident tags and values used to filter matching incidents.

tag [required]

string

The incident tag to match.

values [required]

[string]

The accepted values for the incident tag.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 18

object

Schema for an incident-based trigger.

incidentTrigger [required]

object

Trigger a workflow from 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

version

string

Version of the incident manual trigger.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 19

object

Schema for a Monitor-based trigger.

monitorTrigger [required]

object

Trigger a workflow from 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]

Names of existing workflow steps that run first after a trigger fires.

Object 20

object

Schema for a Notebook-based trigger.

notebookTrigger [required]

object

Trigger a workflow from a Notebook.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 21

object

Schema for an On-Call-based trigger.

onCallTrigger [required]

object

Trigger a workflow from an On-Call Page or On-Call Handover. 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]

Names of existing workflow steps that run first after a trigger fires.

Object 22

object

Schema for a Schedule-based trigger.

scheduleTrigger [required]

object

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

overlapBehavior

enum

Controls whether a scheduled workflow run may start while another instance is still running. Allowed enum values: EXCLUSIVE_RUN,OVERLAP_ALLOWED

default: EXCLUSIVE_RUN

rruleExpression [required]

string

Recurrence rule expression for scheduling.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 23

object

Schema for a Security-based trigger.

securityTrigger [required]

object

Trigger a workflow from 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]

Names of existing workflow steps that run first after a trigger fires.

Object 24

object

Schema for a Self Service-based trigger.

selfServiceTrigger [required]

object

Trigger a workflow from Self Service.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 25

object

Schema for a Slack-based trigger.

slackTrigger [required]

object

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

reactionTriggers

[object]

Slack emoji reactions that trigger the workflow.

reactionEmoji [required]

string

The Slack emoji reaction name.

teamId [required]

string

The Slack workspace ID.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 26

object

Schema for a Software Catalog-based trigger.

softwareCatalogTrigger [required]

object

Trigger a workflow from Software Catalog.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

Object 27

object

Schema for a Workflow-based trigger.

startStepNames

[string]

Names of existing workflow steps that run first after a trigger fires.

workflowTrigger [required]

object

Trigger a workflow from the Datadog UI. When present, this must be the workflow's only trigger.

tags

[string]

Tags of the workflow.

updatedAt

date-time

When the workflow was last updated.

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

runAs

object

The service account used to run the workflow. Present when runAsUserMode is service_account.

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,
      "runAsUserMode": "owner",
      "sensitivePrivileges": 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": [
            {
              "allowExtraValues": false,
              "allowedValues": "undefined",
              "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": "main",
                "nextStepName": "Step2"
              }
            ],
            "parameters": [
              {
                "name": "",
                "value": "undefined"
              }
            ],
            "readinessGate": {
              "thresholdType": "ANY"
            }
          }
        ],
        "triggers": [
          {
            "agentTrigger": {
              "rateLimit": {
                "count": "integer",
                "interval": "string"
              }
            },
            "startStepNames": [
              ""
            ]
          }
        ]
      },
      "tags": [],
      "updatedAt": "2019-09-19T10:00:00.000Z"
    },
    "id": "string",
    "relationships": {
      "creator": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "owner": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "runAs": {
        "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"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.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 "Authorization: Bearer ${DD_BEARER_TOKEN}"
"""
Get an existing Workflow returns "Successfully got a workflow." response
"""

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

# there is a valid "workflow" in the system
WORKFLOW_DATA_ID = environ["WORKFLOW_DATA_ID"]

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = WorkflowAutomationApi(api_client)
    response = api_instance.get_workflow(
        workflow_id=WORKFLOW_DATA_ID,
    )

    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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
# Get an existing Workflow returns "Successfully got a workflow." response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new

# there is a valid "workflow" in the system
WORKFLOW_DATA_ID = ENV["WORKFLOW_DATA_ID"]
p api_instance.get_workflow(WORKFLOW_DATA_ID)

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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
// Get an existing Workflow returns "Successfully got a workflow." 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() {
	// there is a valid "workflow" in the system
	WorkflowDataID := os.Getenv("WORKFLOW_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewWorkflowAutomationApi(apiClient)
	resp, r, err := api.GetWorkflow(ctx, WorkflowDataID)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `WorkflowAutomationApi.GetWorkflow`:\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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
// Get an existing Workflow returns "Successfully got a workflow." 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.GetWorkflowResponse;

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

    // there is a valid "workflow" in the system
    String WORKFLOW_DATA_ID = System.getenv("WORKFLOW_DATA_ID");

    try {
      GetWorkflowResponse result = apiInstance.getWorkflow(WORKFLOW_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling WorkflowAutomationApi#getWorkflow");
      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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
// Get an existing Workflow returns "Successfully got a workflow." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;

#[tokio::main]
async fn main() {
    // there is a valid "workflow" in the system
    let workflow_data_id = std::env::var("WORKFLOW_DATA_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api.get_workflow(workflow_data_id.clone()).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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
 * Get an existing Workflow returns "Successfully got a workflow." response
 */

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

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
const apiInstance = new v2.WorkflowAutomationApi(configuration);

// there is a valid "workflow" in the system
const WORKFLOW_DATA_ID = process.env.WORKFLOW_DATA_ID as string;

const params: v2.WorkflowAutomationApiGetWorkflowRequest = {
  workflowId: WORKFLOW_DATA_ID,
};

apiInstance
  .getWorkflow(params)
  .then((data: v2.GetWorkflowResponse) => {
    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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"