Collect Run Outputs
Auto-archive every run into dated folders so you never lose a render
- trigger
- folder_path
CollectRunOutputs is the janitor node of the Story JSON Nodes pack (stepan-bogatorjov/comfy_scenes_json_node). It's an output node whose one job is to sweep everything loose out of ComfyUI's output/ directory and tuck it into a dated subfolder - output/28.08.2026 003/, say - so a multi-run story project doesn't end up as 200 loose files in one flat folder.
Here's why you want it: a single run of this pack's pipeline deposits scene videos, voiceover WAVs, a music file, the story JSON and a final final_00001.mp4 - all in output/. Run it a few times a day and output/ becomes a landfill where final_00001.mp4 means nothing. CollectRunOutputs runs at the end of the run and moves every loose item (files and subfolders like scenes/ or voiceover/) into <date> <NNN>/, so each finished story owns its own folder.
How it works
It stamps the current local date using date_format (default %d.%m.%Y), finds the next free NNN by scanning for existing <date> <NNN> folders, and moves everything that isn't one of those archive folders into the new one. Past run folders are never touched, so running it twice doesn't re-archive anything. It returns the folder it created, and it runs every execution by design (IS_CHANGED forces it), so it's safe to leave in the graph.
The inputs that matter
- trigger - any socket, used only for execution order. The intended pattern: wire StoryFinalCompile's
output_pathinto it, so the archive happens after the final cut exists. - date_format - a strftime pattern that becomes the folder prefix.
- index_padding - 1–6 digits for the
NNNcounter (default 3). - dry_run - on, it prints exactly what it would move without touching anything. Turn this on for your first run.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/stepan-bogatorjov/comfy_scenes_json_node
Restart ComfyUI (or install via Manager under "Story JSON Nodes"). No extra dependencies.
Troubleshooting
The big one: it moves everything loose in output/. If you keep unrelated render files in output/ and don't want them archived, this node will happily sweep them up - that's by design, so scope your runs accordingly (and use dry_run the first time to see the list). The output is the archive folder path, a STRING you can display or log. And don't wire it before the compile node - it's the cleanup step, so it should run last in the chain, after every save node has written its files.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | * | — | |
| date_formatopt | STRING | %d.%m.%Y | — |
| index_paddingopt | INT | 31–6 | — |
| dry_runopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| folder_path | STRING | — |