Skip to content
Start here

Get logs and status from instance

GET/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}

Retrieves logs and execution status for a specific workflow instance.

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
Path ParametersExpand Collapse
account_id: string
workflow_name: string
maxLength64
minLength1
instance_id: string
maxLength100
minLength1
Query ParametersExpand Collapse
order: optional "asc" or "desc"

Step ordering: "asc" (default, oldest first) or "desc" (newest first).

One of the following:
"asc"
"desc"
simple: optional "true" or "false"

When true, omits step details and returns only metadata with step_count.

One of the following:
"true"
"false"
ReturnsExpand Collapse
errors: array of object { code, message }
code: number
message: string
messages: array of object { code, message }
code: number
message: string
result: object { end, error, output, 9 more }
end: string
formatdate-time
error: object { message, name }
message: string
name: string
output: string or number
One of the following:
string
number
params: unknown
queued: string
formatdate-time
start: string
formatdate-time
status: "queued" or "running" or "paused" or 5 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
step_count: number
steps: array of object { attempts, config, end, 5 more } or object { end, error, finished, 3 more } or object { trigger, type } or object { end, error, finished, 4 more }
One of the following:
object { attempts, config, end, 5 more }
attempts: array of object { end, error, start, success }
end: string
formatdate-time
error: object { message, name }
message: string
name: string
start: string
formatdate-time
success: boolean
config: object { retries, timeout }
retries: object { delay, limit, backoff }
delay: string or number

Specifies the delay duration.

One of the following:
string
number
limit: number
backoff: optional "constant" or "linear" or "exponential"
One of the following:
"constant"
"linear"
"exponential"
timeout: string or number

Specifies the timeout duration.

One of the following:
string
number
end: string
formatdate-time
name: string
output: string
start: string
formatdate-time
success: boolean
type: "step"
object { end, error, finished, 3 more }
end: string
formatdate-time
error: object { message, name }
message: string
name: string
finished: boolean
name: string
start: string
formatdate-time
type: "sleep"
object { trigger, type }
trigger: object { source }
source: string
type: "termination"
object { end, error, finished, 4 more }
end: string
formatdate-time
error: object { message, name }
message: string
name: string
finished: boolean
name: string
start: string
formatdate-time
type: "waitForEvent"
output: optional string
success: boolean
trigger: object { source }
source: "unknown" or "api" or "binding" or 2 more
One of the following:
"unknown"
"api"
"binding"
"event"
"cron"
versionId: string
formatuuid
success: true
result_info: optional object { count, per_page, total_count, 2 more }
count: number
per_page: number
total_count: number
cursor: optional string
page: optional number

Get logs and status from instance

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workflows/$WORKFLOW_NAME/instances/$INSTANCE_ID \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "result": {
    "end": "2019-12-27T18:11:19.117Z",
    "error": {
      "message": "message",
      "name": "name"
    },
    "output": "string",
    "params": {},
    "queued": "2019-12-27T18:11:19.117Z",
    "start": "2019-12-27T18:11:19.117Z",
    "status": "queued",
    "step_count": 0,
    "steps": [
      {
        "attempts": [
          {
            "end": "2019-12-27T18:11:19.117Z",
            "error": {
              "message": "message",
              "name": "name"
            },
            "start": "2019-12-27T18:11:19.117Z",
            "success": true
          }
        ],
        "config": {
          "retries": {
            "delay": "string",
            "limit": 0,
            "backoff": "constant"
          },
          "timeout": "string"
        },
        "end": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "output": "output",
        "start": "2019-12-27T18:11:19.117Z",
        "success": true,
        "type": "step"
      }
    ],
    "success": true,
    "trigger": {
      "source": "unknown"
    },
    "versionId": "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": {
    "end": "2019-12-27T18:11:19.117Z",
    "error": {
      "message": "message",
      "name": "name"
    },
    "output": "string",
    "params": {},
    "queued": "2019-12-27T18:11:19.117Z",
    "start": "2019-12-27T18:11:19.117Z",
    "status": "queued",
    "step_count": 0,
    "steps": [
      {
        "attempts": [
          {
            "end": "2019-12-27T18:11:19.117Z",
            "error": {
              "message": "message",
              "name": "name"
            },
            "start": "2019-12-27T18:11:19.117Z",
            "success": true
          }
        ],
        "config": {
          "retries": {
            "delay": "string",
            "limit": 0,
            "backoff": "constant"
          },
          "timeout": "string"
        },
        "end": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "output": "output",
        "start": "2019-12-27T18:11:19.117Z",
        "success": true,
        "type": "step"
      }
    ],
    "success": true,
    "trigger": {
      "source": "unknown"
    },
    "versionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  },
  "success": true,
  "result_info": {
    "count": 0,
    "per_page": 0,
    "total_count": 0,
    "cursor": "cursor",
    "page": 0
  }
}