Skip to content

Durable workflows

Durable workflows are for a bounded sequence of MCP tool calls that may outlive one client request. workflow_start writes a private checkpoint and returns an operation ID immediately. workflow_status, workflow_resume, and workflow_cancel address that operation only when the caller supplies the same bot profile and Discord target binding.

Every step is invoked through the server’s normal tool middleware. Validation, guild allowlists, category policy, access checks, write mode, approvals, audit, and Discord error handling therefore remain in force. A workflow is not a second execution path around those controls.

Approval of workflow_start does not approve its individual writes. A messages_publish or messages_update step still needs the exact __confirm_hash, one-time __confirm_id, and __confirm: true from that tool’s preview. These approvals must remain valid when the step runs; workflows do not provide an interactive approval queue.

The definition is limited to 128 ordered steps. mcp_pipeline and all workflow_* tools are rejected inside a workflow, so nesting cannot create an unbounded executor tree. The engine does not claim general rollback.

The store is private local state (0700 directory and 0600 files) with atomic replacement and an exclusive per-operation lock. Checkpoints are written before a step is invoked and after its result is observed. If a process stops while a non-idempotent step is in_flight, the next explicit resume marks the operation needs_review; it never replays that step automatically because Discord may already have applied it. Only a tool policy that declares both idempotency and safe retry can be retried after explicit resume.

Cancellation is cooperative. It stops the next step and aborts the current invocation when the underlying tool honors its signal. A cancellation around an ambiguous write still needs outcome review.

A partial or unverified composer receipt stops the workflow at needs_review, before the next step. Inspect the Discord receipt and live message before approving another attempt; resuming the workflow does not automatically repeat that delivery.

Status responses expose the operation ID, target binding, state, step counts, and safe error code. Job IDs are opaque wf_ references.

Give workflow_start a stable idempotency_key of 16 to 128 letters, digits, underscores, or hyphens. Retry with the same key, target, and steps if the start response is lost. The server returns the existing operation and rejects a changed request with the same key. Keep the key for as long as you might retry that operation.

Set MCP_WORKFLOW_TASKS=true on the server and connect a client that declares io.modelcontextprotocol/tasks on MCP 2026-07-28. A keyed workflow_start can return a task ID for tasks/get and tasks/cancel. Polling and cancellation use the same caller and target checks as the ordinary workflow tools. After a server process interruption, use workflow_status and review the checkpoint before explicitly calling workflow_resume.

Clients without the extension receive the regular workflow result. Host support varies across the MCP extension support matrix.