run_workflow
Execute a custom ComfyUI workflow from API-format JSON, returning a task ID for async tracking or waiting for completion when sync is enabled.
Instructions
Run a custom ComfyUI workflow (API format JSON). Returns immediately with a task ID (async by default). Use get_task to check progress, get_task_result to retrieve results when complete. Set sync:true to wait for completion (blocking). IMPORTANT: Use the 'name' parameter with descriptive names like 'sunset_portrait_v2' or 'logo_design_red' to make generations easy to find later. BEST PRACTICE: Always start from example workflows (list_examples/get_example_workflow) or templates (search_templates/get_template) rather than building workflows from scratch.
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": "run_workflow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Descriptive name for this generation (e.g., 'beach_sunset_v2', 'logo_blue_variant'). Use clear, searchable names to find it later with get_generation_by_name. | |
| sync | No | If true, wait for workflow to complete and return results directly (blocking). Default is async (non-blocking). | |
| workflow | Yes | The ComfyUI workflow JSON (API format) | |
| outputMode | No | Images are always saved to disk with absolute paths returned. This controls base64 inclusion: 'file' = path only, 'base64' = path + inline data, 'auto' = path + inline if small | auto |
| imageFormat | No | Output image format (jpeg is smallest, png is lossless, webp is modern) | jpeg |
| imageQuality | No | Image quality for JPEG/WebP (1-100, higher = better quality but larger) |