← All nodes
Automation

For Each File

Runs a saved flow once for every file in a folder that matches a pattern, with $file_path and $file_name set for each run, and stacks what the runs produce.

When to use it

Use it when one reusable flow should process each file in an inbox folder, and you want that flow kept and versioned on its own.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
FoldertextYesinbox
File patterntext—*
Flow to runselectYesSelect a saved flow…

Example

Every CSV in the inbox

  • Folder=inbox
  • File pattern=*.csv

In the saved flow, read the file with a File Input whose path is $file_path. Its output for every file comes back here, one after another.

Worth knowing

  • The flow you pick must be saved, and cannot be the flow it runs in. Sub-flows may run sub-flows, at most 3 levels deep.
  • Declare file_path and file_name in a Parameter Input in the sub-flow to see them in its own runs; they work as $variables either way.
  • A preview runs the flow for the first 3 files only, and writes nothing.
  • On one canvas, Input Folder → Loop does the same without a separate flow.

Others in Automation