Skip to main content
Glama

run_workflow

Execute a ComfyUI workflow JSON and retrieve results, either blocking until completion or returning a prompt ID to poll. Includes spend-consent handling for paid workflows.

Instructions

Run a ComfyUI workflow JSON on the ComfyUI this server targets.

That is this machine unless COMFYUI_URL/COMFYUI_HOST points the run/job tools at another one. Wraps comfy run --workflow <path>; accepts an API-format or UI-export file.

Args: wait: if True (default), block until the run finishes and return the full result. If False, submit and return with a prompt_id to poll via job(action="status").

    Progress notifications are EMITTED WHEN THE ENGINE REPORTS ANY —
    do not rely on them. comfy-cli 1.15.0's stream carries no
    per-step events for this verb, so in practice a run is silent
    until it finishes. Poll ``job(action="status")`` from a second
    call if you need progress.
timeout_seconds: used only when ``wait=True``; default 110s sits under
    a typical client's ~120s budget. For a longer run, prefer
    ``wait=False`` + ``job(action="wait")``/``job(action="watch")``.
confirm_spend: SOME workflows (partner-API nodes from
    ``emit_partner_workflow``, or an ``API``-tagged template) spend
    credits when run. Set True ONLY when the user has actually agreed
    to spend — never merely to clear an error. Free workflows are
    never gated by this.

Gotchas: - Without consent, a paid workflow fails CLOSED (spend_consent_required, nothing spent) on a comfy-cli carrying the gate — the enforced floor; a source build past the fail-open floor check may lack it and still spend. - A workflow requesting a huge allocation can pass validation and then crash the whole ComfyUI process on OOM — surfaced as connection-loss/timeout, not a node error; get_logs still reads the log across the crash. - Partner-API nodes need a Comfy credential (COMFY_API_KEY); transient failures retry automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
waitNo
confirm_spendNo
workflow_pathYes
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly. It discloses blocking vs submit-and-return behavior, the unreliability of progress notifications, absence of per-step events in comfy-cli 1.15.0, timeout behavior, credit-spend gating with a fail-closed mode, potential OOM crashes surfacing as connection loss, and automatic retries for partner-API transient failures.

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

Conciseness5/5

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

The description is long but densely structured with an opening summary, parameter explanations, and a 'Gotchas' section. Each section earns its place and adds operational value; the front-loaded purpose sentence lets an agent quickly determine whether this is the right tool.

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

Completeness5/5

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

For a complex, potentially side-effecting workflow runner with no annotations and no output schema, the description is remarkably complete. It covers target environment, accepted file formats, parameter behavior, progress polling strategy, spend consent, crash behavior, credential requirements, and retry semantics. An agent has enough context to invoke correctly and to route long-running or paid workflows appropriately.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It explains `wait`'s blocking behavior and return value, `timeout_seconds`'s scope and default rationale, `confirm_spend`'s gating semantics, and the workflow file formats accepted. Every parameter is given meaning beyond its bare schema type.

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 description opens with a specific verb and resource: 'Run a ComfyUI workflow JSON on the ComfyUI this server targets.' It further clarifies scope by noting which server is targeted and that it wraps `comfy run --workflow`, making the tool's role unmistakable relative to sibling tools like run_template or generate_image.

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 explicitly gives when-to-use guidance: use `wait=False` plus `job(action='wait')`/`job(action='watch')` for longer runs, poll `job(action='status')` for progress, and set `confirm_spend=True` only with actual user consent. It also clarifies that paid workflows fail closed without consent, giving a clear boundary for when the tool is and isn't safe to invoke.

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