Convert to File
Turns any value into a file with a name and content type, ready to store with the File step or send as an HTTP request body or form field. To make an Excel workbook (.xlsx) from items, use Spreadsheet File.
Properties
| Property | Required | Description |
|---|---|---|
| Data | Yes | The content. Supports expressions |
| File name | Yes | File name including extension, e.g. report.json. Supports expressions |
| Content type | Yes | MIME type, e.g. application/json, text/csv. If left empty, application/octet-stream is used |
Behaviour
| Data | File content |
|---|---|
| Text | The text as written |
A list (or one object) with a CSV content type (text/csv) or a .csv file name | CSV: a header line with the column names, one line per item (see below) |
A list with text/tab-separated-values or a .tsv file name | The same, separated by tabs |
A list with application/x-ndjson or a .jsonl / .ndjson file name | JSON Lines: one item per line |
| Any other object or array | The value serialised as JSON |
| A file already | The same bytes; only the name and content type change |
CSV
- The columns are every key that appears in the items, in the order they first appear. An item without a key leaves that cell empty.
- Values containing a comma, a quote, a line break, or spaces at the start or end are wrapped in quotes, with quotes doubled (the usual CSV rules, so Excel, Google Sheets and Parse CSV read them back exactly).
- Nested objects and lists are written as JSON text. Lines end with CRLF.
- If the items are lists themselves, each list is written as a row as it is, without a header.
Encoding
Files are UTF-8 without a byte order mark. Add a charset to the content type to change that:
| Content type | Encoding |
|---|---|
text/csv | UTF-8 |
text/csv; charset=utf-8-sig | UTF-8 with a byte order mark, so Excel shows accented letters correctly |
text/csv; charset=utf-16 | UTF-16 |
text/csv; charset=iso-8859-1 | Latin-1 |
Large files
Files up to 1 MB are part of the step's output. Larger ones are written to temporary storage and the output is a file reference instead, which every step that takes a file accepts. Use File → Store to keep it.
Output
A file. Use it wherever a step expects a file:
- File → Store, to keep it in a storage provider.
- HTTP Request → Body: Binary, or a Form Data field in file mode, to upload it to an API.
Example
Save an API response as a dated JSON file:
- HTTP Request fetches the data.
- Convert to File:
- Data:
{{ $nodes['HTTP Request'].responseBody }} - File name:
export-{{ $today.toFormat('yyyy-MM-dd') }}.json - Content type:
application/json
- Data:
- File with operation Store, File set to
{{ $nodes['Convert to File'] }}.
Notes
- To build CSV, pass the list of items and use the content type
text/csv(or a.csvfile name). Text you pass is written as it is. - Renaming a stored file this way doesn't copy it — the new name and type apply to the reference passed downstream.