Steps
Turn on Download Attachments
In the Email Trigger (IMAP) node, keep Format on Simple and switch on Download Attachments. It is off by default, and without it no file reaches the next node.
Find the field name
Run it once and open the output's Binary tab. The first file is
attachment_0, the nextattachment_1, unless you changed Property Prefix Name.Point the next node at it
Set Input Binary Field (Extract from File, Write Files, Drive upload, HTTP Request) to
attachment_0instead ofdata.Split when there can be several files
Emails can carry several files, or none, and several emails can arrive in one run. Use the Code node below to make one item per attachment under
data.Re-test with an unread email
The trigger only fetches unread emails and marks them read. Mark your test email unread again, or send a new one.
What we saw in 12 real runs
On 22 October 2026 we ran n8n 2.43.7 with the Email Trigger (IMAP) node, version 2.1, against our own IMAP server (Dovecot 2.4) and dropped test emails with CSV attachments into 8 folders, one workflow per folder. The next node was Extract from File (CSV). Each row is what n8n really did.
| What we did | What n8n showed | Fix |
|---|---|---|
Email Trigger with Download Attachments off, then Extract from File (CSV) on data | This operation expects the node's input data to contain a binary file 'data', but none was found [item 0]. The email item had no binary at all. | Turn on Download Attachments in the Email Trigger. It is off by default and only shows when Format is Simple. |
Download Attachments on, next node still reads data | The item has no binary field 'data' [item 0]. The file was there, as attachment_0 (order2.csv). | Set Input Binary Field in the next node to attachment_0. That run then extracted both CSV rows. |
Next node set to attachment_0 | Worked: 2 rows per CSV. | This is the setting most workflows need. |
Email with two CSV files, next node on attachment_0 | Only the first file is read; the second sits in attachment_1. | Split the attachments into one item each with the Code node below. Our run turned 1 email into 2 items and 4 CSV rows. |
| Email where a picture comes before the CSV | attachment_0 was the picture (pic.png), the CSV was attachment_1. | The number follows the order inside the email, not the file type. Split first, then filter on fileName. |
Option Property Prefix Name set to file_ | The file came out as file_0, and a node on attachment_0 failed with The item has no binary field 'attachment_0' [item 0]. | Use the prefix you set plus the number: file_0. |
| Format Resolved instead of Simple | No Download Attachments switch, but the file still came out as attachment_0 and the CSV extracted. | Fine to use; the JSON layout changes (headers become an object), so check your later expressions. |
Two new emails at once, one without an attachment, next node on data | One execution with 2 items; the whole run failed on the first item. | n8n can hand you several emails in one run. Split attachments with the Code node (an email with no file simply gives 0 items) or add an IF node. |
Email with no attachment, next node on attachment_0 | ...a binary file 'attachment_0', but none was found [item 0] | Same fix: the Code split, or an IF that checks the email has a file. |
| An unread email that was already in the folder before we published the workflow | Not picked up at activation, but it came in together with the next new email. | Old unread mail can show up later. Mark it read first, or tighten Custom Email Rules, for example ["UNSEEN", ["SINCE", "22-Oct-2026"]]. |
| An email that was already marked read | Never triggered. After each run n8n also marked the new emails as read. | The default rule is ["UNSEEN"] and Action is Mark as Read. To re-test, mark the email unread again. |
| Wrong password / SSL on a port without SSL | Publishing failed with There was a problem activating the workflow: "Command failed", and with SSL on port 1143: ...SSL routines:tls_validate_record_header:wrong version number. | "Command failed" was our wrong password: check the user and app password. "wrong version number" means SSL/TLS is on but the port is plain IMAP: use 993 with SSL on, or turn SSL off. |
Why it says attachment_0 and not data
Most file nodes in n8n (Extract from File, Write Files to Disk, Google Drive upload, HTTP Request with a file) read the binary field data by default. The Email Trigger (IMAP) node writes each attachment as attachment_0, attachment_1 and so on. So the default setup fails until you change one side. Two different messages tell you which case you are in:
...binary file 'data', but none was found: the item has no file at all. Download Attachments is off, or the email had none.The item has no binary field 'data': the file is there under another name. Open the trigger output, look at the Binary tab, and use that name.
Handle any number of attachments
This Code node turns each attachment into its own item with the file under data, so the next node works with its default settings. We ran it on an email with two CSV files (2 items out) and on one with none (0 items out, the run ends quietly):
// Code node, "Run Once for All Items": one item per attachment, each as binary 'data'
const out = [];
for (const item of $input.all()) {
for (const key of Object.keys(item.binary ?? {})) {
out.push({
json: { fileName: item.binary[key].fileName, subject: item.json.subject },
binary: { data: item.binary[key] },
});
}
}
return out;To keep only some files, put an IF or Filter node after it on {{ $json.fileName }}, for example ends with .csv or .pdf. We did not run that filter step itself.
Good to know
- Using the Gmail Trigger instead? Its attachments need Simplify off: n8n Gmail Trigger not working.
- Attachment is a CSV or XLSX? Set Extract From File's Input Binary Field to
attachment_0. Delimiter, BOM and encoding pitfalls are in n8n Extract From File (CSV) not working. - For other "none was found" cases (Edit Fields dropping files, Code nodes, Read/Write Files), see n8n binary data not found.
- Prefer a script to n8n? Save email attachments to a folder automatically comes with a free, tested agent (an n8n workflow plus a Python script).
- Gmail and Outlook usually need an app password (or OAuth2) for IMAP; a normal password often fails at publish time.
What we didn't test
- Gmail, Outlook and other real providers, OAuth2 login, very large attachments, and inline images embedded in HTML. Our server was a local Dovecot without TLS.
- The older Email Trigger versions 1 and 2.0; we used 2.1 in n8n 2.43.7.
Start from a working agent
FAQ
Why does n8n say "binary file 'data', but none was found" after the Email Trigger (IMAP)?
Either Download Attachments is off (it is off by default) or the email had no attachment. In our test, turning Download Attachments on gave the file as attachment_0.
What is attachment_0 in n8n?
It is the binary field where the Email Trigger (IMAP) node puts the first attachment of an email; the second is attachment_1. Set the next node's Input Binary Field to attachment_0, or change the prefix with Property Prefix Name.
How do I process every attachment of an email in n8n?
Split them with a Code node that outputs one item per key in item.binary, each as binary 'data'. In our run one email with two CSV files became two items and every row was extracted.
Why doesn't my n8n Email Trigger fire for some emails?
By default it only fetches unread emails and marks them read after each run. In our tests an email that was already read never triggered, and an old unread one came in with the next new email.
What does "Command failed" mean when activating an n8n IMAP trigger?
In our test it was a wrong password: n8n could not log in to the IMAP server, so publishing the workflow failed. Check the user name and use an app password if your provider needs one.
Related guides
- n8n binary data not found? Fix 'none was found' and 'no binary field', 25 tests
- n8n Extract From File (CSV) not working: delimiter, BOM, encoding and errors, 32 runs
- n8n Send Email (SMTP) errors: timeouts, 535 Invalid login and SSL fixes, 37 runs
- n8n Compression node not working: zip, unzip, file_0 and invalid zip data, 42 runs
- n8n static data not saving? 35 runs, every cause found
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes