Skip to content

Workflows

Get workflow state

Read the saved editable draft, including blocks, edges, loop and parallel containers, and variables. Requires workspace read access. Configured values are included; use this state with Replace workflow state for same-workspace editing, or Export workflow for portable data with registered credential fields cleared. This read records no audit event; `HEAD` mirrors `GET`. OAuth scope: `api:read`.

GET/api/v2/workflows/{workflowId}/state

Read the saved editable draft, including blocks, edges, loop and parallel containers, and variables. Requires workspace read access. Configured values are included; use this state with Replace workflow state for same-workspace editing, or Export workflow for portable data with registered credential fields cleared. This read records no audit event; HEAD mirrors GET.

OAuth scope: api:read.

Authentication

Send a personal or workspace API key in X-API-Key. See key types and access; operations that reject workspace keys say so in their description.

Send X-API-Key in the request header.

Alternatively

Send a Sim OAuth access token in Authorization: Bearer. See OAuth authentication and scopes.

Authorization: Bearer YOUR_ACCESS_TOKEN

Required scopes: api:read

OAuth flows
json
{
  "authorizationCode": {
    "authorizationUrl": "https://www.sim.ai/api/auth/oauth2/authorize",
    "tokenUrl": "https://www.sim.ai/api/auth/oauth2/token",
    "refreshUrl": "https://www.sim.ai/api/auth/oauth2/token",
    "scopes": {
      "api:read": "Read your workspaces, workflows, files, tables, and logs",
      "api:write": "Read, create, change, run, and delete resources in your workspaces",
      "offline_access": "Stay signed in without asking again"
    }
  }
}

OAuth scope: api:read.

Path parameters

workflowIdstringRequired

Unique workflow identifier.

minLength
1

Responses

200

The workflow draft graph.

object

The editable draft graph of a workflow.

1 field
dataobjectRequired

Response data.

5 fields
blocksobjectRequired

Blocks keyed by block id.

Schema details
Additional propertiesobject

One node of a workflow graph and its configuration.

15 fields
idstringRequired

Block identifier, unique within the workflow.

minLength
1
typestringRequired

Registered block type.

namestringRequired

Block display name; must be unique within the workflow.

positionobjectRequired

Canvas coordinates of a block.

2 fields
xnumberRequired

Canvas x coordinate.

ynumberRequired

Canvas y coordinate.

Additional properties are not allowed.

subBlocksobjectRequired

Configured inputs keyed by sub-block id.

Schema details
Additional propertiesobject

One configurable input on a block.

3 fields
idstringRequired

Sub-block identifier.

minLength
1
typestringRequired

Sub-block input type.

minLength
1
valuevalueRequired

Configured value; shape depends on the sub-block type.

Additional properties are not allowed.

outputsobjectRequired

Declared output shape keyed by output name.

Schema details
Additional propertiesvalue

Declared shape of one output; depends on the block type.

enabledbooleanRequired

Whether the block runs.

horizontalHandlesboolean

Whether edge handles render horizontally.

heightnumber

Rendered block height.

advancedModeboolean

Whether the block is edited in advanced mode.

errorEnabledboolean

Whether the block exposes an error branch.

retryobject

Per-block retry configuration.

3 fields
enabledbooleanRequired

Whether the block retries on failure.

maxTriesintegerRequired

Total attempts, including the first.

minimum
2
maximum
5
waitBetweenTriesMsintegerRequired

Delay between attempts, in milliseconds.

minimum
0
maximum
5000

Additional properties are not allowed.

triggerModeboolean

Whether the block acts as the workflow trigger.

dataobject

Container and layout metadata carried by a block.

13 fields
parentIdstring

Identifier of the containing loop or parallel.

extentstring

Constrains the block to its parent bounds.

const
parent
widthnumber

Rendered container width.

heightnumber

Rendered container height.

collectionvalue

Items a forEach loop or collection parallel iterates.

countnumber

Iteration count for a for loop or count parallel.

loopTypestring

Loop container kind.

enum
["for","forEach","while","doWhile"]
whileConditionstring

Condition expression for a while loop.

doWhileConditionstring

Condition expression for a doWhile loop.

parallelTypestring

Parallel container kind.

enum
["collection","count"]
batchSizenumber

Maximum concurrent branches of a parallel.

typestring

Container subtype.

canonicalModesobject

Per-field editing mode, keyed by canonical parameter id.

Schema details
Additional propertiesstring
enum
["basic","advanced"]

Additional properties are not allowed.

lockedboolean

Whether the block is locked against edits.

Additional properties are not allowed.

edgesarrayRequired

Directed connections between blocks.

maxItems
10000
Schema details
Array itemobject

A directed connection between two blocks.

6 fields
idstringRequired

Edge identifier, unique within the workflow.

minLength
1
sourcestringRequired

Source block id.

minLength
1
targetstringRequired

Target block id.

minLength
1
sourceHandlevalue

Source port, or null for the block default.

Schema details

Any of

Option 1string
Option 2null
targetHandlevalue

Target port, or null for the block default.

Schema details

Any of

Option 1string
Option 2null
typestring

Edge renderer type.

Additional properties are not allowed.

loopsobjectRequired

Loop containers keyed by container id; always present, {} when there are none.

Schema details
Additional propertiesobject

A loop container derived from the workflow blocks.

9 fields
idstringRequired

Loop container identifier; equal to the loop block id.

nodesarrayRequired

Block ids inside the loop.

Schema details
Array itemstring
iterationsnumberRequired

Resolved iteration count.

loopTypestringRequired

Loop kind.

enum
["for","forEach","while","doWhile"]
forEachItemsvalue

Items a forEach loop iterates, or the expression producing them.

Schema details

Any of

Option 1array
Schema details
Array itemvalue

One item the loop iterates.

Option 2object
Schema details
Additional propertiesvalue

One item the loop iterates.

Option 3string
whileConditionstring

Condition expression for a while loop.

doWhileConditionstring

Condition expression for a doWhile loop.

enabledboolean

Whether the loop runs.

lockedboolean

Whether the loop is locked against edits.

Additional properties are not allowed.

parallelsobjectRequired

Parallel containers keyed by container id; always present, {} when there are none.

Schema details
Additional propertiesobject

A parallel container derived from the workflow blocks.

8 fields
idstringRequired

Parallel container identifier; equal to the parallel block id.

nodesarrayRequired

Block ids inside the parallel.

Schema details
Array itemstring
distributionvalue

Items distributed across branches, or the expression producing them.

Schema details

Any of

Option 1array
Schema details
Array itemvalue

One item distributed to a branch.

Option 2object
Schema details
Additional propertiesvalue

One item distributed to a branch.

Option 3string
countnumber

Fixed branch count.

parallelTypestring

Parallel kind.

enum
["count","collection"]
batchSizenumber

Maximum concurrent branches.

enabledboolean

Whether the parallel runs.

lockedboolean

Whether the parallel is locked against edits.

Additional properties are not allowed.

variablesobjectRequired

Workflow variables keyed by variable id; always present, {} when there are none.

Schema details
Additional propertiesobject

A workflow-scoped variable.

4 fields
idstringRequired

Variable identifier.

minLength
1
namestringRequired

Variable name, referenced from block inputs.

typestringRequired

Declared variable type.

default
string
enum
["string","number","boolean","object","array","plain"]
valuevalueRequired

Variable value; free-form and validated per type at use time.

Additional properties are not allowed.

Additional properties are not allowed.

Additional properties are not allowed.

Response example 1

json
{
  "data": {
    "blocks": {},
    "edges": [],
    "loops": {},
    "parallels": {},
    "variables": {}
  }
}

Response headers

X-RateLimit-Limitinteger

Maximum requests allowed in the current window.

minimum
0
maximum
9007199254740991
X-RateLimit-Remaininginteger

Requests remaining in the current window.

minimum
0
maximum
9007199254740991
X-RateLimit-Resetstring

ISO 8601 timestamp when the current rate-limit window resets.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Was this helpful?
Suggest an edit