Automation library · Money admin

Validate incoming XRechnung invoices from IMAP and archive them

Started by an arriving email, and works across Email and n8n data table. 20 steps, 3 branches: a working afternoon to understand properly.

Medium

20 stepsMedium: a working afternoon
3Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Logic 12Service 8

The steps in the order they run, from what starts it.

  1. 1Fetch Emails (IMAP)Email Read ImapService
  2. 2Set ConfigurationSetLogic
  3. 3Find XML AttachmentCodeLogic
  4. 4Has XML Attachment?IfLogic
  5. 5Extract XML TextExtract From FileService
  6. 6No Invoice - IgnoreNo OpLogic
  7. 7Convert XML to JSONXmlLogic
  8. 8Parse XRechnung FieldsCodeLogic
  9. 9Capture Processing ErrorCodeLogic
  10. 10Validate Invoice (EN 16931)CodeLogic
  11. 11Notify Unreadable FileEmail SendService
  12. 12Validation Passed?IfLogic
  13. 13Attach File (Valid)CodeLogic
  14. 14Attach File (Invalid)CodeLogic
  15. 15Save Valid InvoiceRead Write FileService
  16. 16Save Invalid InvoiceRead Write FileService
  17. 17Log To Data TableData TableService
  18. 18Notify AccountingEmail SendService
  19. 19Auto-Reply Enabled?IfLogic
  20. 20Email Sender For CorrectionEmail SendService

How it's built

Starts on
An arriving email
Steps
20, with 3 branches
Size
Medium: a working afternoon
Connects to
Email, n8n data table
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own Email account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an arriving email.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Plan an afternoon. 20 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 20 steps before you point it at anything that matters.