FileWrite

Description

The File Write node saves incoming text data to a file on your local disk. It supports both overwrite and append modes, and can optionally receive the target file path dynamically from an upstream node instead of using a fixed path.

It automatically creates missing parent directories, uses UTF-8 encoding, and passes a confirmation message downstream so you can track what was written in your workflow.


Configuration Properties

📁 Filepath Section

TextBox
The static path to the file where data will be written. You can type the path manually or use the Browse... button.

Browse...
Opens a standard Windows file dialog to visually navigate your folders and select (or create) the target file. The chosen path is automatically filled into the TextBox.


⚙️ Mode Section

Append Mode
When checked, the node adds the incoming text to the end of the existing file (each write appends a newline after the content).
When unchecked, the node overwrites the file completely with the new content.


First line input Section

Use Input Path
When checked, the node dynamically changes its behavior:

  1. The static Filepath controls are disabled (the static path is ignored).
  2. A second input anchor appears on the node:
    • Anchor 0 receives the file path (as a string).
    • Anchor 1 receives the actual content to write.

This is extremely powerful for batch processing. For example, you can connect a Folder List node to generate file paths, and a Template node to generate content, then write multiple files in a loop without changing the configuration.


Usage Example

"Export generated game assets to individual files":

  1. A Sequencer node outputs game asset descriptions one by one.
  2. A Template node constructs a filename like Assets\asset_001.md.
  3. A File Write node with Use Input Path checked:
    • Anchor 0 receives the filename from the Template.
    • Anchor 1 receives the asset description from the Sequencer.
  4. Each asset is saved to its own file automatically.

"Daily log file":

  1. An Agent node generates a daily summary.
  2. A File Write node with:
    • Filepath: Logs\daily_summary.txt
    • Append Mode: checked
  3. Each day's summary is added to the same file without erasing previous entries.

⚠️ Pitfalls to Avoid

Append Mode accumulates indefinitely: If you use Append Mode in a loop without clearing the file first, the file will grow with each iteration. If you want a fresh file each run, leave Append Mode unchecked, or add a File Write node at the start of your workflow with empty content to reset the file.

Use Input Path + empty path: If Use Input Path is checked but the upstream node sends an empty string as the file path, the write operation is silently skipped (no file is created, no error is thrown). Always ensure a valid path is provided.

Path sanitization: The node automatically removes certain characters from dynamic paths (braces {}, brackets [], slashes /, percent %, commas ,, quotes "). If your filenames legitimately contain these characters, they will be stripped. Use static paths if you need special characters.

File locking: If the target file is currently open and locked by another application (like a text editor or Word), the write operation will fail and send an error message downstream. Close the file in other applications before running the workflow.

No confirmation dialog: The node overwrites files without asking for confirmation when Append Mode is unchecked. Be careful with important files — consider using a dedicated output folder to avoid accidental data loss.

Encoding: The node always writes in UTF-8. If you need a different encoding (like ANSI or UTF-16), you will need to use a Code node to handle the file writing manually.