See Stacksync in action with a solution architect. Book a demo ↗
Workflows

Workflows

Save workflow draft step

PUT
/v1/workspaces/{workspace_id}/workflows/{workflow_id}/draft/steps/{step_id}

Add one step to the latest draft or replace it, with the edges to add and remove, as the builder's node Save does: the step's trigger is set up, then the draft is saved. A draft saved since you read it is refused with 409, never overwritten.

Authorization

Authorizationstringheaderrequired

Bearer <key>, where <key> is a workspace API key or a user API key. See Authentication.

Path Parameters

workspace_id*integer

The workspace. List the ones your key can reach with GET /v1/workspaces.

workflow_id*string

The workflow.

Formatuuid
step_id*string

The step, its workflow_module_instance_id in the workflow document.

Query Parameters

region*Regions

Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them

Value in"besg""usnv"

Request Body

application/json
  1. body
step*

The step as the document holds it, added or replacing the stored one; its workflow_module_instance_id is the path's step_id

edges_to_add?array<>

Edges added to the draft; both ends are steps of the draft once this step is saved

edges_to_remove?array<string>

The edge_id of each edge removed from the draft

expected_last_modified_time?|

The last_modified_time of the draft you read; refused with 409 when it changed

Defaultnull
validate_only?Validate Only

Run every check of the write and answer 204 without writing: a refused write answers the error the write would

Defaultfalse

Response Body

OK

application/json
  1. response

The draft once one step is saved: the step and every edge touching it, as stored

workflow_id*Workflow Id
region*Regions
Value in"besg""usnv"
version*

A version without its document; step_ids lists its steps (workflow_module_instance_id)

triggers*array<>
step*
edges*array<>
webhook_trigger?|

For a webhook trigger step: the URLs that run it

Defaultnull
Save workflow draft step
curl -X PUT 'https://api.stacksync.com/v1/workspaces/0/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/draft/steps/string?region=besg' \  -H 'Content-Type: application/json' \  -d '{  "edges_to_add": [    {      "edge_id": "input-wait_5_seconds",      "source": {        "workflow_module_instance_id": "input"      },      "target": {        "workflow_module_instance_id": "wait_5_seconds"      }    }  ],  "step": {    "module_id": "system-wait-1",    "name": "Wait 5 seconds",    "properties": {      "wait_for": 5    },    "workflow_module_instance_id": "wait_5_seconds"  }}'
{  "workflow_id": "<workflow_id>",  "region": "besg",  "version": {    "workflow_version": "<workflow_version>",    "is_draft": false,    "is_deployed": false,    "last_modified_time": "<last_modified_time>",    "step_ids": [      "<step_ids>"    ]  },  "triggers": [    {      "step_id": "<step_id>",      "status": "succeeded",      "msg": "<msg>"    }  ],  "step": {    "name": "<name>",    "workflow_module_instance_id": "<workflow_module_instance_id>",    "module_id": "<module_id>",    "description": "<description>",    "properties": {},    "connections": [],    "module_options": {      "patches": {},      "layout": {        "group_module_instance_id": "<group_module_instance_id>"      },      "enable_error_handling": false,      "workflow_module_execution_timeout": 0    },    "error_handling_strategy": {      "conditions": [],      "else_condition": {        "retry_count": 0,        "retry_interval": 0      }    }  },  "edges": [    {      "source": {        "handle_id": "<handle_id>",        "workflow_module_instance_id": "<workflow_module_instance_id>"      },      "target": {        "handle_id": "<handle_id>",        "workflow_module_instance_id": "<workflow_module_instance_id>"      },      "edge_id": "<edge_id>"    }  ],  "webhook_trigger": {    "step_id": "<step_id>",    "draft": {      "url": "<url>",      "method": "<method>",      "wait_for_result_url": "<wait_for_result_url>",      "requires_api_key": false,      "query_parameter_names": [        "<query_parameter_names>"      ],      "header_names": [        "<header_names>"      ]    },    "deployed": {      "url": "<url>",      "method": "<method>",      "wait_for_result_url": "<wait_for_result_url>",      "requires_api_key": false,      "query_parameter_names": [        "<query_parameter_names>"      ],      "header_names": [        "<header_names>"      ]    }  }}