1.5 KiB
1.5 KiB
Draft Workspaces Reference
Use draft workspaces for iterative workflow authoring. They are mutable and revisioned; artifacts are immutable and versioned.
Draft Shape
A draft has:
nameinput_schemastate_schemaoutput_schemastartstepsroutes- optional top-level
output
steps are keyed by stable ids. routes map outcomes to another step id or
__end__.
Mapping Rules
Step input bindings read graph values into node-local input:
{
"target": { "root": "local", "parts": ["text"] },
"path": { "root": "input", "parts": ["text"] }
}
Step output bindings write node-local output into workflow state:
{
"source": { "root": "local", "parts": ["echoed"] },
"target": { "root": "state", "parts": ["echoed"] }
}
Top-level workflow output uses path / target, not step-level
source / target:
{
"path": { "root": "state", "parts": ["echoed"] },
"target": { "root": "local", "parts": ["echoed"] }
}
Workspace Flow
- Create workspace from capability.
- Get workspace with
include_draft=truebefore patching. - Patch with current
revision. - Validate workspace.
- Save artifact or wrapper from workspace.
If a patch returns revision_conflict, fetch the workspace again and retry
against the latest revision.
Focused Helpers
Prefer focused helpers over JSON Patch for common edits:
set_draft_nameset_draft_routeset_step_input_mapset_step_output_map
Use JSON Patch for structural edits the helpers do not cover.