Drafts and versions
How a draft becomes an immutable version, which version each trigger and mode runs, and the statuses a version can have.
A workflow has two lives at once: the draft you are editing and the versions you have published. Knowing which one a call runs is the difference between a safe change and a surprise in production.
From draft to version
- Edit the draft. Every Save draft in the studio, every
PATCHof the flow definition and every sync from Git replacesdraft_nodesanddraft_edges. - Publish. Deploy in the studio, or
POST /workflow-orchestration/control-plane/flow-design/flow-definition/:id/publish, copies the draft into a new flow version:- its number is the highest existing number plus one;
- it becomes the default version (
is_default: true), and the previous default stops being one; - the flow definition records it in
latest_version_idandversion_counter.
- Run. From then on, production calls run that version. The draft can keep changing without affecting them.
An empty draft cannot be published. Publishing never changes an existing version: to roll back, open the history in the studio, Restore an earlier version into the draft, save it and publish again.
Which mode runs what
| Started by | Mode | Runs |
|---|---|---|
| Run workflow in the studio | test | The saved draft |
Webhook URL with test | test | The saved draft |
Webhook URL with prod | prod | The default published version |
cron.trigger or connectors.microsoft.outlook.trigger | prod | The default published version (only active workflows with a published version are scheduled) |
workflow.chain from a test run | test | The draft of the target workflow |
workflow.chain from a published run | prod | The default published version of the target workflow |
Each run reads its graph when it starts. A run that is already in progress keeps the graph it started with.
Version statuses
Only the default version (is_default: true) receives production traffic; when no version is marked as default, the
most recent one is used. Besides the common statuses, a version can be marked deprecated, and deleted versions are
ignored when Sommatic AI picks the version to run or numbers the next one.