wait_for_workflow
Waits for a workflow run to complete, fail, cancel, or need input or attention, returning a resumable snapshot without changing the run.
Instructions
Wait for a workflow run to need attention or finish; read-only and resumable.
timeout_seconds accepts 0..3600 (default 30; 0 reads once). It is honoured as asked, never silently clamped; out of range is INVALID_PARAMS. Breaking change: values above 300 used to be rejected, and 46..300 were silently held for only 45 seconds. until="terminal" holds until the run stops needing the wait, bounded by a 6 hour server ceiling, and requires timeout_seconds to be omitted. Your MCP client's own request deadline still applies. Prefer holds <=50 seconds after remote "device did not respond" or "connection closed" errors; see docs/multi-task-waiting.md.
Returns when the run is completed, failed or cancelled and has finished settling (stop_reason terminal), or reaches needs_input, needs_attention or paused (stop_reason attention), or the hold ends (timeout, ceiling). If reading the run keeps failing for 3 rounds the last good snapshot comes back with stop_reason observation_unavailable, as does an until="terminal" wait on a terminal run that stays settling with its run file unchanged for 300 seconds. Also returns requested/effective timeout, until, timed_out, elapsed_seconds and polling_guidance. Approval read errors alone do not stop the wait for attention; inspect approval_summary.read_errors for incomplete sources. Known unanswered requests and uncertain approval ownership still stop for attention. Progress is sent every 5 seconds, best effort. A wait never changes, resumes or cancels a run.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workflow_run_id": "<workflow_run_id>"
},
"name": "wait_for_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| until | No | timeout | |
| timeout_seconds | No | ||
| workflow_run_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||