Steps
1
Validate a draft
Send one workflow (the object you would put under
workflows). Nothing is stored, and the answer is 200 even for a bad draft:valid says whether the draft would be accepted, message names the first problem found, and outputPorts lists each node’s output ports for its configuration, so you know which sourcePort values are valid. Applying a session runs the same checks, so an invalid definition is never stored. The web UI validates before it saves.2
Know what is checked
3
List and compare versions
Every change to a definition is saved as a version; applying an unchanged definition adds none.Omit
to to compare with the current definition. The diff lists a changed description, nodes added, removed or changed, and edges added or removed.4
Annotate a version
5
Roll back
Verify it worked
List the versions again: the newest entry is the rollback, and a diff from it to$OLD is empty. Start the workflow and it runs the restored definition. The MCP tools diff_workflow_versions, list_workflow_versions, note_workflow_version and rollback_workflow, the CLI (session workflow versions|diff|rollback) and the web UI’s versions panel do the same.
Variations
- Run a saved version without changing the current one. Set
options.versionin the start request (ADMIN keys only):{"sessionId":"demo","workflowId":"greet","options":{"version":"<id>"}}. - Which graph did a run use? Every run records a content hash of the graph it ran, carried by progress, history and the log.
Related
- Workflows API and Sessions API for the full requests and answers.
- Workflow JSON reference for the limits.