Skip to main content
Glama

get_workflow

Access saved ComfyUI workflows: get JSON, list library, summarize, query nodes, strip to API, slice pipelines, and extract from PNGs—all read-only.

Instructions

Return, list, summarize or query a SAVED workflow FILE — files on disk, named from the library or given as a path/JSON — NOT the graph open on the user's canvas (that is panel_graph_outline). Every action here is READ-ONLY; saving and locking are save_workflow. Driven by the action parameter:

  • action:"get" — the full JSON of one saved workflow FILE named from the library. Defaults to converted API format; pass format:'ui' for the raw on-disk UI JSON. Use action:"analyze" instead if you just need to UNDERSTAND the workflow — it returns a structured summary without flooding context with JSON. Use action:"get" only when you need the actual JSON for enqueue_workflow, create_workflow (action:"modify"), or save_workflow.

  • action:"list" — the workflows saved in the connected ComfyUI server's user library (the same ones visible in the ComfyUI web UI), INCLUDING the ones filed in subfolders. Requires a running ComfyUI server. Takes no other parameters. Returns a numbered list of library names, each relative to the library root — a workflow in a folder appears as 'VIDEO/MiniMaxH3/clip.json', and that whole string is what filename takes. It never reports an absence it did not establish: a listing it could not read says so, and an EMPTY listing says the library could not be CONFIRMED empty (an answer with no names in it cannot show whether it covered subfolders) and tells you to check the ComfyUI sidebar rather than recreate anything.

  • action:"strip" — strip a workflow to a clean, flat API graph, resolving Get/Set buses, Reroutes, subgraph definitions, and bypassed/muted nodes into real connections (the 'de-getter-setter' pass). Unlike action:"get" this reads from ANY server-side file path on disk (not just the workflow library), so it loads ad-hoc / expert workflow files that action:"list" and panel_open_workflow can't resolve. Provide exactly one of: path, filename, or graph. Returns conversion warnings, a node-type summary, and the stripped graph (much smaller than the raw UI JSON).

  • action:"slice" — slice ONE pipeline out of a toggle-template workflow, the kind built with rgthree 'Fast Groups Bypasser/Muter' where one graph holds many pipelines and only one is active at a time. Seeds from the output/SaveImage nodes in the named groups, takes their backward dependency closure (through real links AND virtual Set/Get buses), un-bypasses the kept nodes (and the internals of any subgraph defs they use), and returns a STANDALONE, activated UI graph carrying only the subgraph defs it uses. Pair with action:"strip" afterward to flatten the Set/Get buses into real connections.

  • action:"from_image" — extract embedded ComfyUI workflow metadata from a PNG file. ComfyUI stores the full workflow (API format) and prompt data in PNG tEXt chunks. Use this to reverse-engineer how any ComfyUI image was generated.

  • action:"analyze" — SUMMARIZE a saved workflow file named from the library: sections, node settings, connections, and data flow. Returns a concise text summary (not raw JSON) optimized for AI reasoning. Prefer this over action:"get" unless you need the raw JSON for enqueue_workflow or create_workflow (action:"modify").

  • action:"query" — filter, traverse, project, and aggregate over a saved workflow's nodes WITHOUT dumping the whole JSON (the missing middle between action:"analyze"'s fixed summary and action:"get"'s full dump; on 100+-node graphs this is the ONLY context-safe way to answer questions like 'which KSamplers run cfg>7', 'what feeds node 42', 'count nodes by type'). Provide exactly one of path/filename/graph, then combine: types, title, where widget predicates ANDed ('cfg>7', 'steps<=20', 'sampler_name=euler', 'text~sunset' — ops = != >= <= > < ~contains), ids, upstream_of/downstream_of + depth, fields, group_by, limit, max_chars. Output is TOKEN-BOUNDED and, when it truncates, the tail names WHICH of the two caps fired and the exact parameter to raise — read it and retry rather than concluding the graph can't be read. For the LIVE canvas this is panel_query_graph instead.

  • action:"prompt_director" — read Prompt Director's latest sanitized RUNTIME state after its nodes execute: each node id, node kind, resolved Model Explorer model/LoRA context, structured edit plan, source analysis, exact final prompt, warnings, or Result Critic verdict. Secrets and image tensors are redacted. Pair it with a live panel graph audit: graph inspection explains wiring and widget state, while this explains what the nodes actually resolved and compiled. Pass node_id to inspect one executed Prompt Director node.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsNoaction:"query" — Keep exactly these node ids.
pathNoaction:"strip" / "slice" / "query" — Absolute server-side path to a workflow .json on disk (e.g. C:\\Users\\you\\ComfyUI\\user\\default\\workflows\\pusa_extend.json). Read directly from disk — no library lookup.
viewNoaction:"analyze" — summary (default): structured text with sections, node IDs, key settings, virtual wires, and full connection graph — best for AI understanding. overview: mermaid diagram showing sections as summary nodes with cross-section data flow. detail: mermaid diagram for one section (requires section parameter). list: text listing of all sections with data flow summary. flat: single mermaid flowchart of the entire workflow (best for small workflows). health: graph-health heuristics (disconnected nodes, duplicate model loads, orphaned branches, muted/bypassed).summary
depthNoaction:"query" — Max hops from the traversal seed (seed=0). Absent = full closure.
graphNoaction:"strip" / "slice" / "query" — Inline workflow JSON (UI format for "strip"/"slice"; UI or API for "query"), as an alternative to path/filename.
limitNoaction:"query" — Max nodes listed (default 40, max 200).
titleNoaction:"query" — Keep nodes whose title contains this.
typesNoaction:"query" — Keep nodes whose class_type contains ANY of these (case-insensitive).
whereNoaction:"query" — Widget predicates, ANDed: 'cfg>7', 'sampler_name=euler', 'text~sunset'.
actionYesWhich read to perform. "list" and "prompt_director" take no required parameters; "get" and "analyze" require `filename`; "strip", "slice" and "query" require exactly one of `path`/`filename`/`graph` (and "slice" also requires `groups`); "from_image" requires `image_path`.
fieldsNoaction:"query" — Projection: compact one-liners (default), bare ids, or detail JSON rows.
formatNoaction:"get" — 'api' (default, recommended) converts to compact API format with named inputs, connection references, and _meta.mode flags for muted/bypassed nodes; 'ui' returns the raw UI format with layout positions and links arrays. action:"strip" — 'api' (default) strips to the flat resolved graph; 'raw' returns the file/graph unchanged. Each action accepts only its own two values (this field is the union of what the two tools it replaces accepted) and refuses the third rather than guessing at an alias.api
groupsNoaction:"slice" (REQUIRED) — Group-title substrings (case-insensitive) whose output nodes seed the slice — CSV string or array, e.g. 'TEXT TO IMAGE,TXT' or ['extend','sampler']. Shared post-proc is pulled in via the closure.
node_idNoaction:"prompt_director" — Optional ComfyUI node id; omit to list all recent Prompt Director runtime states.
sectionNoaction:"analyze" — Section name for detail view. Use view='list' first to see available section names.
filenameNoWorkflow library name, exactly as action:"list" reports it. A workflow filed in a folder keeps its folder in the name ('VIDEO/MiniMaxH3/clip.json') and that whole string goes here. REQUIRED for action:"get" and action:"analyze"; one of the three sources for "strip", "slice" and "query".
group_byNoaction:"query" — Aggregate: counts per class_type instead of listing.
max_charsNoaction:"query" — Output character bound (default 12000, max 60000). Raise this — not `limit` — when the truncation tail says the char budget cut the result.
image_pathNoaction:"from_image" (REQUIRED) — Absolute path to a ComfyUI-generated PNG file
upstream_ofNoaction:"query" — Scope to the dependency closure FEEDING this node id.
downstream_ofNoaction:"query" — Scope to the nodes CONSUMING this node id's outputs.
Behavior5/5

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

With no annotations at all, the description carries the full transparency burden and exceeds it: it declares 'Every action here is READ-ONLY', discloses the list action's careful absence semantics ('It never reports an absence it did not establish... an EMPTY listing says the library could not be CONFIRMED empty'), and explains query's token-bounded output with a tail that names which cap fired. It also reveals redaction behavior ('Secrets and image tensors are redacted') and format defaults, going far beyond what schema fields could convey.

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 description is long (~700 words) but well-structured with bolded action headers, consistent bullet formatting, and an excellent front-loaded first sentence that establishes scope and sibling differentiation. Some redundancy exists — for example, the analyze-versus-get preference is stated in both the 'get' and 'analyze' bullets, and 'exactly one of path/filename/graph' appears both in the prose and the action parameter description. For an 8-action, 21-parameter tool, the length is largely warranted.

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?

There is no output schema, so the description must cover return behavior — and it does for every action: list returns a numbered library list, strip returns conversion warnings plus a node-type summary plus the stripped graph, query output is token-bounded with identifiable caps and retry advice, and prompt_director returns sanitized runtime state with redactions. Prerequisites ('Requires a running ComfyUI server'), edge cases (empty listing ambiguity), and cross-tool integration guidance are all addressed. This is complete for the tool's considerable complexity.

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?

Despite 100% schema coverage, the description adds substantial operational meaning: it documents the where-predicate operator syntax ('ops = != >= <= > < ~contains'), explains the two-cap truncation system so agents know to raise max_chars rather than limit, and specifies per-action parameter requirements (slice requires groups; strip/slice/query require exactly one of path/filename/graph). It also clarifies the format union's refusal behavior ('refuses the third rather than guessing at an alias'), which the schema alone does not convey.

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 opening sentence nails the purpose: 'Return, list, summarize or query a SAVED workflow FILE — files on disk, named from the library or given as a path/JSON — NOT the graph open on the user's canvas (that is panel_graph_outline).' It uses specific verbs, names the resource exactly, and explicitly excludes the live canvas while naming the sibling that handles it. Each of the eight action values is further defined with its own precise behavior.

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 is saturated with explicit when/when-not guidance and named alternatives: 'saving and locking are save_workflow', 'Use action:"analyze" instead if you just need to UNDERSTAND the workflow... Use action:"get" only when you need the actual JSON for enqueue_workflow, create_workflow (action:"modify"), or save_workflow', and 'For the LIVE canvas this is panel_query_graph instead.' It also gives pairing advice, such as using slice then strip, and explains why strip can load files that list and panel_open_workflow cannot resolve.

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