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",
      "filter": {
        "type": "GLOBAL"
      },
      "iconTag": "text",
      "isDraft": true,
      "name": "text",
      "runResponseTemplate": "text",
      "runRestrictionPolicies": [
        {
          "id": "text",
          "type": "USER"
        }
      ],
      "tag": "text"
    }
  ]
}

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",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "name": "text",
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text"
}

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

iconTagstringOptional

Icon tag for the workflow

isDraftbooleanRequired

Whether the workflow is a draft

namestringRequired

Name of the workflow

runResponseTemplatestringOptional

Template for the response when the workflow is run

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: 400

{
  "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",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "name": "text",
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text"
}
{
  "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",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "name": "text",
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text"
}

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
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
delete
DELETE /api/v1/workflows/{tagOrId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*

No content

Last updated

Was this helpful?