SDKClient

Workflows

SDK reference for workflows — Inspect deployed workflows, start executions, and read run state and traces.

Inspect deployed workflows, start executions, and read run state and traces.

getWorkflowSnapshot

Get a workflow snapshot with all its nodes and edges. Each node has position: { x, y } (canvas coordinates). Use before executeWorkflow.

GET

Usage:

const result = await swirls.client.workflows.getWorkflowSnapshot({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
idstring
projectIdstring
deploymentIdstring | null
workflowIdstring
namestring
labelstring
descriptionstring | null
createdAtunknown
orgIdstring
userIdstring
nodesobject[]
edgesobject[]

listWorkflows

List one row per stable workflow with preferred snapshot, version count, and active-deployment flag.

GET

Usage:

const result = await swirls.client.workflows.listWorkflows({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

executeWorkflow

Execute a workflow with input data. Returns an execution ID that can be used to track progress via get_execution. IMPORTANT: Before calling this tool, first call getWorkflowSnapshot with the workflow snapshot id to inspect the workflow's nodes and understand what input data is expected. The first node's inputSchema defines the required shape of the "input" object. Omitting required input fields will cause the execution to fail.

POST

Usage:

const result = await swirls.client.workflows.executeWorkflow({
  workflowId: '...',
})

Input:

ParameterTypeRequiredDescription
workflowIdstringYes
appNamestringNo
inputobjectNo

Output:

FieldTypeDescription
executionIdstring

getExecution

Get the status and results of a workflow execution, including all node executions. Use the executionId returned by execute_workflow. The response includes the overall status and each node's individual execution status and output.

GET

Usage:

const result = await swirls.client.workflows.getExecution({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes
appNamestringNo

Output:

FieldTypeDescription
idstring
parentWorkflowExecutionIdstring | null
workflowSnapshotIdstring | null
workflowIdstring | null
deploymentIdstring | null
executorTypestring
executorIdstring
triggerIdstring | null
triggerTypestring | null
statusstring
inputunknown
outputunknown
outputFormatHintsobject | null
formattedOutputunknown | null
errorstring | null
startedAtunknown
completedAtunknown | null
expiredAtunknown | null
createdAtunknown
orgIdstring
userIdstring
nodeExecutionsobject[]

getExecutionReplay

Replay canonical execution events for a workflow run and return reducer-derived snapshot state

GET

Usage:

const result = await swirls.client.workflows.getExecutionReplay({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes
appNamestringNo

Output:

FieldTypeDescription
eventsobject[]
snapshotobject | null

getExecutionTrace

Load all actors and canonical events for a trace (workflow execution or agent session root)

GET

Usage:

const result = await swirls.client.workflows.getExecutionTrace({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
correlationIdstring
rootActorIdstring
actorsobject[]
eventsobject[]

mintActorExecutionGrant

Mint a short-lived WebSocket grant for a workflow execution Durable Object

POST

Usage:

const result = await swirls.client.workflows.mintActorExecutionGrant({
  projectId: '...',
  executionId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
executionIdstringYes

Output:

FieldTypeDescription
actor"directory" | "project" | "session" | "execution"
grantstring
websocketUrlstring
expiresAtstring
appIdstring
projectIdstring
sessionIdstring
threadIdstring
runIdstring
executionIdstring

listRunnableWorkflows

List workflows in a deployment with each workflow's entry node input schema and last execution. id in each row is the workflow snapshot id. Last execution aggregates by stable workflow when possible.

GET

Usage:

const result = await swirls.client.workflows.listRunnableWorkflows({
  projectId: '...',
  deploymentId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
deploymentIdstringYes
appNamestringNo

Output:

FieldTypeDescription
resultsobject[]

On this page