save_workflow
Transforms an API workflow graph into a human-editable format for ComfyUI. Verifies integrity by round-trip conversion, then optionally saves to the workflows directory.
Instructions
Convert an API graph to UI/litegraph format so a human can open and edit it.
The loop builds API format because that's what /prompt runs — it is NOT the file you drag onto the ComfyUI canvas. Call this when the user asks for the editable workflow.
The result is VERIFIED by converting it back to API format and diffing against what you passed in; any mismatch is reported. widgets_values is positional and a silent off-by-one shifts parameters — a plausible-but-wrong file is worse than none, so if the round-trip doesn't match, fix it before shipping it.
With save=True and a name, it's written to ComfyUI's workflows dir so it shows up in the UI's workflow list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| save | No | ||
| workflow | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |