Author and Deploy Workflows with MCP
Use this path when one job is insufficient and the desired result needs branching, a durable stage boundary, or different placement groups.
Keep six decisions separate
Section titled “Keep six decisions separate”Before authoring, write down:
| Control | Question |
|---|---|
| Dispatch | Which branch receives each event? |
| Transport | How does an event cross each edge and recover? |
| Placement | Which worker group may run each step? |
| Replicas | How much desired concurrency is requested? |
| Ownership | Which consumer owns each input partition or record? |
| Evidence | What proves intent, apply, runtime, and destination effect? |
The assistant must not infer ownership or recovery merely from a replica count.
-
Inspect session authority
Call
mcp_server_metrics,tool_inventory, andtool_get. Confirm URL, tenant, environment, identity, tool tier, and the live schemas for every named mutation. Start inread_only. -
Recommend the topology
Call
workflow_recommendandworkflow_scaling_advice. State the required branches, transports, state, ordering, credentials, placement constraints, ownership contract, expected counts, and teardown boundary. Unknown safety facts are blockers, not defaults. -
Preview all authored material
Preview each proposed job or blueprint and then call
workflow_authoring_previewfor the complete graph. Review generated dispatch, edge transports, imports, bindings, warnings, and the proposal identity. This is the effect-free gate. -
Save the unchanged reviewed proposal
In the separate
write-tier session, callworkflow_authoring_upsertwith the same content and preview identity. If the content changes, preview it again. Record the mutable draft identity. -
Publish an immutable workflow version
Call
workflow_authoring_publishonly after validation succeeds. Record the workflow name and exact published version. Future changes create a new draft/version; they do not rewrite this artifact. -
Prepare bounded placement
Preview the worker group with
deployment_group_preview, then usedeployment_group_createonly if a reviewed run-owned group is required. Confirm membership, worker connectivity, capacity, credentials, source and destination reachability, local/shared storage, and any co-location rules. -
Create a draft deployment and plan it
Call
deployment_createwith the immutable workflow identity. Then calldeployment_plan_preview. Review generated jobs and channels, placement, replica intent, warnings, destructive changes, and whether the preview is still fresh. Record the deployment and plan identities. -
Apply explicitly
Call
deployment_apply_with_refreshonly for the unchanged reviewed plan. Do not blindly retry an interrupted apply. First inspect deployment status, events, proposal identity, and the current desired/observed difference; the correct action may be to wait, re-plan, or recover through an approved product path. -
Prove outcomes in layers
Wait for assignment/readiness, then inspect deployment status, lifecycle events, worker logs, notifications, metrics, traces, and per-branch counts. Finally, perform destination-side readback for every claimed external effect. Plan success is not apply success; apply success is not readiness; runtime success is not external acceptance.
-
Correct or tear down exact identities
Preview a retarget or cleanup action before applying it. Remove only the recorded deployment, generated jobs, channels, group, workflow draft, and external fixtures owned by this run. Re-list each surface and verify zero residue. If ownership is ambiguous, stop and leave the resource intact.
Fan-out-specific review
Section titled “Fan-out-specific review”For a clone branch, prove that the full-archive count equals valid input and that each filtered branch matches its predicate. For round-robin, prove total conservation across outputs; do not claim key affinity. For conditional routing, enumerate the static field-to-port mapping and an explicit unmatched case. See Routing and Fan-out.
Evidence record
Section titled “Evidence record”Keep a sanitized record of the release checksum, client version, session scope/tier, proposal identity, published workflow version, group, deployment, plan, generated artifacts, expected/observed counts, external receipt when used, and cleanup result. Do not include tokens, raw credentials, customer payloads, or full MCP request/response bodies.
For a deterministic practice run, use the local fan-out tutorial.