Receiving e-invoices: the automatic inbox with n8n

How to build an automatic inbox with n8n that retrieves, recognizes, and forwards e-invoices.

Hand-drawn sketch: An envelope falling into an inbox tray

An automatic inbox for e-invoices independently retrieves incoming invoices from an email inbox, recognizes the format of the attached file, and triggers further filing or accounting processing without anyone having to open each email individually. Technically, IMAP access to an existing mailbox is sufficient for this, since an email inbox is considered a permitted receiving channel for electronic invoices. This article shows how this chain can be built in n8n. As of: August 2026.

Is a normal email inbox even sufficient as a receiving channel?

Yes, according to the FAQ on the e-invoicing obligation from the Bundessteuerberaterkammer an email inbox is a permitted transmission channel for electronic invoices, provided electronic further processing without a media break is possible, and it does not have to be a mailbox set up specifically for this purpose — an existing one is sufficient. This makes IMAP the obvious technical basis for an automatic inbox, since practically every common mail system supports this access.

How does n8n retrieve the invoices from the inbox?

The IMAP Email Trigger from n8n connects to a mailbox using a stored credential and continuously checks it for new messages. Several details can be configured here:

  • Mailbox: Which folder in the mailbox is monitored, such as the inbox or a dedicated subfolder for invoices.
  • Action after fetching: Whether a retrieved email is marked as read or left untouched, so that other systems can also process it.
  • Download attachments: A toggle that determines whether attachments such as PDF, XML, or ZUGFeRD files are loaded directly into the workflow as binary data.
  • Format: Simple, Resolved, or Raw, where Resolved is the most practical choice for further processing of attachments, since attachments are then available as binary data in the workflow.
  • Custom retrieval rules: Additional IMAP search criteria can be used to narrow down the mailbox specifically, for example by sender or subject line.

How does the workflow recognize whether a PDF or an XML invoice has arrived?

After retrieval, a downstream step first checks the file type and, for XML attachments, whether it is a pure XRechnung, a hybrid ZUGFeRD file with embedded XML, or another format. This branch determines the further path in the workflow: a structured invoice can be processed directly, while a plain PDF invoice without structured data requires an additional intermediate step, such as a manual check or text recognition, before it is transferred to accounting.

Where does the invoice go after format recognition?

After recognition, the workflow passes the file to the filing system, such as a structured folder or a document management system, and simultaneously triggers the transfer of the invoice data to the accounting software. Only at this point do the actual deadlines and format requirements of e-invoicing apply, which we cover in a separate article on the e-invoicing obligation — this article only covers the technical retrieval and forwarding. For clients who want to set up this inbox as a fixed component of their automation with us, NordFlux handles the connection to the mailbox, filing system, and accounting system.

Frequently asked questions about the automatic e-invoice inbox

Does the mailbox have to be set up exclusively for e-invoices?

No, an existing mailbox is sufficient as a receiving channel; a separate address is not legally required. In practice, however, a dedicated mailbox or a subfolder makes automation easier, since the IMAP trigger can then be configured more specifically.

What happens if an email contains both a PDF and an XML file?

In this case, the workflow should treat the structured XML file as authoritative and file the PDF only as a reading aid, which corresponds to the usual structure of hybrid formats such as ZUGFeRD. You set a fixed rule for which attachment takes precedence yourself when setting up format recognition in the workflow.

How often does n8n check the mailbox for new invoices?

The IMAP trigger responds to new messages continuously via the existing connection to the mail server; additionally, an option lets you set an interval in minutes for a forced reconnection, to catch unstable connections. For practical retrieval speed, this is sufficient for most mailboxes without further adjustment.

Does this inbox replace a DATEV or ERP-native e-invoicing module?

Not necessarily; it is primarily useful for companies whose accounting software does not include its own automatic e-invoice retrieval, or that need to connect multiple systems with different mailboxes. Where accounting software already offers a native solution, check on a case-by-case basis whether an additional n8n automation actually saves effort or just creates a second point of responsibility.

About NordFlux

NordFlux UG (haftungsbeschränkt)

NordFlux builds digital employees for organisations: automations and AI agents that take over repetitive work. You stay in control.

More about us
Free initial analysis

Concrete questions about automation or AI?

In a free initial analysis we discuss your case directly. No strings attached.