SWIRLS_
ReferenceSDKClient

Graphs

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

Create, update, execute, and manage workflow graphs, nodes, and edges.

getGraphSnapshot

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

GET

Usage:

const result = await swirls.client.graphs.getGraphSnapshot({
  id: '...',
})

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

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

listGraphs

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

GET

Usage:

const result = await swirls.client.graphs.listGraphs({
  projectId: '...',
})

Input:

ParameterTypeRequiredDescription
projectIdstringYes
paginationobjectNo

Output:

FieldTypeDescription
paginationobject
resultsobject[]
totalCountnumber

executeGraph

Execute a graph with input data. Returns an execution ID that can be used to track progress via get_execution.

POST

Usage:

const result = await swirls.client.graphs.executeGraph({
  graphId: '...',
})

Input:

ParameterTypeRequiredDescription
graphIdstringYes
inputobjectNo

Output:

FieldTypeDescription
executionIdstring

getExecution

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

GET

Usage:

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

Input:

ParameterTypeRequiredDescription
idstringYes

Output:

FieldTypeDescription
idstring
parentGraphExecutionIdstring | null
graphSnapshotIdstring | null
graphIdstring | null
deploymentIdstring | null
executorTypestring
executorIdstring
triggerIdstring | null
triggerTypestring | null
statusstring
inputunknown
outputunknown
errorstring | null
startedAtunknown
completedAtunknown | null
createdAtunknown
orgIdstring
userIdstring
nodeExecutionsobject[]

listRunnableGraphs

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

GET

Usage:

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

Input:

ParameterTypeRequiredDescription
projectIdstringYes
deploymentIdstringYes

Output:

FieldTypeDescription
resultsobject[]

On this page