FileRead
Description
The File Read node loads the content of a text file from your local disk and passes it downstream as a string. It is the primary way to inject external documents (scripts, configuration files, story drafts, CSV data) into your workflow.
It supports two modes of operation: reading a fixed file path defined in its configuration, or reading a dynamic file path provided by an upstream node.
Configuration Properties
📁 Filepath Section
TextBox
The static path to the file you want to read. You can type the path manually or use the Browse... button.
Browse...
Opens a standard Windows file dialog, allowing you to visually navigate your folders and select the target file. The chosen path is automatically filled into the TextBox.
⚠️ Note: These controls are disabled (grayed out) when the "Use Input as Path" option is checked, as the static path is ignored in that mode.
Input Section
Use Input as Path
When checked, the node dynamically changes its behavior:
- The static Filepath controls are disabled.
- An input anchor appears on the node.
- The text received on this anchor is treated as the file path to read.
This is extremely powerful for batch processing. For example, you can connect a Folder List node to it, allowing the workflow to automatically read every file in a directory one by one.
Usage Example
"Dynamic Document Analyzer":
- A Folder List node scans a directory and outputs a list of
.txtfile paths. - A File Read node with Use Input as Path checked receives each path.
- An Agent node summarizes the content of each file.
- A File Write node saves the summaries to a new folder.
⚠️ Pitfalls to Avoid
File not found: If the specified path is incorrect, or if the dynamic input provides an invalid path, the node will catch the exception and send an error message downstream (e.g., "File not found: C:..."). Always ensure your paths are valid before running long workflows.
Large files and Context Limits: Reading a 500-page book directly into an Agent node will likely exceed the model's Context Size. If you need to process large documents, use a Dispatch node after the File Read to split the content into smaller chunks before sending it to the AI.
File encoding: The node typically reads files using the system's default encoding or UTF-8. If you are reading files with exotic encodings (like old ANSI code pages), some special characters might appear garbled.
Locked files: If the file you are trying to read is currently open and locked by another application (like Microsoft Word or Excel), the read operation might fail. Prefer reading plain text files (.txt, .md, .csv, .json) that are not exclusively locked.