Parse E-Invoices from Email to Sheets
Automatically extract structured invoice data from email attachments and log to Google Sheets. No OCR needed — 100% accurate parsing.
How This Workflow Works

- 1
Searches Gmail for emails with PDF or XML attachments
- 2
Extracts PDF/XML attachments from each email
- 3
Auto-detects the invoice format (XRechnung or ZUGFeRD)
- 4
Parses the e-invoice into structured JSON with 30+ fields
- 5
Transforms the data into a flat row format
- 6
Appends to Google Sheets for tracking, reporting, or accounting
Why This Matters
Unlike OCR-based solutions (90-95% accuracy), this workflow delivers 100% accurate data extraction from structured e-invoices — instantly, without LLM token costs, and with just one API key.
Google Sheets Structure
| Column | Type | Example | Description |
|---|---|---|---|
invoiceNumber | Text | RE-2025-001 | Invoice number |
invoiceDate | Date | 2025-01-15 | Invoice issue date |
dueDate | Date | 2025-02-15 | Payment due date |
sellerName | Text | Lieferant GmbH | Seller company name |
sellerVatId | Text | DE123456789 | Seller VAT ID |
buyerName | Text | Kunde AG | Buyer company name |
buyerVatId | Text | DE987654321 | Buyer VAT ID |
subtotal | Number | 1500.00 | Net total amount |
totalVat | Number | 285.00 | Total VAT amount |
total | Number | 1785.00 | Gross total amount |
currency | Text | EUR | Currency code |
sourceFormat | Text | xrechnung | Detected e-invoice format |
emailSubject | Text | Invoice RE-2025-001 | Subject of the source email |
processedAt | Date | 2025-01-15T14:30:00Z | Processing timestamp |
Setup Steps
- 1
Install the n8n-nodes-invoice-api-xhub community node
- 2
Create an API key at invoice-api.xhub.io
- 3
Configure credentials: invoice-api.xhub, Gmail (OAuth2), Google Sheets (OAuth2)
- 4
Create a Google Sheet with 'Invoices' tab and column headers
- 5
Enter your spreadsheet ID in the 'Google Sheets: Append' node
- 6
Click 'Execute Workflow' to process existing emails
Preview (truncated)
1{2 "name": "Parse E-Invoices from Gmail to Google Sheets",3 "nodes": [4 {5 "id": "manual-trigger-parse",6 "name": "Manual Trigger",7 "type": "n8n-nodes-base.manualTrigger",8 "typeVersion": 1,9 "position": [400, 600],10 "parameters": {}11 },12 {13 "id": "gmail-search-parse",14 "name": "Gmail: Search Emails",15 "type": "n8n-nodes-base.gmail",16 "typeVersion": 2.2,17 "position": [640, 600],18 "parameters": {19 "operation": "getAll",20 "simple": false,21 "filters": {22 "q": "=has:attachment filename:pdf OR filename:xml"23 },24 "options": {25 "dataPropertyAttachmentsPrefixName": "attachment_",26 "downloadAttachments": true27 }28 },29 "credentials": {30 "gmailOAuth2": {31 // ... (truncated)Use Cases
Accounts Payable
Automatically log incoming XRechnung/ZUGFeRD invoices from suppliers
Bookkeeping
Extract invoice data for DATEV or other accounting software import
E-Invoice Mandate 2025
Process incoming e-invoices as required by the German mandate
Audit Trail
Searchable spreadsheet of all received e-invoices