Skip to content
Start here

List of workflow instances

client.workflows.instances.list(stringworkflowName, InstanceListParams { account_id, cursor, date_end, 5 more } params, RequestOptionsoptions?): V4PagePaginationArray<InstanceListResponse { id, created_on, ended_on, 5 more } >
GET/accounts/{account_id}/workflows/{workflow_name}/instances

Lists all instances of a workflow with their execution status.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Workers Tail ReadWorkers Scripts WriteWorkers Scripts Read
ParametersExpand Collapse
workflowName: string
maxLength64
minLength1
params: InstanceListParams { account_id, cursor, date_end, 5 more }
account_id: string

Path param

cursor?: string

Query param: page and cursor are mutually exclusive, use one or the other.

date_end?: string

Query param: Accepts ISO 8601 with no timezone offsets and in UTC.

formatdate-time
date_start?: string

Query param: Accepts ISO 8601 with no timezone offsets and in UTC.

formatdate-time
direction?: "asc" | "desc"

Query param: should only be used when cursor is used, defines a new direction for the cursor

One of the following:
"asc"
"desc"
page?: number

Query param: page and cursor are mutually exclusive, use one or the other.

minimum1
per_page?: number

Query param

maximum100
minimum1
status?: "queued" | "running" | "paused" | 5 more

Query param

One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
ReturnsExpand Collapse
InstanceListResponse { id, created_on, ended_on, 5 more }
id: string
maxLength100
minLength1
created_on: string
formatdate-time
ended_on: string | null
formatdate-time
modified_on: string
formatdate-time
started_on: string | null
formatdate-time
status: "queued" | "running" | "paused" | 5 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
version_id: string
formatuuid
workflow_id: string
formatuuid

List of workflow instances

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const instanceListResponse of client.workflows.instances.list('x', {
  account_id: 'account_id',
})) {
  console.log(instanceListResponse.id);
}
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "x",
      "created_on": "2019-12-27T18:11:19.117Z",
      "ended_on": "2019-12-27T18:11:19.117Z",
      "modified_on": "2019-12-27T18:11:19.117Z",
      "started_on": "2019-12-27T18:11:19.117Z",
      "status": "queued",
      "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    }
  ],
  "success": true,
  "result_info": {
    "count": 0,
    "per_page": 0,
    "total_count": 0,
    "cursor": "cursor",
    "page": 0
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": [
    {
      "id": "x",
      "created_on": "2019-12-27T18:11:19.117Z",
      "ended_on": "2019-12-27T18:11:19.117Z",
      "modified_on": "2019-12-27T18:11:19.117Z",
      "started_on": "2019-12-27T18:11:19.117Z",
      "status": "queued",
      "version_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "workflow_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    }
  ],
  "success": true,
  "result_info": {
    "count": 0,
    "per_page": 0,
    "total_count": 0,
    "cursor": "cursor",
    "page": 0
  }
}