Validate incoming XRechnung invoices from IMAP and archive them with Data Tables
Ready for 3.0What this workflow does
This workflow has 20 nodes and runs when a new email arrives over IMAP. It uses only n8n's built-in nodes.
How it runs
Trigger: When a new email arrives over IMAP.
- Set Configuration (Edit Fields (Set)): sets 3 fields: notificationAddress, senderAddress, autoReplyEnabled
- Find XML Attachment (Code): runs custom JavaScript code
- Has XML Attachment? (If): checks a condition and branches into true / false
- Extract XML Text (Extract from File): extracts data from a file (text)
- Convert XML to JSON (XML): converts between XML and JSON
- Parse XRechnung Fields (Code): runs custom JavaScript code
- Capture Processing Error (Code): runs custom JavaScript code
- Validate Invoice (EN 16931) (Code): runs custom JavaScript code
- Notify Unreadable File (Send Email): sends an email over SMTP
- Validation Passed? (If): checks a condition and branches into true / false
…plus 8 more steps. See the full node list below.
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (10)
- Code
n8n-nodes-base.code - Edit Fields (Set)
n8n-nodes-base.set - No Operation, do nothing
n8n-nodes-base.noOp - Email Trigger (IMAP)
n8n-nodes-base.emailReadImap - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - XML
n8n-nodes-base.xml - Read/Write Files from Disk
n8n-nodes-base.readWriteFile - Send Email
n8n-nodes-base.emailSend - Data table
n8n-nodes-base.dataTable
From the author
Quick overview This workflow reads incoming invoice emails via IMAP, detects and parses XRechnung (UBL) XML attachments, validates required fields and totals, archives the XML to disk, logs key values to an n8n Data Table, and sends email notifications to…