Skip to content
Start here

List of workflow instances

workflows.instances.list(strworkflow_name, InstanceListParams**kwargs) -> SyncV4PagePaginationArray[InstanceListResponse]
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
account_id: str
workflow_name: str
maxLength64
minLength1
cursor: Optional[str]

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

date_end: Optional[Union[str, datetime]]

Accepts ISO 8601 with no timezone offsets and in UTC.

formatdate-time
date_start: Optional[Union[str, datetime]]

Accepts ISO 8601 with no timezone offsets and in UTC.

formatdate-time
direction: Optional[Literal["asc", "desc"]]

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

One of the following:
"asc"
"desc"
page: Optional[float]

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

minimum1
per_page: Optional[float]
maximum100
minimum1
status: Optional[Literal["queued", "running", "paused", 5 more]]
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
ReturnsExpand Collapse
class InstanceListResponse:
id: str
maxLength100
minLength1
created_on: datetime
formatdate-time
ended_on: Optional[datetime]
formatdate-time
modified_on: datetime
formatdate-time
started_on: Optional[datetime]
formatdate-time
status: Literal["queued", "running", "paused", 5 more]
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
version_id: str
formatuuid
workflow_id: str
formatuuid

List of workflow instances

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
page = client.workflows.instances.list(
    workflow_name="x",
    account_id="account_id",
)
page = page.result[0]
print(page.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
  }
}