nodes / builtin / datatransformation
Save as File
Save text content as a downloadable file
Save text your workflow produced, such as a CSV table, a Markdown report or JSON, as a file in your downloads.
What it does
Section titled “What it does”Save as File takes the text in Content and downloads it as a file named File name plus the extension of File type. The browser’s usual download behaviour applies: the file lands in your downloads folder, or you are asked where to save it, depending on your browser settings.
If File name already ends with the right extension (report.csv with type csv), the extension is not added twice. The file type also sets the file’s format label, so a csv file opens in a spreadsheet app and an html file opens in the browser.
The node needs AWFlow 0.7.0 or later. Workflows that use it do not install on older versions.
When to use it
Section titled “When to use it”- Keep the result of a run on your computer: a scraped table as CSV, a summary as Markdown, raw data as JSON.
- Export data you built with CSV, JSON, Markdown or Code.
- To download a file from a link (an image, a PDF), use Download as file instead. To keep the file inside the workflow for another node, use Convert to File.
Inputs and settings
Section titled “Inputs and settings”| Setting | Type | What it does |
|---|---|---|
| Content (required) | Text | The text to save to the file. |
| File name | Text | Without the extension. Default: file |
| File type | Choice | Options: txt, csv, json, md, html, xml. Default: txt |
Fill Content with an expression that points at the text, for example {{ $input.csv }} after a CSV node. File name can use expressions too, such as report-{{ $run.name }}.
Outputs
Section titled “Outputs”-
Output
The output is an empty item. Its only job is to start the download; the next node, if any, simply runs after it.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”- HTML Extract reads the rows of a table on the current page.
- CSV with Operation Build from items turns them into CSV text in the
csvfield. - Save as File with Content
{{ $input.csv }}, File namepricesand File type csv. You getprices.csvin your downloads.
Common issues
Section titled “Common issues”- “Save as File must run where a browser is available.” The node ran in a place that has no page to start a download from. Run the workflow from the AWFlow app or the extension’s side panel.
- The node fails before saving, saying it expected text. Content points at a list or an object. Turn the data into text first with JSON or CSV, and point Content at that result.
- The file is called
file.txt. File name and File type were left empty, so the defaults were used. Set both.
Related nodes
Section titled “Related nodes”- Download as file: save a file from a link.
- CSV: turn items into CSV text.
- Convert to File: make a file other nodes can use.