Export as File
Exports text content as a file with any extension.
Overview
The Export as File node creates a file from text content. You specify the text (which can include expressions), a filename with any extension, and a destination. The text is encoded as UTF-8.
Use it to:
- Generate JSON, XML, HTML, or any text-based file format
- Save expression results as files
- Create custom exports not covered by Export to Excel/CSV
Parameters
| Parameter | Description | Required |
|---|---|---|
| Text | Text content to write to the file (supports expressions and multiline) | Yes |
| Filename | Output filename with extension (e.g., output.json) | Yes |
| File Destination | Where to save the file | Yes |
Text
The text content to export. Use expressions to include dynamic data:
{{JSON.stringify($item.data)}}
Or use multiline text for formatted output.
Filename
The filename determines the file type by its extension. Any extension is accepted:
report.jsondata.xmlpage.htmlconfig.yaml
Supports expressions: output-{{$item.data.id}}.json
Settings
| Setting | Description |
|---|---|
| Execution Mode | Once per item (default) or Once |
| Output Mode | How to output results when running once |
| Batch Size | Items to process concurrently (default 5) |
| Stop on Error | Stop workflow on failure |
Output
{
"file": {
"type": "fileData",
"name": "output.json",
"fileInfo": { "type": "..." }
}
}
Access in expressions:
- File object:
{{$item.data.file}} - File name:
{{$item.data.file.name}}
Examples
Generate JSON File
[Get Table] → [Aggregate (collect all)] → [Export as File ("data.json")] → [Copy File]
Text: {{JSON.stringify($item.data.items, null, 2)}}
Create HTML Report
[Get Table] → [Prompt AI ("Generate HTML report")] → [Export as File ("report.html")]
Text: {{$item.data.response}}
Export XML
[Get Table] → [JS Code (build XML)] → [Export as File ("export.xml")] → [Send Gmail]
Tips
- The filename extension determines the file type — use any extension
- Text content is encoded as UTF-8
- Use expressions in both the text and filename parameters
- For structured data (Excel, CSV), prefer the dedicated export nodes
- Connect to Copy File or Send Gmail to distribute the exported file