Register and validate XRechnung and ZUGFeRD invoices with Gmail and Sheets
Ready for 3.0What this workflow does
This AI workflow has 35 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail, Google Sheets, Google Drive and OpenAI Chat Model.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Read invoice attachments (Code): runs custom JavaScript code
- Describe the failure (Code): runs custom JavaScript code
- Invoice file found? (If): checks a condition and branches into true / false
- Email failure alert (Gmail): uses Gmail
- Set validation settings (Edit Fields (Set)): sets 10 fields: amount_tolerance, require_buyer_reference, send_error_reply…
- Check EN 16931 core rules (Code): runs custom JavaScript code
- Read supplier list (Google Sheets): uses Google Sheets
- Check supplier and bank details (Code): runs custom JavaScript code
- Read invoice log (Google Sheets): uses Google Sheets
- Find duplicates (Code): runs custom JavaScript code
…plus 21 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
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.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (New invoice email).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (12)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - Google Drive
n8n-nodes-base.googleDrive - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Error Trigger
n8n-nodes-base.errorTrigger
From the author
Quick overview Logs incoming e-invoices from Gmail in a Google Sheets register with duplicate tracking. Checks core EN 16931 rules, main XRechnung BR-DE rules and Leitweg-ID warnings. Reads UBL, CII and ZUGFeRD PDFs without external e-invoice APIs. A…