Skip to content
Start here

Get logs and status from instance

workflows.instances.get(strinstance_id, InstanceGetParams**kwargs) -> InstanceGetResponse
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
ParametersExpand Collapse
account_id: str
workflow_name: str
maxLength64
minLength1
instance_id: str
maxLength100
minLength1
order: Optional[Literal["asc", "desc"]]

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

One of the following:
"asc"
"desc"
simple: Optional[Literal["true", "false"]]

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

One of the following:
"true"
"false"
ReturnsExpand Collapse
class InstanceGetResponse:
end: Optional[datetime]
formatdate-time
error: Optional[Error]
message: str
name: str
output: Union[str, float]
One of the following:
str
float
params: object
queued: datetime
formatdate-time
start: Optional[datetime]
formatdate-time
status: Literal["queued", "running", "paused", 5 more]
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
step_count: int
steps: List[Step]
One of the following:
class StepUnionMember0:
attempts: List[StepUnionMember0Attempt]
end: Optional[datetime]
formatdate-time
error: Optional[StepUnionMember0AttemptError]
message: str
name: str
start: datetime
formatdate-time
success: Optional[bool]
config: StepUnionMember0Config
retries: StepUnionMember0ConfigRetries
delay: Union[str, float]

Specifies the delay duration.

One of the following:
str
float
limit: float
backoff: Optional[Literal["constant", "linear", "exponential"]]
One of the following:
"constant"
"linear"
"exponential"
timeout: Union[str, float]

Specifies the timeout duration.

One of the following:
str
float
end: Optional[datetime]
formatdate-time
name: str
output: Optional[str]
start: datetime
formatdate-time
success: Optional[bool]
type: Literal["step"]
class StepUnionMember1:
end: datetime
formatdate-time
error: Optional[StepUnionMember1Error]
message: str
name: str
finished: bool
name: str
start: datetime
formatdate-time
type: Literal["sleep"]
class StepUnionMember2:
trigger: StepUnionMember2Trigger
source: str
type: Literal["termination"]
class StepUnionMember3:
end: datetime
formatdate-time
error: Optional[StepUnionMember3Error]
message: str
name: str
finished: bool
name: str
start: datetime
formatdate-time
type: Literal["waitForEvent"]
output: Optional[str]
success: Optional[bool]
trigger: Trigger
source: Literal["unknown", "api", "binding", 2 more]
One of the following:
"unknown"
"api"
"binding"
"event"
"cron"
version_id: str
formatuuid

Get logs and status from instance

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
instance = client.workflows.instances.get(
    instance_id="x",
    account_id="account_id",
    workflow_name="x",
)
print(instance.end)
{
  "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
  }
}