Skip to content
Start here

Workflows

List all Workflows
client.workflows.list(WorkflowListParams { account_id, page, per_page, search } params, RequestOptionsoptions?): V4PagePaginationArray<WorkflowListResponse { id, class_name, created_on, 6 more } >
GET/accounts/{account_id}/workflows
Get Workflow details
client.workflows.get(stringworkflowName, WorkflowGetParams { account_id } params, RequestOptionsoptions?): WorkflowGetResponse { id, class_name, created_on, 6 more }
GET/accounts/{account_id}/workflows/{workflow_name}
Create/modify Workflow
client.workflows.update(stringworkflowName, WorkflowUpdateParams { account_id, class_name, script_name, 2 more } params, RequestOptionsoptions?): WorkflowUpdateResponse { id, class_name, created_on, 7 more }
PUT/accounts/{account_id}/workflows/{workflow_name}
Deletes a Workflow
client.workflows.delete(stringworkflowName, WorkflowDeleteParams { account_id } params, RequestOptionsoptions?): WorkflowDeleteResponse { status, success }
DELETE/accounts/{account_id}/workflows/{workflow_name}
ModelsExpand Collapse
WorkflowListResponse { id, class_name, created_on, 6 more }
id: string
formatuuid
class_name: string
created_on: string
formatdate-time
instances: Instances { complete, errored, paused, 6 more }
complete?: number
errored?: number
paused?: number
queued?: number
rollingBack?: number
running?: number
terminated?: number
waiting?: number
waitingForPause?: number
modified_on: string
formatdate-time
name: string
maxLength64
minLength1
script_name: string
triggered_on: string | null
formatdate-time
schedules?: Array<Schedule>
cron: string
next_instance: string
WorkflowGetResponse { id, class_name, created_on, 6 more }
id: string
formatuuid
class_name: string
created_on: string
formatdate-time
instances: Instances { complete, errored, paused, 6 more }
complete?: number
errored?: number
paused?: number
queued?: number
rollingBack?: number
running?: number
terminated?: number
waiting?: number
waitingForPause?: number
modified_on: string
formatdate-time
name: string
maxLength64
minLength1
script_name: string
triggered_on: string | null
formatdate-time
schedules?: Array<Schedule>
cron: string
next_instance: string
WorkflowUpdateResponse { id, class_name, created_on, 7 more }
id: string
formatuuid
class_name: string
created_on: string
formatdate-time
is_deleted: number
modified_on: string
formatdate-time
name: string
maxLength64
minLength1
script_name: string
terminator_running: number
triggered_on: string | null
formatdate-time
version_id: string
formatuuid
WorkflowDeleteResponse { status, success }
status: "ok"
success: boolean | null

WorkflowsInstances

List of workflow instances
client.workflows.instances.list(stringworkflowName, InstanceListParams { account_id, cursor, date_end, 5 more } params, RequestOptionsoptions?): V4PagePaginationArray<InstanceListResponse { id, created_on, ended_on, 6 more } >
GET/accounts/{account_id}/workflows/{workflow_name}/instances
Get logs and status from instance
client.workflows.instances.get(stringworkflowName, stringinstanceId, InstanceGetParams { account_id, order, simple } params, RequestOptionsoptions?): InstanceGetResponse { end, error, output, 11 more }
GET/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}
Create a new workflow instance
client.workflows.instances.create(stringworkflowName, InstanceCreateParams { account_id, instance_id, instance_retention, params } params, RequestOptionsoptions?): InstanceCreateResponse { id, status, version_id, 2 more }
POST/accounts/{account_id}/workflows/{workflow_name}/instances
Batch create new Workflow instances
client.workflows.instances.bulk(stringworkflowName, InstanceBulkParams { account_id, body } params, RequestOptionsoptions?): SinglePage<InstanceBulkResponse { id, status, version_id, 2 more } >
POST/accounts/{account_id}/workflows/{workflow_name}/instances/batch
Get full step output from instance
client.workflows.instances.step(stringworkflowName, stringinstanceId, InstanceStepParams { account_id, name, type, attempt } params, RequestOptionsoptions?): InstanceStepResponse { error, status, output }
GET/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/step
ModelsExpand Collapse
InstanceListResponse { id, created_on, ended_on, 6 more }
id: string
maxLength100
minLength1
created_on: string
formatdate-time
ended_on: string | null
formatdate-time
modified_on: string
formatdate-time
started_on: string | null
formatdate-time
status: "queued" | "running" | "paused" | 6 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
"rollingBack"
version_id: string
formatuuid
workflow_id: string
formatuuid
trigger_source?: "unknown" | "api" | "binding" | 2 more
One of the following:
"unknown"
"api"
"binding"
"event"
"cron"
InstanceGetResponse { end, error, output, 11 more }
end: string | null
formatdate-time
error: Error | null
message: string
name: string
output: string | number
One of the following:
string
number
params: unknown
queued: string
formatdate-time
rollback: Rollback | null
error: Error | null
message: string
name: string
outcome: "complete" | "failed"
One of the following:
"complete"
"failed"
start: string | null
formatdate-time
status: "queued" | "running" | "paused" | 6 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
"rollingBack"
step_count: number
steps: Array<UnionMember0 { attempts, config, end, 5 more } | UnionMember1 { end, error, finished, 3 more } | UnionMember2 { trigger, type } | UnionMember3 { end, error, finished, 4 more } >
One of the following:
UnionMember0 { attempts, config, end, 5 more }
attempts: Array<Attempt>
end: string | null
formatdate-time
error: Error | null
message: string
name: string
start: string
formatdate-time
success: boolean | null
config: Config { retries, timeout, sensitive }
retries: Retries { delay, limit, backoff }
delay: string | number

Specifies the delay duration.

One of the following:
string
number
limit: number
backoff?: "constant" | "linear" | "exponential"
One of the following:
"constant"
"linear"
"exponential"
timeout: string | number

Specifies the timeout duration.

One of the following:
string
number
sensitive?: "output"

When set to ‘output’, step output is redacted from log and step output responses.

end: string | null
formatdate-time
name: string
output: string | null
start: string
formatdate-time
success: boolean | null
type: "step" | "rollback"
One of the following:
"step"
"rollback"
UnionMember1 { end, error, finished, 3 more }
end: string
formatdate-time
error: Error | null
message: string
name: string
finished: boolean
name: string
start: string
formatdate-time
type: "sleep"
UnionMember2 { trigger, type }
trigger: Trigger { source }
source: string
type: "termination"
UnionMember3 { end, error, finished, 4 more }
end: string
formatdate-time
error: Error | null
message: string
name: string
finished: boolean
name: string
start: string
formatdate-time
type: "waitForEvent"
output?: string
success: boolean | null
trigger: Trigger { source }
source: "unknown" | "api" | "binding" | 2 more
One of the following:
"unknown"
"api"
"binding"
"event"
"cron"
versionId: string
formatuuid
schedule?: Schedule { cron, scheduledTime }
cron: string
scheduledTime: number
InstanceCreateResponse { id, status, version_id, 2 more }
id: string
maxLength100
minLength1
status: "queued" | "running" | "paused" | 6 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
"rollingBack"
version_id: string
formatuuid
workflow_id: string
formatuuid
trigger_source?: "unknown" | "api" | "binding" | 2 more
One of the following:
"unknown"
"api"
"binding"
"event"
"cron"
InstanceBulkResponse { id, status, version_id, 2 more }
id: string
maxLength100
minLength1
status: "queued" | "running" | "paused" | 6 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
"rollingBack"
version_id: string
formatuuid
workflow_id: string
formatuuid
trigger_source?: "unknown" | "api" | "binding" | 2 more
One of the following:
"unknown"
"api"
"binding"
"event"
"cron"
InstanceStepResponse { error, status, output }
error: Error | null

Error details when status=‘errored’; null otherwise.

message: string
name: string
status: "queued" | "running" | "paused" | 6 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
"rollingBack"
output?: unknown

Full step output or waitForEvent payload without truncation. Sensitive outputs are returned as ‘[REDACTED]’. Populated when status=‘complete’. May be a ReadableStream when the step returned one from step.do; stream outputs are served as application/octet-stream rather than JSON.

WorkflowsInstancesStatus

Change status of instance
client.workflows.instances.status.edit(stringworkflowName, stringinstanceId, StatusEditParamsparams, RequestOptionsoptions?): StatusEditResponse { status, timestamp }
PATCH/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/status
ModelsExpand Collapse
StatusEditResponse { status, timestamp }
status: "queued" | "running" | "paused" | 6 more
One of the following:
"queued"
"running"
"paused"
"errored"
"terminated"
"complete"
"waitingForPause"
"waiting"
"rollingBack"
timestamp: string

Accepts ISO 8601 with no timezone offsets and in UTC.

formatdate-time

WorkflowsInstancesEvents

Send event to instance
client.workflows.instances.events.create(stringworkflowName, stringinstanceId, stringeventType, EventCreateParams { account_id, body } params, RequestOptionsoptions?): EventCreateResponse
POST/accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/events/{event_type}
ModelsExpand Collapse
EventCreateResponse = unknown

WorkflowsVersions

List deployed Workflow versions
client.workflows.versions.list(stringworkflowName, VersionListParams { account_id, page, per_page } params, RequestOptionsoptions?): V4PagePaginationArray<VersionListResponse { id, class_name, created_on, 5 more } >
GET/accounts/{account_id}/workflows/{workflow_name}/versions
Get Workflow version details
client.workflows.versions.get(stringworkflowName, stringversionId, VersionGetParams { account_id } params, RequestOptionsoptions?): VersionGetResponse { id, class_name, created_on, 5 more }
GET/accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}
Get Workflow version graph
client.workflows.versions.graph(stringworkflowName, stringversionId, VersionGraphParams { account_id } params, RequestOptionsoptions?): VersionGraphResponse { id, class_name, created_on, 3 more }
GET/accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}/graph
ModelsExpand Collapse
VersionListResponse { id, class_name, created_on, 5 more }
id: string
formatuuid
class_name: string
created_on: string
formatdate-time
has_dag: boolean
language: "javascript" | "python"

The programming language of the workflow implementation

One of the following:
"javascript"
"python"
modified_on: string
formatdate-time
workflow_id: string
formatuuid
limits?: Limits { steps }
steps?: number
minimum1
VersionGetResponse { id, class_name, created_on, 5 more }
id: string
formatuuid
class_name: string
created_on: string
formatdate-time
has_dag: boolean
language: "javascript" | "python"

The programming language of the workflow implementation

One of the following:
"javascript"
"python"
modified_on: string
formatdate-time
workflow_id: string
formatuuid
limits?: Limits { steps }
steps?: number
minimum1
VersionGraphResponse { id, class_name, created_on, 3 more }
id: string
formatuuid
class_name: string
created_on: string
formatdate-time
graph: Graph | null

Versioned workflow graph payload.

version: number
workflow: Workflow { class_name, functions, nodes, payload }

A parsed workflow entrypoint with its step graph.

class_name: string
functions: Record<string, Functions>
name: string
nodes: Array<unknown>

Child nodes (recursive).

type: "function_def"
nodes: Array<UnionMember0 { duration, name, type, 2 more } | UnionMember1 { config, name, nodes, 3 more } | UnionMember2 { name, options, type, 3 more } | 11 more>
One of the following:
UnionMember0 { duration, name, type, 2 more }
duration: number | string

Duration as milliseconds (number) or human-readable string.

One of the following:
number
string
name: string
type: "step_sleep"
resolves?: number
starts?: number
UnionMember1 { config, name, nodes, 3 more }
config: Config { retries, timeout }

Configuration for a step (retries and timeout).

retries: Retries { backoff, delay, limit }

Retry policy for a step.

backoff: "constant" | "linear" | "exponential"

Backoff strategy for step retries.

One of the following:
"constant"
"linear"
"exponential"
delay: number | string

Duration as milliseconds (number) or human-readable string.

One of the following:
number
string
limit: number
timeout: number | string

Duration as milliseconds (number) or human-readable string.

One of the following:
number
string
name: string
nodes: Array<unknown>

Child nodes (recursive).

type: "step_do"
resolves?: number
starts?: number
UnionMember2 { name, options, type, 3 more }
name: string
options: Options | null

Options for a waitForEvent step.

event_type: string
timeout: number | string

Duration as milliseconds (number) or human-readable string.

One of the following:
number
string
type: "step_wait_for_event"
payload?: Type { type } | UnionMember1 { fields, type }

Shape descriptor for JSON payloads.

One of the following:
Type { type }
type: "unknown"
UnionMember1 { fields, type }
fields: Record<string, unknown>

Nested JsonShape fields (recursive structure).

type: "object"
resolves?: number
starts?: number
UnionMember3 { name, timestamp, type, 2 more }
name: string
timestamp: string
type: "step_sleep_until"
resolves?: number
starts?: number
UnionMember4 { nodes, type }
nodes: Array<unknown>

Child nodes (recursive).

type: "loop"
UnionMember5 { kind, nodes, type }
kind: "all" | "any" | "all_settled" | "race"

Parallel execution strategy.

One of the following:
"all"
"any"
"all_settled"
"race"
nodes: Array<unknown>

Child nodes (recursive).

type: "parallel"
UnionMember6 { catch_block, finally_block, try_block, type }
catch_block: CatchBlock | null
nodes: Array<unknown>

Child nodes (recursive).

type: "block"
finally_block: FinallyBlock | null
nodes: Array<unknown>

Child nodes (recursive).

type: "block"
try_block: TryBlock | null
nodes: Array<unknown>

Child nodes (recursive).

type: "block"
type: "try"
UnionMember7 { nodes, type }
nodes: Array<unknown>

Child nodes (recursive).

type: "block"
UnionMember8 { branches, type }
branches: Array<Branch>
condition: string | null
nodes: Array<unknown>

Child nodes (recursive).

type: "if"
UnionMember9 { branches, discriminant, type }
branches: Array<Branch>
condition: string | null
nodes: Array<unknown>

Child nodes (recursive).

discriminant: string
type: "switch"
UnionMember10 { class_name, functions, nodes, 2 more }
class_name: string
functions: Record<string, Functions>
name: string
nodes: Array<unknown>

Child nodes (recursive).

type: "function_def"
nodes: Array<unknown>

Child nodes (recursive).

type: "start"
payload?: Type { type } | UnionMember1 { fields, type }

Shape descriptor for JSON payloads.

One of the following:
Type { type }
type: "unknown"
UnionMember1 { fields, type }
fields: Record<string, unknown>

Nested JsonShape fields (recursive structure).

type: "object"
UnionMember11 { name, type, resolves, starts }
name: string
type: "function_call"
resolves?: number
starts?: number
UnionMember12 { name, nodes, type }
name: string
nodes: Array<unknown>

Child nodes (recursive).

type: "function_def"
UnionMember13 { kind, type }
kind: "break" | "return"

Break or return from a loop.

One of the following:
"break"
"return"
type: "break"
payload?: Type { type } | UnionMember1 { fields, type }

Shape descriptor for JSON payloads.

One of the following:
Type { type }
type: "unknown"
UnionMember1 { fields, type }
fields: Record<string, unknown>

Nested JsonShape fields (recursive structure).

type: "object"
modified_on: string
formatdate-time
workflow_id: string
formatuuid