execute_workflow_sync
Submit a ComfyUI workflow and wait for execution to complete with real-time progress, returning prompt_id, status, and outputs. Use it to run workflows synchronously and retrieve generated files.
Instructions
Submit a ComfyUI workflow and wait until execution completes with real-time progress (WebSocket if available, polling fallback). Returns prompt_id, status (completed/failed/timeout), and outputs. When status is error, still check outputs — if present, use download_output or get_last_output to retrieve files. When timeout_ms is omitted, uses recommended_timeout_ms from get_system_resources (higher on MPS/Apple). Requires COMFYUI_HOST.
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": "<workflow>"
},
"name": "execute_workflow_sync"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflow | Yes | Workflow JSON string (from build_workflow or loaded file) | |
| timeout_ms | No | Max wait in milliseconds. When omitted, uses get_system_resources recommended_timeout_ms (e.g. 1.2M on MPS). | |
| stream_progress | No | Stream progress updates via WebSocket (default true) |