SWIRLS_
ReferenceSDKClient

Workflows

SDK reference for workflows — Create, update, execute, and manage workflows, nodes, and edges.

Create, update, execute, and manage workflows, nodes, and edges.

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.

POST

Usage:

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

Input:

ParameterTypeRequiredDescription
workflowIdstringYes
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

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
createdAtunknown
orgIdstring
userIdstring
nodeExecutionsobject[]

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

Output:

FieldTypeDescription
resultsobject[]

On this page