3.3 KiB
Node: Export Workflow API @ vrch.ai (vrch.ai/workflow)
Exports the currently executed ComfyUI workflow as API format JSON (from hidden PROMPT) to a server-side directory.
This node is designed for queue-time export (no extra HTTP route required).
It forces execution on each queue run (IS_CHANGED = NaN) to avoid cache-skip on unchanged graphs.
1. Add the node
Add Export Workflow API @ vrch.ai into your workflow and connect it into the execution path.
Because this is an OUTPUT_NODE, it can be used as an end-stage export step.
2. Configure parameters
-
enable_save(BOOLEAN)- Global switch for this node.
Falseskips export without errors.
-
disable_save_in_exported_api(BOOLEAN)- Default:
True - When enabled, exported API workflow will set
enable_save=falsefor allVrchWorkflowApiExportNodenodes.
- Default:
-
workflow_folder(STRING)- Relative subfolder under the selected target base directory.
- Default: empty string (
"", save into target root directly). - Example:
TensorRT/live_portrait
-
workflow_name(STRING)- Output filename.
.jsonis auto-appended if missing. - Default:
workflow_api
- Output filename.
-
output_dir_option(COMBO)vrch_workflows_api_dir(default)comfyui_output_dircomfyui_input_dircomfyui_temp_dircustom_dir
-
custom_dir(STRING)- Used only when
output_dir_option = custom_dir. - Always visible in UI for easier editing.
- Default: empty string (
"").
- Used only when
-
pretty_json(BOOLEAN)- Default:
True True: indented JSONFalse: compact JSON
- Default:
-
debug(BOOLEAN)- Prints export diagnostics to ComfyUI server logs.
3. Target directory behavior
The final path is:
<base_dir>/<workflow_folder>/<workflow_name>.json
Base directory resolution:
vrch_workflows_api_dir->/basedir/user/default/workflows_apicomfyui_output_dir->folder_paths.output_directorycomfyui_input_dir->folder_paths.input_directory(or fallback getter)comfyui_temp_dir->folder_paths.temp_directory(or fallback getter)custom_dir-> user-provided absolute/expanded path
4. Safety behavior
workflow_namecannot contain path separators.workflow_foldermust be relative and cannot contain./..segments.- Non-finite numeric values (
NaN,Infinity,-Infinity) are normalized tonullfor valid JSON output. - Existing file is overwritten only when content changed (unchanged content skips write via in-process last-export hash cache).
5. Runner integration example
If your runner reads:
~/data/comfyui-lite-workflows/workflows_api
map it into the container, for example:
volumes:
- ${HOME}/data/comfyui-lite-workflows/workflows_api:/basedir/user/default/workflows_api
Then set:
output_dir_option = vrch_workflows_api_dirworkflow_folder = ""(or nested relative folder if needed)
The exported file will be available directly to comfyui-api-runner.
6. Typical usage flow
- Set
workflow_folderandworkflow_name. - Choose
output_dir_option. - Optionally disable/enable export with
enable_save. - Queue the workflow.
- The node writes the API JSON on execution.
- Use runner workflow switching/listing to load the new file.