Skip to main content
Glama

batch

Run multiple ComfyUI workflows as a single durable batch, with actions to submit, check status, collect outputs, and wait for completion.

Instructions

Run MANY ComfyUI workflows under one durable batch_id. Driven by the action parameter:

  • action:"submit" — Enqueue a batch. Provide EITHER workflows (array of API-format workflows) OR one workflow plus a sweep (array of flat input-override sets — each set produces one job, applied to every node that already has that input, like create_workflow (action:"modify")). Reuses the enqueue_workflow path (seeds re-randomized unless disable_random_seed). Returns { batch_id, count, prompt_ids }; the mapping is persisted to disk and stays valid across server restarts.

  • action:"status" — Per-job status for batch_id: each prompt_id's state (pending/running/done/error/unknown) plus rollup counts and all_terminal. Same status source as queue (action:"status").

  • action:"output" — Collected outputs for the batch's COMPLETED jobs: for each done prompt_id, the raw ComfyUI history outputs (node id → images/videos/audio filenames, same data get_history reports — feed filenames to get_image action:"get"). Jobs still pending/running are listed with their state; errored jobs carry the error message. Safe to call before the batch finishes.

  • action:"wait" — Block until every job is terminal (done or error) or timeout_s elapses, then return the same rollup as action:"status" plus timed_out/waited_s. Default timeout 300s, hard cap 600s — it can never hang; if timed_out is true, call it again or poll action:"status". Batch ids are durable — they survive server restarts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sweepNoaction:"submit" — param sweep: one job per override set, e.g. [{"cfg":6},{"cfg":8,"steps":30}]. Each key is set on every node that already has that input.
actionYesWhich batch operation to perform. "submit" takes workflows | workflow+sweep; "status"/"output"/"wait" each require `batch_id` ("wait" also takes `timeout_s`).
batch_idNoThe batch_id returned by action:"submit". Required for actions "status", "output" and "wait".
workflowNoaction:"submit" — one base workflow in API format, used with `sweep`.
timeout_sNoaction:"wait" — max seconds to wait (default 300, hard cap 600).
workflowsNoaction:"submit" — array of ComfyUI workflows in API format (node ID -> {class_type, inputs}). Mutually exclusive with workflow+sweep.
disable_random_seedNoaction:"submit" — if true, do not randomize seed values (default randomizes per job).
Behavior5/5

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

With no annotations, the description carries the full burden and does so exceptionally. It discloses seed randomization behavior, persistence of batch_ids across restarts, the hard cap on timeout_s (600s) ensuring wait can never hang, and that action:"output" is safe before batch completion — all beyond what the schema reveals.

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 efficiently structured with a lead sentence and action-by-action bullets. Every sentence earns its place; no filler or repetition. Front-loading with the core purpose makes it scannable despite its length.

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?

This complex multi-action tool (7 params, no output schema) is fully explained. The description specifies return shapes for submit, status, output, and wait, including rollup counts, all_terminal, timed_out, and waited_s. It also covers edge cases like errored jobs and pending/polling behavior, making it self-sufficient.

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?

Although schema coverage is 100%, the description adds rich semantics the schema omits: sweep applies each override set to every node that already has that input, workflows and workflow+sweep are mutually exclusive, and each action's parameter requirements are spelled out (e.g., "wait also takes timeout_s"). This materially improves parameter understanding.

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 clear verb+resource: "Run MANY ComfyUI workflows under one durable batch_id." It then enumerates four specific actions (submit, status, output, wait) that distinguish it from sibling tools like enqueue_workflow and queue. The reference to reusing the enqueue_workflow path further clarifies its niche.

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?

Directly names when to use this tool and explicitly contrasts with alternatives: "Reuses the enqueue_workflow path", "like create_workflow (action:"modify")", and "Same status source as queue (action:"status")". It also tells users to feed output filenames to get_image, providing cross-tool guidance.

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

Install Server

Other Tools

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/artokun/comfyui-mcp'

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