Agent cookbook: canonical sequences
This page is for an MCP-connected agent (or the operator driving one) that already knows the individual tools and wants the proven order to call them in. Every call returns the { success, data } envelope described in the agent reference; sequences 1 and 2 below are the two legal entry surfaces. Each sequence states its preconditions, the numbered calls with their key parameters, what you should see, and where to look when a call refuses.
No sequence in this cookbook lands anything by itself: every path ends at a gate or an accept, and a proposer never approves its own proposal.
Author, publish, invoke
The full authoring loop: from an empty draft to a fresh mission running your graph.
Preconditions — tenant-admin MCP access; a model and provider you are allowed to bind (there is no silent fallback at invoke).
Steps
workflow_catalog— read the palette first: 138 node types in 17 categories, each with its pins. Wire only pin-compatible connections; node types with lifecycleLegacyare publish-blocked in new drafts.workflow_create_draft— pass your graph payload asgraphJson(a minimal skeleton is fine); you get back anidand aworkflowIdin stateDraft, the only editable state. There is no name parameter here — set the display name separately withworkflow_rename.workflow_update_draft— send nodes and wires; repeat as often as needed while the version is still a draft.- Governed graphs only:
workflow_materializeinjects the required control nodes into your draft — deterministically, before publish — so review them like any node you authored. Useworkflow_waive_controlwith a written reason for a control that can be waived; some controls are non-waivable. See Governance. workflow_validate_draft— a dry run of the same validator publish uses. It aggregates every problem in one response: fix them all, then validate again — do not fix one and retry.workflow_publish— freezes the graph into an immutable, checksummed (SHA-256) version. A later rename stays outside the checksum. See what publishing freezes.workflow_invoke— pass an explicitversion(≥ 1: a published version, never a draft), your run parameters (bound at compile time), andmodel+provider(required unless tenant defaults resolve them) — or bind a named preset withpresetIdinstead, the lever this estate prefers over a raw model (agent reference). Invoke creates a fresh mission around the run.- Watch it:
mission_getfor mission state,workflow_run_nodesfor per-node progress,decision_listfor gates waiting on a decision.
Expected outputs — a workflowId; a published version number; a new mission id from the invoke; gates arriving as decisions while it runs.
If it refuses — validation problems (gate dominance, arm reconvergence, a Legacy node, …) all arrive at once under VALIDATION_ERROR; edits to a non-draft return CONFLICT; invoke refuses when the workflow is not invocable. Causes and recoveries: Refusals & failure modes.
Run on an existing mission
The acceptance loop: start a run on a mission that already exists, resolve its gates, then accept or discard what it proposes.
Preconditions — an existing mission that is planned and not terminal; a published workflowId and version; no run already open on the mission — unless you are deliberately competing with a shared groupId.
Steps
mission_run_start—missionId,workflowId,version, parameters;groupIdoptional. OmitgroupIdfor strict-sequential behavior. OnlyStartedmeans a run exists — handle all 11 start statuses.- Poll
mission_run_getuntil the run reachesProposed. While it runs, gates park as decisions: list them withdecision_list, resolve them withdecision_respond—approveresumes the step,skipcancels it,failfails it. You never approve a proposal you raised yourself. - Decide.
mission_run_accept: onAccepted, exactly one changement lands on the mission branch, andmission_run_getnow carries the seal anchors andisAnchored. Acceptance is physical and fail-closed: if no validation backend is reachable in your environment, the accept returnsValidationRefusedand nothing merges — the run staysProposed. OnStaleRefusedthe tip moved underneath you: start a fresh run off the new tip; never retry in a loop. Ormission_run_discard: nothing landed, nothing to undo. All 7 tokens: accept statuses. mission_changement_stack— the ordered stack of everything accepted so far; the mission's MR is this composed stack. See changements.- To undo an accepted run:
mission_revert_previewfirst — it shows the transitive dependent cascade — thenmission_revert, which reverts in reverse ordinal order and fails closed on conflict: the cascade aborts cleanly and names the failing member; nothing partial lands.
Competition variant — start several runs with the same groupId from the same tip (different workflows, parameters, or node instructions). Accept the one you keep; the others are rejected and their branches deleted; a later accept in the group returns GroupAlreadyWon.
Expected outputs — a run id; outcome Proposed → Accepted or Rejected (run outcomes); one changement ordinal per accepted run.
If it refuses — 10 non-Started start tokens and 6 non-Accepted accept tokens, each with a recovery: Refusals & failure modes.
Clone a system template
Preconditions — none beyond MCP access; you clone into your own tenant.
Steps
workflow_system_list— the 22 built-in templates.workflow_system_get— inspect the graph before you clone; cheaper than cloning just to look.workflow_clone_from_system— you get a fresh draft you own. Cloning never publishes.- Continue as in sequence 1, steps 3–6: edit, validate, publish.
Templates are representational: cloning gives you the graph to make your own, not a wire into the flow the platform runs internally. See System templates.
Expected outputs — a new workflowId in state Draft, fully editable.
If it refuses — the clone itself rarely refuses; any problems you inherit surface at workflow_validate_draft, all at once — Refusals & failure modes.
Compose by reference
Preconditions — a draft open for editing; the sub-workflow you want to embed has a Published version — only published versions resolve.
Steps
workflow_tile_catalog— the published tiles you can embed, including thesys-building blocks.- Place a FlowRef node via
workflow_update_draft. The child's tunnel pins project onto the tile; the child shares your run and your acceptance — composition, never a separate invocation surface. - Before archiving a workflow that others may embed:
workflow_referenced_by. Archive is refused while the list is non-empty. workflow_rebind_flowref— move a consumer to a different target. Rebinding invalidates gate ratification: the affected gates must be re-approved.
Expected outputs — a draft whose FlowRef resolves at validation; workflow_referenced_by returning the live consumers of any published flow.
If it refuses — archiving with live consumers returns CONFLICT; a FlowRef pointing at an unpublished target surfaces at validation. Refusals & failure modes.
Start from a trigger
Preconditions — a published version, and a way off the MCP surface: there is no workflow-trigger MCP tool, so registering the trigger happens in the dashboard or over the platform's REST API. Triggers never fire drafts.
Steps
- Publish, as in sequence 1.
- Register the trigger outside MCP — either a human uses Manage triggers on the workflow in the dashboard's workflow list, or you call the REST triggers endpoint. Pick one of three kinds: Schedule (a cron expression), Webhook (the endpoint carries a write-only secret — store it at creation, you cannot read it back), or Event (one of the six live seams:
mission.created,conversation.completed,support-case.created,incident.created,batch.completed,mr.merged). - Choose the version policy:
LatestPublishedfollows the latest published version;Pinnedstays on the one you name.selectedModelandselectedProviderare mandatory on the trigger. - Verify a firing:
workflow_runsfor the workflow's runs, thenmission_getanddecision_liston the mission each firing creates.
Every firing behaves like a workflow_invoke: a fresh mission, the same graph, the same gates. Triggers never bypass gates — a triggered run pauses at the same decisions a manual run does.
Expected outputs — one new mission per firing; the runs visible under workflow_runs.
If it refuses — a trigger pointed at an archived or never-published workflow cannot fire; omitting the model or provider refuses at registration. Refusals & failure modes.