v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Workflow Automation

Create a Workflow

Create a new workflow, returning the workflow ID. This API requires a registered application key. Alternatively, you can configure these permissions in the UI.

post/api/v2/workflows

Request body

Example request

{
  "data": {
    "attributes": {
      "description": "A sample workflow.",
      "name": "Example Workflow",
      "published": true,
      "spec": {
        "annotations": [
          {
            "display": {
              "bounds": {
                "height": 150,
                "width": 300,
                "x": -375,
                "y": -0.5
              }
            },
            "id": "99999999-9999-9999-9999-999999999999",
            "markdownTextAnnotation": {
              "text": "Example annotation."
            }
          }
        ],
        "connectionEnvs": [
          {
            "connections": [
              {
                "connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad",
                "label": "INTEGRATION_DATADOG"
              }
            ],
            "env": "default"
          }
        ],
        "handle": "my-handle",
        "inputSchema": {
          "parameters": [
            {
              "defaultValue": "default",
              "name": "input",
              "type": "STRING"
            }
          ]
        },
        "outputSchema": {
          "parameters": [
            {
              "name": "output",
              "type": "ARRAY_OBJECT",
              "value": "{{ Steps.Step1 }}"
            }
          ]
        },
        "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"
            ]
          },
          {
            "githubWebhookTrigger": {},
            "startStepNames": [
              "Step1"
            ]
          }
        ]
      },
      "tags": [
        "team:infra",
        "service:monitoring",
        "foo:bar"
      ]
    },
    "type": "workflows"
  }
}

Response

Successfully created a workflow.