Workflows
Create workflow
Create a workflow with only its Input step, as the builder's New workflow does: its other steps are saved in its draft once it exists (PATCH /draft), which sets up their triggers. A document refused leaves no workflow behind.
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.
region*RegionsRegion of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them
"besg""usnv"Idempotency-Key?|Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.
nullapplication/json- body
workflow_name*Workflow Name1 <= length <= 200workflow_resource_id?|A human-readable id, unique in the workspace (lowercase letters, digits and _, at most 60); derived from the name when absent
nullfolder_id?|The folder to create it in; the root when absent
nullis_shared_with_workspace?|nulldocument?|The first draft's document, holding only the Input step; an empty draft when absent
nullvalidate_only?Validate OnlyRun every check of the write and answer 204 without writing: a refused write answers the error the write would
falseCreated
application/json- response
workflow_id*Workflow Idworkflow_name*Workflow Nameregion*Regions"besg""usnv"version*A version without its document; step_ids lists its steps (workflow_module_instance_id)
triggers*array<>curl -X POST 'https://api.stacksync.com/v1/workspaces/0/workflows?region=besg' \ -H 'Content-Type: application/json' \ -d '{ "workflow_name": "<workflow_name>"}'{ "workflow_id": "<workflow_id>", "workflow_name": "<workflow_name>", "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>" } ]}