Workflows
Save workflow draft step
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
AuthorizationstringheaderrequiredBearer <key>, where <key> is a workspace API key or a user API key. See Authentication.
workspace_id*integerThe workspace. List the ones your key can reach with GET /v1/workspaces.
workflow_id*stringThe workflow.
uuidstep_id*stringThe step, its workflow_module_instance_id in the workflow document.
region*RegionsRegion of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them
"besg""usnv"application/json- 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
nullvalidate_only?Validate OnlyRun every check of the write and answer 204 without writing: a refused write answers the error the write would
falseOK
application/json- response
The draft once one step is saved: the step and every edge touching it, as stored
workflow_id*Workflow Idregion*Regions"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
nullcurl -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>" ] } }}PATCHSave workflow draft
Save a whole document over the latest draft, as the builder's Save does: the triggers of the new and changed steps (schedules, email, Gmail, queue consumers, sync triggers) are set up first, then the document is saved. A deployed latest version needs a new draft first (POST /workflows/<workflow_id>/drafts).
GETList queues
The live queues of the workspace in one region, newest first.