Check, change and prepare a workflow
prepare_workflowCheck a workflow, or a change to one. Call it whenever the user wants to see, check or change a workflow (swap, add, remove or reorder steps), and before showing any plan. Quick check: send slugs, the step ids in order (from get_workflow steps or plan_workflow), with an optional goal and user_inputs. Returns a diagram you can show the user, step_checks (is each required input made by an earlier step or given by the user, plus swap_options for each step), suggestions with reasons (insert a step that makes a missing input, reorder by data flow, swap a step, remove a repeat), the proposed steps with all but swaps applied, and open_in_builder, a link that opens the proposal in the site's builder. Also returns an unsaved portable draft, selected skill inventory, review hash and handoff_check. Send full steps with pinned revisions instead of slugs for custom notes and dependencies. Suggestions and warnings never block the draft; show them and apply only what the user approves. Does not compose with our AI, save, execute or certify approval; an approval hash never authorizes external actions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | No | Optional. What the workflow is for. | |
| name | No | Optional. Defaults to the goal. | |
| notes | No | ||
| slugs | No | Step ids in order, for a quick check or a change: each pinned to its current revision and run after the one before. Send slugs or steps, not both. | |
| steps | No | Full step objects with pinned revisions, notes and dependencies. Send steps or slugs, not both. | |
| user_inputs | No | Input types the user will give (such as ad_copy; get_workflow lists a workflow's in handoff_check.user_inputs). The hand-off check treats them as supplied; they are not part of the draft hash. | |
| custom_skills | No | ||
| response_format | No | concise (default): the Mermaid diagram and 2 swap options per step. detailed: also a text outline, the proposed workflow's diagram and 4 swap options per step. | |
| governing_skills | No | ||
| approved_draft_hash | No | Optional host-reported hash of the exact previously reviewed draft. This field cannot establish consent or execution authorization. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | ||
| schema | Yes | ||
| diagram | No | Show diagram.mermaid to the user in a ```mermaid code block; use outline (detailed) where diagrams do not render. | |
| proposed | No | ||
| next_action | Yes | ||
| step_checks | No | ||
| suggestions | No | ||
| draft_sha256 | Yes | ||
| handoff_check | Yes | ||
| governing_added | No | ||
| open_in_builder | No | Opens this workflow in the AI Blocks builder on useaiblocks.com, where the user can edit, save or download it. |