Workflow Versioning
How Versions Are Created
| Trigger | What happens |
|---|---|
| Publish | A snapshot is created automatically before the workflow goes live |
| Manual snapshot | Click Snapshot in the Versions panel at any time while editing |
Both methods produce a full copy of the workflow graph (nodes + edges + config) at that moment in time.
Versions Panel
Open the Versions panel from the right action bar in the editor (clock icon). It shows a timeline of all snapshots for the current workflow:
─────────────────────────────────────────
v7 Published 2026-06-20 14:32 [you]
v6 Manual 2026-06-19 11:05 [alice]
v5 Published 2026-06-15 09:41 [bob]
v4 Manual 2026-06-14 16:20 [you]
...
─────────────────────────────────────────
Each entry shows:
- Version number —
v1,v2,v3… numbered per workflow in the order snapshots are taken (the API'sseq), followed by the workflow's semantic version at that moment (version_number, e.g.1.2.0, which changes only on publish or rollback) - Type —
publish(taken by the publish action),manual(taken by a user), orrollback(taken automatically before a rollback) - Timestamp — when the snapshot was taken
- Author — who took the snapshot
- Live badge — on the snapshot the workflow is running from while it's published (see below)
The newest snapshot is at the top.
Rollback
To restore a previous version:
- Open the Versions panel.
- Click the version you want to restore.
- Click Restore this version.
The workflow graph is replaced with the snapshot's graph. The current graph is automatically saved as a new snapshot (trigger rollback) before the rollback, so you can undo the rollback if needed.
Restoring a version sets the workflow back to Draft status, even if the current version is Published. You will need to go through the review and publish lifecycle again to make the restored version live.
Because a rollback ends in Draft, it follows the same rules as moving the workflow to Draft: lifecycle_manager, space_admin and admin can roll back a Draft or Rejected workflow, only space_admin and admin a Published one, and only admin one that is In Review (staged) — other combinations return HTTP 403. Rolling back an In Review workflow also clears its approval-stage progress.
Who can roll back depends on the workflow's status:
| Current status | Allowed roles |
|---|---|
| Draft or Rejected | lifecycle_manager, space_admin, admin |
| Published | space_admin, admin (rollback takes it offline, like Revise) |
| In Review | admin only |
Any other role gets HTTP 403 (Role "…" cannot roll back a workflow in status "…"). The workflow's owner, as an agent_developer, can take snapshots but not roll back.
Graph Diff
To compare two versions:
- Open the Versions panel.
- Select a base version (click once to highlight).
- Hold
Shiftand select a second version. - Click Compare.
The diff view highlights:
| Highlight | Meaning |
|---|---|
| Green node / edge | Added in the newer version |
| Red node / edge | Removed in the newer version |
| Yellow node | Config changed between versions |
| No highlight | Unchanged |
Click any highlighted node in the diff view to see a side-by-side comparison of its config fields.
How the diff decides what changed:
- Edges are compared by what they connect: their source, target and label. An edge pointed at a different node, or given a different label, shows as one edge removed and one added. Edges match whether or not they have an
id, and whether they usefrom/toorsource/target. - Nodes are matched by
idand marked changed when their type, label or config differ. Moving or resizing a node on the canvas isn't a change.
The diff API (GET …/versions/{a}/diff/{b}) returns added_nodes, removed_nodes, changed_nodes (each as {before, after}), added_edges and removed_edges, going from version a to version b.
Automatic Snapshot on Publish
When a reviewer clicks Approve & Publish on a staged workflow, the system:
- Marks the workflow status as Published.
- Creates a
publishsnapshot of the graph that just went live. - Points the workflow's live version (
published_version_idon the workflow) at that snapshot.
This means the production version is always tied to a specific snapshot, marked Live in the Versions panel. If you later revise and republish, a new snapshot is created and the live pointer moves forward, while the old snapshot stays in the timeline. While the workflow isn't published (after Revise or a rollback), published_version_id is null: nothing of it is live.
Storage and Limits
- Snapshots store the full graph JSON (nodes, edges, and configs).
- There is no hard limit on the number of snapshots per workflow. The list endpoint returns them a page at a time, newest first:
?limit=(1–500, default 100) and?offset=. The Versions panel shows the newest 100. - Snapshots are retained indefinitely unless the workflow is deleted.
- Deleting a workflow deletes all its snapshots permanently.
API Access
Version snapshots are accessible via the REST API for programmatic integrations:
GET /api/v1/agent-workflows/{id}/versions?limit=100&offset=0 # newest first
GET /api/v1/agent-workflows/{id}/versions/{version_id}
POST /api/v1/agent-workflows/{id}/snapshot # create manual snapshot
GET /api/v1/agent-workflows/{id}/versions/{a}/diff/{b} # compare two versions
POST /api/v1/agent-workflows/{id}/rollback # body: {"version_id": "...", "notes": "..."}A version object has id, workflow_id, seq (the v-number), version_number (the workflow's semantic version at the time), graph, name, description, trigger (publish, manual, promote or rollback), notes, created_by and created_at. See the API Reference for full request/response schemas.