Skip to main content
Glama

run_workflow

Run a ComfyUI workflow by name, override parameters, and obtain paths to generated files. Supports waiting for completion or background execution with progress tracking.

Instructions

Run a workflow and return the paths of the files it produced.

Call describe_workflow first to see which parameter names a workflow accepts. Pass seed=-1 to randomise the seed.

Args: name: workflow file name, without the .json extension. params: parameter overrides, e.g. {"prompt": "a red fox", "seed": -1, "steps": 8}. Raw '.' keys are accepted for anything not discovered. wait: wait for the run to finish. When False, returns the prompt_id immediately and the run keeps being watched in the background, so get_progress(prompt_id) reports its steps as they happen. Prefer this for anything slow: waiting blind is what makes a caller mistake a working generation for a hung one. timeout: seconds to wait before giving up on a running job. save_outputs: convert PreviewImage nodes to SaveImage so results are written to output/ instead of the temp folder that ComfyUI clears on restart. free_on_switch: unload models from VRAM before this run when it needs a different set than the previous one AND free VRAM is already below COMFYUI_FREE_VRAM_MIN_FRACTION. Defaults to COMFYUI_FREE_ON_SWITCH. Low free VRAM is normal on its own - ComfyUI keeps models cached - so this deliberately does nothing when there is headroom.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
waitNo
paramsNo
timeoutNo
save_outputsNo
free_on_switchNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully carries the behavioral disclosure burden. It covers return values, background execution behavior (wait=False returns prompt_id immediately), output persistence via save_outputs, and nuanced VRAM handling in free_on_switch (defaults and conditions). It even explains why low free VRAM is normal, demonstrating deep transparency.

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 well-structured and appropriately sized for a complex tool. It opens with a one-sentence purpose, then gives a prerequisite, a seed tip, and a clear 'Args:' list. Every line adds value, with no fluff or repetition.

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 tool with 6 parameters and significant behavioral nuances, the description covers all important aspects: purpose, parameters, return behavior, side effects, and monitoring via get_progress. The availability of an output schema reduces the need to describe return structures in detail, and the description still mentions the top-level return type.

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?

The input schema has no parameter descriptions (0% schema coverage), but the description explains every parameter in detail: name format, params with examples and raw key syntax, wait semantics, timeout, save_outputs conversion, and free_on_switch conditions/default. This fully compensates for the schema's lack of documentation.

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 clearly states 'Run a workflow and return the paths of the files it produced,' which uses a specific verb and resource while distinguishing it from sibling tools like run_workspace. It also mentions describe_workflow, reinforcing its role in the workflow run/inspect cycle.

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

Usage Guidelines4/5

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

The description provides explicit usage guidance: 'Call describe_workflow first' and 'Prefer this for anything slow' when deciding between wait=True and wait=False. It also warns against 'waiting blind,' which helps avoid misuse. However, it does not explicitly name alternative tools or state when not to use this tool, so it falls short of a perfect 5.

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

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