Skip to main content

Write Text File

Controlled node

Overview

The Write Text File node converts input data to UTF-8 text and saves it as a .txt file in the project library. It is useful for exporting plain text results, logs, generated prompts, summaries, or other workflow output that should be stored as a library file.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the text file creation and upload.-
DataDataThe content to write. Non-string data is converted to text before saving.-
NameDataThe filename for the generated text file. If the name does not end with .txt, the extension is appended automatically.-
PathDataOptional folder path in the library where the text file should be saved. Missing folders are created automatically. If omitted, the file is saved in the root library folder.root

Outputs

OutputTypeDescription
DoneEventFires when the node has finished running.
FileDataThe generated library file reference. If validation or upload fails, this output contains an error object.

Runtime Behavior and Defaults

  • Controlled Node: The node runs only when the Run event fires.
  • Project Requirement: A runtime project ID is required so the text file can be uploaded to the project library.
  • Filename Handling: The node requires a non-empty Name input. .txt is appended if the extension is missing.
  • Directory Creation: If Path is provided, the node creates or resolves that library folder path before uploading.
  • Text Conversion: Data is converted to a string and written as a UTF-8 buffer.
  • Error Handling: If data, project ID, filename, or upload fails, File contains an error object instead of a file reference.

Example Usage

Save Generated Text

  1. Connect AI Write or Plain Text output to Data.
  2. Set Name to "summary".
  3. Optionally set Path to "exports/text".
  4. Trigger Run from a Start node or another event.

The node saves summary.txt to the library and outputs the generated file reference.

tip

Use Get Library Download URLs after this node if you need a downloadable link for the generated text file.