Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idcloudflare.workflows.instances

Fields

The following fields are returned by SELECT queries:

Get all logs and status from the instance.

NameDatatypeDescription
endstring (date-time)
errorobject
outputstring
paramsobject
queuedstring (date-time)
startstring (date-time)
statusstring (queued, running, paused, errored, terminated, complete, waitingForPause, waiting)
step_countinteger
stepsarray
successboolean
triggerobject
versionIdstring (uuid)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectworkflow_name, instance_id, account_idsimple, orderRetrieves logs and execution status for a specific workflow instance.
listselectworkflow_name, account_idpage, per_page, cursor, direction, status, date_start, date_endLists all instances of a workflow with their execution status.
batchexecworkflow_name, account_idCreates multiple workflow instances in a single batch operation.
update_statusexecworkflow_name, instance_id, account_id, statusChanges 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
instance_idstringThe Workflow instance ID.
workflow_namestringThe Workflow name.
cursorstringOpaque token for cursor-based pagination. Mutually exclusive with page.
date_endstring (date-time)Accepts ISO 8601 with no timezone offsets and in UTC.
date_startstring (date-time)Accepts ISO 8601 with no timezone offsets and in UTC.
directionstringDefines the direction for cursor-based pagination.
orderstringStep ordering: "asc" (default, oldest first) or "desc" (newest first).
pagenumber
per_pagenumber
simplestringWhen true, omits step details and returns only metadata with step_count.
statusstring

SELECT examples

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 }}'
;

Lifecycle Methods

Creates multiple workflow instances in a single batch operation.

EXEC cloudflare.workflows.instances.batch
@workflow_name='{{ workflow_name }}' --required,
@account_id='{{ account_id }}' --required
;