Workflows

Use these operations to interact with Workflows in Cortex.

Required permissions

  • View Workflows: Your API key must have the View Workflows permission.

  • Create or update Workflows: Your API key must have the Edit Workflows permission.

  • Callback a paused async HTTP block: Your API key must have Edit Workflow Runs permission.

Operations

List workflows

get

List workflows.

API key must have the View workflows permission.

Authorizations
Query parameters
includeActionsbooleanOptional

When true, returns the list of actions for each workflow. Defaults to false.

Default: false
searchQuerystringOptional

When set, only returns workflows with the given substring in the name or description.

pageSizeinteger · int32Required

Number of results to return per page, between 1 and 1000. Default 250.

Default: 250
pageinteger · int32Required

Page number to return, 0-indexed. Default 0.

Default: 0
Responses
200

Successfully found workflows

get
GET /api/v1/workflows HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
  "page": 1,
  "total": 1,
  "totalPages": 1,
  "workflows": [
    {
      "actions": [
        {
          "isRootAction": true,
          "name": "text",
          "outgoingActions": [
            "text"
          ],
          "schema": {
            "type": "text",
            "headers": {
              "ANY_ADDITIONAL_PROPERTY": "text"
            },
            "httpMethod": "GET",
            "payload": "text",
            "url": "text"
          },
          "slug": "text"
        }
      ],
      "description": "text",
      "failedRunResponseTemplate": "text",
      "filter": {
        "type": "GLOBAL"
      },
      "iconTag": "text",
      "isDraft": true,
      "name": "text",
      "restrictActionCompletionToRunnerUser": true,
      "runResponseTemplate": "text",
      "runRestrictionPolicies": [
        {
          "id": "text",
          "type": "USER"
        }
      ],
      "tag": "text",
      "variables": [
        {
          "defaultValue": {},
          "slug": "text",
          "type": "STRING"
        }
      ]
    }
  ]
}

Retrieve workflow

get

Retrieve workflow by tag or ID.

API key must have the View workflows permission.

Authorizations
Path parameters
tagOrIdstringRequired

The tag or unique, auto-generated identifier for the workflow.

Responses
200

Successfully found workflow

get
GET /api/v1/workflows/{tagOrId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
  "actions": [
    {
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "payload": "text",
        "url": "text"
      },
      "slug": "text"
    }
  ],
  "description": "text",
  "failedRunResponseTemplate": "text",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "name": "text",
  "restrictActionCompletionToRunnerUser": true,
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text",
  "variables": [
    {
      "defaultValue": {},
      "slug": "text",
      "type": "STRING"
    }
  ]
}

Create or update workflow

post

Create or update new workflow.

API key must have the Edit workflows permission.

Note: If a workflow with the same tag already exists, it will be updated.

Authorizations
Body
descriptionstringOptional

Description of the workflow

failedRunResponseTemplatestringOptional

Template for the response when the workflow run fails

iconTagstringOptional

Icon tag for the workflow

isDraftbooleanRequired

Whether the workflow is a draft

namestringRequired

Name of the workflow

restrictActionCompletionToRunnerUserbooleanRequired

If true, only the user who started the workflow can complete actions. Defaults to false.

runResponseTemplatestringOptional

Template for the response when the workflow is completed successfully

tagstringRequired

Tag of the workflow

Responses
200

Workflow created successfully

post
POST /api/v1/workflows HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 543

{
  "actions": [
    {
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "payload": "text",
        "url": "text"
      },
      "slug": "text"
    }
  ],
  "description": "text",
  "failedRunResponseTemplate": "text",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "name": "text",
  "restrictActionCompletionToRunnerUser": true,
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text",
  "variables": [
    {
      "defaultValue": {},
      "slug": "text",
      "type": "STRING"
    }
  ]
}
{
  "actions": [
    {
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "payload": "text",
        "url": "text"
      },
      "slug": "text"
    }
  ],
  "description": "text",
  "failedRunResponseTemplate": "text",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "name": "text",
  "restrictActionCompletionToRunnerUser": true,
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text",
  "variables": [
    {
      "defaultValue": {},
      "slug": "text",
      "type": "STRING"
    }
  ]
}

Validates YAML descriptor

post

Validates YAML descriptor.

Authorizations
Body
anyOptional
Responses
200

Validation result

application/json
post
POST /api/v1/workflows/validate HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
{
  "ok": true,
  "violations": [
    {
      "description": "text",
      "endLine": 1,
      "paths": [
        "text"
      ],
      "pointer": "text",
      "ruleLink": "text",
      "startLine": 1,
      "title": "text",
      "violationType": "MUST"
    }
  ]
}

Update asynchronous HTTP request Workflow block

post

Updates an asynchronous HTTP request Workflow block.

API key must have the Edit workflow runs permission.

Authorizations
Path parameters
tagOrIdstringRequired

The tag or unique, auto-generated identifier for the workflow.

callbackIdstringRequired

Callback ID; Provided by the Workflow block when it runs

Body
messagestringRequired

Human readable message to be shown to the user

statusstring · enumRequired

Status of the callback request. UPDATE keeps the workflow paused

Possible values:
Responses
200

Successfully received Workflow callback

No content

post
POST /api/v1/workflows/{tagOrId}/callback/{callbackId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 79

{
  "message": "text",
  "response": {
    "ANY_ADDITIONAL_PROPERTY": {}
  },
  "status": "SUCCESS"
}

No content

Delete workflow

delete

Delete workflow by tag or ID.

API key must have the Edit workflows permission.

Authorizations
Path parameters
tagOrIdstringRequired

The tag or unique, auto-generated identifier for the workflow.

Responses
200

Workflow deleted successfully

No content

delete
DELETE /api/v1/workflows/{tagOrId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*

No content

Last updated

Was this helpful?