// guides · n8n error index

n8n Convert to File not working: empty CSV, lost fields and broken base64, 38 runs

Fix n8n Convert to File: fields gone after the node, an empty 4-byte CSV, all items in one file, the BOM in every CSV, big numbers as 1.23457E+19, sheet name and Text File errors, and corrupt base64 files with a green run. 38 real runs on n8n 2.43.7.

Updated 2026-10-24 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. Your other fields are gone: Convert to File outputs only the file

    In every run that produced a file (32 of them) the output item's JSON was empty, {}. Every input field (name, email, id) was dropped and only the binary file was left, with a green run. So a node after it that reads {{ $json.email }} gets nothing. Chaining two Convert to File nodes shows how bad it gets: a Convert to Text File followed by Convert to CSV gave a CSV of 4 bytes, just the BOM and a line break, still green, because the second node got {}. The first node's file was not in the final output either. Build the file as the last step of a branch, after everything that needs the fields. If you need the fields and the file on the same item, merge them back by position with a Merge node (we did not run this fix).

  2. All items go into one file, and File Name uses the first item

    Convert to CSV, XLSX, HTML and ODS put every input item into ONE file. Two items gave one File.csv with two data rows. The File Name option accepts expressions, but with all items in one file only the first item counts: {{ 'export-' + $json.id + '.csv' }} gave export-1.csv, never export-2. For JSON, the default writes one array to file.json; Mode Each Item to Separate File gave one file per item, but all of them were named file.json, so set a File Name if you save them. Format pretty-printed the JSON.

  3. Every CSV starts with a BOM

    Every CSV the node wrote began with the 3 bytes EF BB BF, a UTF-8 byte order mark, also with a semicolon delimiter and with Header Row off. Accents were written correctly in UTF-8 (Prénom Éléonore, Zürich €). The BOM helps spreadsheet apps detect UTF-8 (we did not open the files in Excel), but a strict parser sees the first header as \ufeffname, not name. Reading the file back with Extract From File gives that key: turn on Exclude Byte Order Mark (BOM) there, see n8n Extract From File (CSV) not working. Rename Keys will not match it either: n8n Rename Keys node not working.

  4. Nested objects and arrays become dot columns

    {"address":{"city":"Paris","zip":"75001"}} became the columns address.city and address.zip, and an array tags: ["a","b"] became tags.0 and tags.1, in CSV and in XLSX. Items with different keys did not lose data: the header was the union a,b,c,d and missing cells were left empty (same in node v1 and v1.1). Quoting was correct: a quote inside a value was doubled, a line break stayed inside quotes, and a;b was not quoted with the comma delimiter. If you want other column names or a flat structure, shape the items with Edit Fields before the node.

  5. Big numbers lose digits in CSV

    A JSON number 12345678901234567890 was written to the CSV as 1.23457E+19: the digits are gone for good. Other values: null and an empty string became empty cells, true became TRUE, 0 and 0.1 stayed as they were, the text 0042 kept its zeros and an ISO date string was written as text. In XLSX, numbers stayed number cells and strings stayed text cells, so 0042, +33612345678 and the string "12345678901234567890" were kept exactly, while the same value as a number was stored as 12345678901234567000. Send long ids, phone numbers and codes as strings. We did not run the string version through CSV.

  6. Sheet name errors in XLSX

    Sheet Name Report: 2026/10 failed with Sheet name cannot contain : \ / ? * [ ], and a name of 44 characters failed with Sheet name cannot exceed 31 chars. Use a short name without those characters, for example Report 2026-10. Left empty, the sheet is called Sheet and the file File.xlsx (about 16 kB for two rows).

  7. Convert to Text File: "is required" and "is not set"

    With Text Input Field left empty the workflow did not start: The 'Convert' node has issues: Parameter "Text Input Field" is required. With a field name that is not on the item (body when the text is in text) the node failed with The value in "body" is not set. Type the field name, not an expression with its value. A number (42) was written fine, accents and line breaks were kept, and the File Name option gave note.txt. An object field was written as JSON text {"a":1} in a .txt file with the MIME type application/json: use Convert to JSON if you want a JSON file.

  8. Move Base64 String to File: garbage files with a green run

    Valid base64 (aGVsbG8gd29ybGQ=) gave the right file, but named file with no extension and MIME type text/plain. Set the File Name and MIME Type options: a.png and image/png gave a file with a correct PNG header. The node never checks the input. Plain text (hello world) was decoded as if it were base64 and gave 7 bytes of garbage. A data URL like data:text/plain;base64,aGVsbG8gd29ybGQ= gave 15 garbage bytes in front of the real content, so the file was corrupt. Both runs were green. Strip the prefix first, for example with {{ $json.file.split(',')[1] }} in an Edit Fields node (we did not run this fix). A dot path such as body.file works in Base64 Input Field.

  9. The file is in the wrong binary field, or there is no file

    By default the file goes into the binary field data. With Put Output File in Field set to file, the CSV was stored under file, so a later node that reads data will not find it: use the same name in both nodes (see n8n binary data not found). With 0 input items the node output nothing: no empty file, and the next node never ran. Convert to ICS worked with ISO dates (event.ics, text/calendar), but a start of 24/10/2026 10:00 failed with an EMPTY error message, so if the error panel says nothing, check the date format first. Convert to HTML wrote a SheetJS table (title SheetJS Table Export), ODS gave an 8 kB file, and the CSV Compression option changed nothing in our run (same 42-byte file).

What we ran

On 24 October 2026 we ran 38 executions of the Convert to File node v1.1 (one on v1) on self-hosted n8n 2.43.7 with n8n execute: a Manual Trigger, a Code node with test items, the Convert to File node and a Code node that read the real file bytes with getBinaryDataBuffer. 33 runs succeeded and 5 failed. Every value below is copied from those runs.

SetupResult
CSV, 2 items (name, email, id)One File.csv (text/csv, 42 B) with a BOM; output JSON {}
CSV, nested address objectColumns address.city, address.zip
CSV, array tagsColumns tags.0, tags.1
CSV, items with keys a/b, a/c, b/d (v1.1)Header a,b,c,d, missing cells empty
Same on Convert to File v1Identical file
CSV, quote, line break and a;b in valuesQuote doubled, line break inside quotes, a;b unquoted
CSV, accents and €UTF-8 with a BOM, accents correct
CSV, Delimiter ;name;email;id, BOM still there
CSV, Header Row offNo header row, BOM still there
CSV, no File NameFile.csv
CSV, File Name {{ 'export-' + $json.id + '.csv' }}export-1.csv: first item only
CSV, null, true, 0, big number, 0.1, "0042", ISO date, ""empty, TRUE, 0, 1.23457E+19, 0.1, 0042, date text, empty
CSV, 0 input itemsNo output, next node not run
XLSX, 2 itemsFile.xlsx (16.1 kB), sheet Sheet, numbers as numbers
XLSX, "0042", string id, number id, phone, dateStrings kept as text; number id stored as 12345678901234567000
XLSX, Sheet Name Report: 2026/10Error Sheet name cannot contain : \ / ? * [ ]
XLSX, Sheet Name of 44 charactersError Sheet name cannot exceed 31 chars
XLSX, nested object and arrayColumns address.city, tags.0, tags.1
JSON, default (All Items to One File)One file.json with an array of 2 objects
JSON, Each Item to Separate File2 files, both named file.json
JSON, Format onPretty-printed array (128 B)
Text File, Text Input Field emptyWorkflow does not start: Parameter "Text Input Field" is required.
Text File, field body not on the itemError The value in "body" is not set
Text File, object field {a:1}file.txt containing {"a":1}, MIME type application/json
Text File, number 42file.txt containing 42
Text File, accents and line break, File Name note.txtCorrect UTF-8 note.txt
Base64, valid stringCorrect content, file named file, no extension, text/plain
Base64, plain text hello worldGreen run, 7 bytes of garbage
Base64, data URL with data:text/plain;base64, prefixGreen run, 15 garbage bytes before the content (26 B)
Base64, File Name a.png, MIME Type image/pnga.png, image/png, valid PNG header
Base64, field body.fileWorks (dot path)
CSV, Put Output File in Field fileFile stored under file, not data
HTML, 2 itemsFile.html, SheetJS table
ICS, ISO start and endevent.ics, text/calendar, correct DTSTART/DTEND
ICS, start 24/10/2026 10:00Error with an empty message
CSV, Compression onSame plain 42 B CSV
Text File into a field att, then Convert to CSV4-byte CSV (BOM and line break only); att file gone
ODS, 2 itemsFile.ods, 8 kB (content not inspected)

Quick checklist

Good to know

What we didn't test

FAQ

Why does n8n Convert to File remove my other fields?

The node outputs only the file: in all our runs the output JSON was {}. Build the file as the last step, or merge the original fields back by position with a Merge node.

Why is my n8n Convert to File CSV empty?

The node received items without fields, usually because an earlier Convert to File already dropped them. In our run the CSV was 4 bytes: a BOM and a line break. With 0 input items no file was made at all.

Why does my n8n CSV start with \ufeff or a strange character?

Convert to File writes a UTF-8 BOM at the start of every CSV. Spreadsheet apps use it to detect UTF-8; when you read the file back in n8n, turn on Exclude Byte Order Mark (BOM) in Extract From File.

Why does n8n Convert to File put all items in one file?

CSV, XLSX, HTML and ODS put all items in one file, and an expression in File Name uses the first item only. For JSON, set Mode to Each Item to Separate File.

Why is my base64 file corrupt after Move Base64 String to File?

The node decodes whatever it gets without checking. Plain text and a data: URL prefix both gave garbage bytes with a green run. Pass pure base64 and set File Name and MIME Type.

What does 'Sheet name cannot contain' mean in n8n?

The XLSX Sheet Name has one of : \ / ? * [ ] or is longer than 31 characters. Use a short name without those characters.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.