Skip to main content
Glama

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

NameRequiredDescriptionDefault
nameNoDescriptive 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.
syncNoIf true, wait for workflow to complete and return results directly (blocking). Default is async (non-blocking).
workflowYesThe ComfyUI workflow JSON (API format)
outputModeNoImages are always saved to disk with absolute paths returned. This controls base64 inclusion: 'file' = path only, 'base64' = path + inline data, 'auto' = path + inline if smallauto
imageFormatNoOutput image format (jpeg is smallest, png is lossless, webp is modern)jpeg
imageQualityNoImage quality for JPEG/WebP (1-100, higher = better quality but larger)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare openWorldHint=true, idempotentHint=false, and destructiveHint=false, but the description adds the key non-obvious behavior: the call is async by default and returns a task ID immediately, with sync:true switching to blocking. It does not cover failure modes (e.g., malformed workflow JSON) or queue/rate behavior, which is a modest gap for an execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The async behavior and follow-up tools are front-loaded in the first two sentences, and the naming and sourcing guidance follow as clearly labeled directives. The only waste is minor overlap with the schema's own parameter descriptions for name and sync.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With six parameters, a nested free-form workflow object, no output schema, and mutation semantics, the important flow (submit → task ID → poll → fetch) is fully explained. It stops short of covering validation or error handling for an invalid workflow payload, which is the main remaining gap given the presence of a validate_workflow sibling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents name, sync, outputMode, imageFormat, and imageQuality. The description's name advice and sync:true/blocking note largely restate the schema's own descriptions rather than adding format or constraint detail, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb and resource (run a ComfyUI workflow in API-format JSON) and explicitly sets it apart from building workflows, routing agents toward list_examples/get_example_workflow and search_templates/get_template instead. An agent can tell this executes a workflow rather than authoring, validating, or recommending one.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to and what-next guidance: it names get_task for progress and get_task_result for results, and states the sync:true escape hatch for blocking execution. It also names the preferred prerequisites (examples/templates) and calls it a best practice, so the agent knows what to do before and after this call.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.