Skip to main content
Glama

run_workflow

Queue a ComfyUI workflow and wait for completion, returning status, node errors, output file refs, and a preview thumbnail to verify results before saving or delivering.

Instructions

Queue the workflow and (by default) wait for completion. Returns status, node errors on failure, output file refs, any non-file return values (data_outputs: generated text, paths a save node wrote), and an inline preview thumbnail so you can SEE the result (view_output fetches full size). wait=False returns {status: queued, prompt_id} - poll get_run_status. Prove a workflow works before saving/delivering.

Text-only caller (no image input)? Pass return_preview=False - the result then carries a file path instead of a thumbnail if save_dir/COMFYUI_MOUNT_DIR is set.

roll_seeds=True (default) mirrors the browser: every seed/PrimitiveNode set to randomize/increment/decrement is re-rolled and persisted before submit - the raw /prompt API never does, so headless runs repeat forever. False re-runs the stored values.

allow_invalid=True submits despite local validation errors (ComfyUI is the final judge; use it if a valid graph is wrongly blocked). save_dir (or the configured COMFYUI_MOUNT_DIR) relocates every finished output file - images, video, audio alike - into a folder the caller can reach, returning saved_paths. Needs finished files (wait=True); a background run relocates later via save_output(prompt_id=...).

front: None (default) refuses to queue when >=2 prompts are already pending and returns {status: queue_busy} so the USER can choose; True runs next (pending jobs untouched); False waits at the back of the line.

confirm_spend: partner/API nodes charge the user's account per submit, so a graph containing one is gated - pass True only after they have agreed.

LONG RENDERS: a timeout cancels the caller's wait, not the ComfyUI job. Submit wait=False, front=False, then poll get_run_status(prompt_id) until success/error/partial and call save_output. prompt_id survives in manage_queue(status).draftsman_submitted if your session dies mid-poll.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
waitNo
frontNo
save_dirNo
roll_seedsNo
workflow_idYes
allow_invalidNo
confirm_spendNo
return_previewNo
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed10 schema fields changedv0.15.1
    • removedInput schema / properties / allow_invalid / title
      Removed value: -"Allow Invalid"
    • addedInput schema / properties / confirm_spend
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / front
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • removedInput schema / properties / return_preview / title
      Removed value: -"Return Preview"
    • addedInput schema / properties / roll_seeds
      Added value: +{
      +  "default": true,
      +  "type": "boolean"
      +}
    • removedInput schema / properties / save_dir / title
      Removed value: -"Save Dir"
    • removedInput schema / properties / timeout_seconds / title
      Removed value: -"Timeout Seconds"
    • removedInput schema / properties / wait / title
      Removed value: -"Wait"
    • removedInput schema / properties / workflow_id / title
      Removed value: -"Workflow Id"
    • removedInput schema / title
      Removed value: -"run_workflowArguments"
  2. First observedv0.2.0

TDQS

A4.9/5.0
Behavior5/5

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

Without rich annotations, the description carries the burden and exceeds it: it explains seed re-rolling and persistence versus the raw /prompt API, server-side validation authority, spending gates, timeout behavior that does not kill the ComfyUI job, and recovery via draftsman_submitted after the session dies. This is substantial context beyond what annotations state.

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?

Long but every paragraph earns its place: core behavior first, then wait/front semantics, then edge cases and long-render polling guidance. The structure is scannable and the wording is dense without filler.

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?

With no output schema, the description provides the full return contract, including failure and queued responses. It also tells the agent what to do when the pipeline times out and where prompt_id can be recovered after an interrupted session. For a 9-parameter tool with side effects, the contextual surface is fully covered.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate. It explains wait, roll_seeds, allow_invalid, confirm_spend, return_preview, front, save_dir, and timeout_seconds. workflow_id is the sole obviously-nameable parameter and does not need elaboration, so the coverage is nearly complete.

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?

Uses a clear verb+resource pair ('Queue the workflow') and then enumerates exactly what it returns (status, node errors, output file refs, data_outputs, inline preview thumbnail). It also explicitly separates itself from view_output and get_run_status, so an agent can distinguish it from siblings.

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?

Provides concrete conditional guidance: use wait=False for long renders, poll with get_run_status, save with save_output, pass return_preview=False when no image input is needed, set confirm_spend=True only after explicit user agreement, and allow_invalid only when local validation can be lax. It even names the alternative tools and the scenarios that select them.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EnragedAntelope/comfy-draftsman'

If you have feedback or need assistance with the MCP directory API, please join our Discord server