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
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the text file creation and upload. | - |
| Data | Data | The content to write. Non-string data is converted to text before saving. | - |
| Name | Data | The filename for the generated text file. If the name does not end with .txt, the extension is appended automatically. | - |
| Path | Data | Optional 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
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the node has finished running. |
| File | Data | The 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.
.txtis 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
- Connect AI Write or Plain Text output to Data.
- Set Name to
"summary". - Optionally set Path to
"exports/text". - 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.