instances
Creates, updates, deletes, gets or lists an instances resource.
Overview
| Name | instances |
| Type | Resource |
| Id | cloudflare.workflows.instances |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get all logs and status from the instance.
| Name | Datatype | Description |
|---|---|---|
end | string (date-time) | |
error | object | |
output | string | |
params | object | |
queued | string (date-time) | |
start | string (date-time) | |
status | string | (queued, running, paused, errored, terminated, complete, waitingForPause, waiting) |
step_count | integer | |
steps | array | |
success | boolean | |
trigger | object | |
versionId | string (uuid) |
List of workflow instances.
| Name | Datatype | Description |
|---|---|---|
id | string | |
version_id | string (uuid) | |
workflow_id | string (uuid) | |
created_on | string (date-time) | |
ended_on | string (date-time) | |
modified_on | string (date-time) | |
started_on | string (date-time) | |
status | string | (queued, running, paused, errored, terminated, complete, waitingForPause, waiting) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | workflow_name, instance_id, account_id | simple, order | Retrieves logs and execution status for a specific workflow instance. |
list | select | workflow_name, account_id | page, per_page, cursor, direction, status, date_start, date_end | Lists all instances of a workflow with their execution status. |
batch | exec | workflow_name, account_id | Creates multiple workflow instances in a single batch operation. | |
update_status | exec | workflow_name, instance_id, account_id, status | Changes the execution status of a workflow instance (e.g., pause, resume, terminate). |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
instance_id | string | The Workflow instance ID. |
workflow_name | string | The Workflow name. |
cursor | string | Opaque token for cursor-based pagination. Mutually exclusive with page. |
date_end | string (date-time) | Accepts ISO 8601 with no timezone offsets and in UTC. |
date_start | string (date-time) | Accepts ISO 8601 with no timezone offsets and in UTC. |
direction | string | Defines the direction for cursor-based pagination. |
order | string | Step ordering: "asc" (default, oldest first) or "desc" (newest first). |
page | number | |
per_page | number | |
simple | string | When true, omits step details and returns only metadata with step_count. |
status | string |
SELECT examples
- get
- list
Retrieves logs and execution status for a specific workflow instance.
SELECT
end,
error,
output,
params,
queued,
start,
status,
step_count,
steps,
success,
trigger,
versionId
FROM cloudflare.workflows.instances
WHERE workflow_name = '{{ workflow_name }}' -- required
AND instance_id = '{{ instance_id }}' -- required
AND account_id = '{{ account_id }}' -- required
AND simple = '{{ simple }}'
AND order = '{{ order }}'
;
Lists all instances of a workflow with their execution status.
SELECT
id,
version_id,
workflow_id,
created_on,
ended_on,
modified_on,
started_on,
status
FROM cloudflare.workflows.instances
WHERE workflow_name = '{{ workflow_name }}' -- required
AND account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND cursor = '{{ cursor }}'
AND direction = '{{ direction }}'
AND status = '{{ status }}'
AND date_start = '{{ date_start }}'
AND date_end = '{{ date_end }}'
;
Lifecycle Methods
- batch
- update_status
Creates multiple workflow instances in a single batch operation.
EXEC cloudflare.workflows.instances.batch
@workflow_name='{{ workflow_name }}' --required,
@account_id='{{ account_id }}' --required
;
Changes the execution status of a workflow instance (e.g., pause, resume, terminate).
EXEC cloudflare.workflows.instances.update_status
@workflow_name='{{ workflow_name }}' --required,
@instance_id='{{ instance_id }}' --required,
@account_id='{{ account_id }}' --required
@@json=
'{
"from": "{{ from }}",
"status": "{{ status }}"
}'
;