For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

  • Run a workflow: Your API key must have the Run workflows permission.

  • View or list workflow runs: Your API key must have the View workflow runs permission.

Operations

List workflows

get

List workflows.

API key must have the View workflows permission.

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

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

pageinteger · int32Required

Current page number, 0-indexed

totalinteger · int32Required

Total number of results

totalPagesinteger · int32Required

Total number of pages

get/api/v1/workflows
GET /api/v1/workflows?pageSize=250&page=0 HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
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",
            "integration": "AzureDevops",
            "integrationAlias": "text",
            "payload": "text",
            "url": "text"
          },
          "slug": "text"
        }
      ],
      "createdAt": "text",
      "createdBy": {
        "email": "cristina@cortex.io",
        "name": "Cristina Buenahora"
      },
      "description": "text",
      "failedRunResponseTemplate": "text",
      "filter": {
        "type": "GLOBAL"
      },
      "iconTag": "text",
      "isDraft": true,
      "isRunnableViaApi": true,
      "lastUpdatedAt": "text",
      "lastUpdatedBy": {
        "email": "cristina@cortex.io",
        "name": "Cristina Buenahora"
      },
      "name": "text",
      "restrictActionCompletionToRunnerUser": true,
      "runResponseTemplate": "text",
      "runRestrictionPolicies": [
        {
          "id": "text",
          "type": "USER"
        }
      ],
      "tag": "text",
      "variables": [
        {
          "defaultValue": {},
          "description": "text",
          "slug": "text",
          "type": "STRING"
        }
      ]
    }
  ]
}

Retrieve workflow

get

Retrieve workflow by tag or ID.

API key must have the View workflows permission.

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
tagOrIdstringRequired

Entity identifier - can be a tag or CID

Responses
200

Successfully found workflow

createdAtstringOptional

The date the workflow was created, in ISO 8601 format

createdByone ofOptional
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

isRunnableViaApibooleanOptional

Whether the workflow is runnable via the public API

lastUpdatedAtstringOptional

The date the workflow was last updated, in ISO 8601 format

lastUpdatedByone ofOptional
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

get/api/v1/workflows/{tagOrId}
GET /api/v1/workflows/{tagOrId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "actions": [
    {
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "integration": "AzureDevops",
        "integrationAlias": "text",
        "payload": "text",
        "url": "text"
      },
      "slug": "text"
    }
  ],
  "createdAt": "text",
  "createdBy": {
    "email": "cristina@cortex.io",
    "name": "Cristina Buenahora"
  },
  "description": "text",
  "failedRunResponseTemplate": "text",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "isRunnableViaApi": true,
  "lastUpdatedAt": "text",
  "lastUpdatedBy": {
    "email": "cristina@cortex.io",
    "name": "Cristina Buenahora"
  },
  "name": "text",
  "restrictActionCompletionToRunnerUser": true,
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text",
  "variables": [
    {
      "defaultValue": {},
      "description": "text",
      "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
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Body
createdAtstringOptional

The date the workflow was created, in ISO 8601 format

createdByone ofOptional
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

isRunnableViaApibooleanOptional

Whether the workflow is runnable via the public API

lastUpdatedAtstringOptional

The date the workflow was last updated, in ISO 8601 format

lastUpdatedByone ofOptional
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

createdAtstringOptional

The date the workflow was created, in ISO 8601 format

createdByone ofOptional
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

isRunnableViaApibooleanOptional

Whether the workflow is runnable via the public API

lastUpdatedAtstringOptional

The date the workflow was last updated, in ISO 8601 format

lastUpdatedByone ofOptional
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

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

{
  "actions": [
    {
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "integration": "AzureDevops",
        "integrationAlias": "text",
        "payload": "text",
        "url": "text"
      },
      "slug": "text"
    }
  ],
  "createdAt": "text",
  "createdBy": {
    "email": "cristina@cortex.io",
    "name": "Cristina Buenahora"
  },
  "description": "text",
  "failedRunResponseTemplate": "text",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "isRunnableViaApi": true,
  "lastUpdatedAt": "text",
  "lastUpdatedBy": {
    "email": "cristina@cortex.io",
    "name": "Cristina Buenahora"
  },
  "name": "text",
  "restrictActionCompletionToRunnerUser": true,
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text",
  "variables": [
    {
      "defaultValue": {},
      "description": "text",
      "slug": "text",
      "type": "STRING"
    }
  ]
}
{
  "actions": [
    {
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "integration": "AzureDevops",
        "integrationAlias": "text",
        "payload": "text",
        "url": "text"
      },
      "slug": "text"
    }
  ],
  "createdAt": "text",
  "createdBy": {
    "email": "cristina@cortex.io",
    "name": "Cristina Buenahora"
  },
  "description": "text",
  "failedRunResponseTemplate": "text",
  "filter": {
    "type": "GLOBAL"
  },
  "iconTag": "text",
  "isDraft": true,
  "isRunnableViaApi": true,
  "lastUpdatedAt": "text",
  "lastUpdatedBy": {
    "email": "cristina@cortex.io",
    "name": "Cristina Buenahora"
  },
  "name": "text",
  "restrictActionCompletionToRunnerUser": true,
  "runResponseTemplate": "text",
  "runRestrictionPolicies": [
    {
      "id": "text",
      "type": "USER"
    }
  ],
  "tag": "text",
  "variables": [
    {
      "defaultValue": {},
      "description": "text",
      "slug": "text",
      "type": "STRING"
    }
  ]
}

Validates YAML descriptor

post

Validates YAML descriptor.

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Body
stringOptional
Responses
200

Validation result

application/json
okbooleanRequired
post/api/v1/workflows/validate
POST /api/v1/workflows/validate HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 6

"text"
{
  "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
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
tagOrIdstringRequired

Entity identifier - can be a tag or CID

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/api/v1/workflows/{tagOrId}/callback/{callbackId}
POST /api/v1/workflows/{tagOrId}/callback/{callbackId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
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
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
tagOrIdstringRequired

Entity identifier - can be a tag or CID

Responses
200

Workflow deleted successfully

No content

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

No content

Run a workflow

post

Start a new run for a workflow.

API key must have the Run workflows permission and the workflow must be runnable via API

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
tagOrIdstringRequired

Entity identifier - can be a tag or CID

Body
initialContextobject · JsonNodeOptional
notificationRecipientsstring[]Optional

List of email addresses to notify of workflow updates.

runAsstringOptional

User's email to run the workflow as

scopeone ofRequired
or
Responses
200

Workflow run started successfully

application/json
completedAtstringOptional

Time the workflow run completed

idstringRequired

Id of the run

initiatedByone ofOptional
or
runResponsestringOptional
startedAtstringOptional

Time the workflow run started

statusstringRequired

Status of the workflow run

post/api/v1/workflows/{tagOrId}/runs
POST /api/v1/workflows/{tagOrId}/runs HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 168

{
  "initialContext": {},
  "notificationRecipients": [
    "text"
  ],
  "runAs": "text",
  "scope": {
    "itemType": "text",
    "archived": true,
    "cid": "text",
    "name": "text",
    "tag": "text",
    "type": "text"
  }
}
{
  "actions": [
    {
      "completedAt": "text",
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "integration": "AzureDevops",
        "integrationAlias": "text",
        "payload": "text",
        "url": "text"
      },
      "slug": "text",
      "startedAt": "text",
      "state": {
        "inputs": {
          "ANY_ADDITIONAL_PROPERTY": {}
        },
        "metadata": {
          "ANY_ADDITIONAL_PROPERTY": {}
        },
        "outputs": {
          "ANY_ADDITIONAL_PROPERTY": {}
        },
        "status": "NOT_INITIATED",
        "variables": {
          "ANY_ADDITIONAL_PROPERTY": {}
        }
      }
    }
  ],
  "completedAt": "text",
  "context": {
    "ANY_ADDITIONAL_PROPERTY": {}
  },
  "id": "text",
  "initiatedBy": {
    "type": "text",
    "apiKey": {
      "id": "text",
      "last4": "text",
      "name": "text",
      "type": "text"
    }
  },
  "runResponse": "text",
  "startedAt": "text",
  "status": "text",
  "variables": {
    "ANY_ADDITIONAL_PROPERTY": {
      "type": "text",
      "value": {}
    }
  },
  "workflow": {
    "cid": "text",
    "name": "text"
  }
}

Get workflow run details

get

Retrieve details of a specific workflow run.

API key must have the View workflow runs permission.

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path parameters
tagOrIdstringRequired

Entity identifier - can be a tag or CID

runIdstringRequired
Responses
200

Successfully found workflow run

application/json
completedAtstringOptional

Time the workflow run completed

idstringRequired

Id of the run

initiatedByone ofOptional
or
runResponsestringOptional
startedAtstringOptional

Time the workflow run started

statusstringRequired

Status of the workflow run

get/api/v1/workflows/{tagOrId}/runs/{runId}
GET /api/v1/workflows/{tagOrId}/runs/{runId} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "actions": [
    {
      "completedAt": "text",
      "isRootAction": true,
      "name": "text",
      "outgoingActions": [
        "text"
      ],
      "schema": {
        "type": "text",
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "httpMethod": "GET",
        "integration": "AzureDevops",
        "integrationAlias": "text",
        "payload": "text",
        "url": "text"
      },
      "slug": "text",
      "startedAt": "text",
      "state": {
        "inputs": {
          "ANY_ADDITIONAL_PROPERTY": {}
        },
        "metadata": {
          "ANY_ADDITIONAL_PROPERTY": {}
        },
        "outputs": {
          "ANY_ADDITIONAL_PROPERTY": {}
        },
        "status": "NOT_INITIATED",
        "variables": {
          "ANY_ADDITIONAL_PROPERTY": {}
        }
      }
    }
  ],
  "completedAt": "text",
  "context": {
    "ANY_ADDITIONAL_PROPERTY": {}
  },
  "id": "text",
  "initiatedBy": {
    "type": "text",
    "apiKey": {
      "id": "text",
      "last4": "text",
      "name": "text",
      "type": "text"
    }
  },
  "runResponse": "text",
  "startedAt": "text",
  "status": "text",
  "variables": {
    "ANY_ADDITIONAL_PROPERTY": {
      "type": "text",
      "value": {}
    }
  },
  "workflow": {
    "cid": "text",
    "name": "text"
  }
}

List workflow runs

get

List workflow runs based on filters.

API key must have the View workflow runs permission.

Authorizations
AuthorizationstringRequired

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Query parameters
Responses
200

Successfully found workflow runs

application/json
hasMorebooleanRequired
pageinteger · int32Required
totalinteger · int64Required
totalCappedbooleanRequired
totalPagesinteger · int32Required
get/api/v1/workflows/runs
GET /api/v1/workflows/runs?workflowRunQuery=[object+Object]&pageable=[object+Object] HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "hasMore": true,
  "items": [
    {
      "completedAt": "text",
      "context": {
        "ANY_ADDITIONAL_PROPERTY": {}
      },
      "id": "text",
      "initiatedBy": {
        "type": "text",
        "apiKey": {
          "id": "text",
          "last4": "text",
          "name": "text",
          "type": "text"
        }
      },
      "runResponse": "text",
      "startedAt": "text",
      "status": "text",
      "variables": {
        "ANY_ADDITIONAL_PROPERTY": {
          "type": "text",
          "value": {}
        }
      },
      "workflow": {
        "cid": "text",
        "name": "text"
      }
    }
  ],
  "page": 1,
  "total": 1,
  "totalCapped": true,
  "totalPages": 1
}

Last updated

Was this helpful?