A 15-node workflow for automated receipt processing: Email → OCR → AI classification → client matching → Google Drive routing → Sheet journaling. Uses Claude Haiku 4.5 (~$0.001 per receipt).
Use-case: Clients email PDF receipts to your accounting firm. The workflow extracts the PDF text, classifies it with Claude (invoice / payroll / receipt / etc.), automatically matches the right client, files the PDF into the correct Drive folder, and logs the result in a journal Sheet. Low-confidence cases land in a _Unzugeordnet ("unassigned") folder for human review.
Public template — initial release 2026-05-11 by Swiss Shift (Basel, Switzerland).
Note: the workflow's internal node names are in German because it was built for Swiss accounting firms. The structure and logic are language-agnostic. Setup instructions below are in English.
- n8n self-hosted or Cloud (Docker, Hetzner, any VPS works)
- Gmail account for incoming receipts (with OAuth2 credential in n8n)
- Anthropic API key for Claude Haiku 4.5 (~$0.001 per receipt — cheap enough that 1000 receipts/month costs $1-2)
- Google Drive + Google Sheets with OAuth2 credentials
- Three subfolders per client in Drive:
Rechnungen(invoices),Lohnabrechnungen(payroll),Quittungen(receipts) — name them whatever fits your filing structure, just match it in the code-node - One
_Unzugeordnetfolder for low-confidence cases - One journal Sheet with columns: Date / Client / DocType / Sender / Amount / Confidence / Owner
- Import: In n8n → Workflows → Import from File →
beleg-workflow-treuhand-template.json - Assign credentials: Each node with
YOUR_*_CREDENTIAL_IDneeds your own credential (Gmail, Anthropic, Google Drive, Google Sheets). - Configure clients in the
🔍 Mandant zuordnen("Match client") code-node — fill themandantenarray:{ name: 'Acme AG', // Display name aliases: ['Acme AG', 'Bahnhofstrasse 5'], // Match strings (company name + addresses) ordner: 'Acme AG', // Drive folder name sb: 'Anna Gerber', // Owner / case manager email: 'anna@your-firm.ch', folders: { Rechnungen: 'DRIVE_FOLDER_ID_HERE', Lohnabrechnungen: 'DRIVE_FOLDER_ID_HERE', Quittungen: 'DRIVE_FOLDER_ID_HERE' } }
- Set
UNZUGEORDNET_IDin the same node to your_Unzugeordnetfolder ID. - Set the Sheet ID in the
📊 Belegjournalnode to your own journal sheet. - Gmail filter: configure so only receipt-relevant emails trigger the workflow (label or search query in the Gmail trigger).
📧 Email Eingang (Gmail trigger)
↓
📥 Attachment laden (load attachment)
↓
📤 In Unverarbeitet ablegen (Drive buffer — nothing lost on downstream failure)
↓
📄 PDF Text extrahieren (extract PDF text)
↓
🔧 AI Request vorbereiten (prompt building)
↓
🤖 AI Klassifikation (Claude → structured JSON)
↓
🔍 Mandant zuordnen (fuzzy match against alias list)
↓
✅ Mandant erkannt? (client matched?)
├─ Yes → 📁 Move to client folder + 📊 Log in Journal
└─ No → 🚨 Move to _Unzugeordnet + 📊 Log (confidence=0)
↓
🔗 Binary wiederherstellen (rebuild binary attachment)
↓
✔️ Als gelesen markieren (mark email as read)
- Different accounting software (bexio / Abacus / Banana / Xero / QuickBooks): replace the
📁 In Mandantenordnerstep with a direct API call into your accounting system. bexio has a REST API for receipt creation, Abacus too. The template stops at "PDF in Drive folder + Sheet row" — the booking-API integration is the next layer and software-specific. - Stronger AI model: swap Claude Haiku 4.5 for Sonnet 4.6 if you process complex or handwritten receipts. ~5x more expensive but better accuracy on edge cases.
- Confidence thresholding: in the
🔍 Mandant zuordnencode-node, checkai.konfidenz > 0.85and otherwise route directly to_Unzugeordnet. Catches edge cases without wrong postings. - Multi-language clients: the matcher aliases support DE / FR / IT / EN — useful for Switzerland where addresses often come in multiple languages.
For 200 receipts/month × 5 clients = 1,000 receipts/month:
| Component | Monthly cost |
|---|---|
| Claude Haiku 4.5 | $1-2 |
| n8n self-hosted (Hetzner ARM) | CHF 4 |
| Google Workspace (Drive + Sheets) | already paid |
| Total | ~CHF 8-10 for a 5-client accounting firm |
- Multi-page invoices with line-items across pages — n8n's PDF extraction sometimes splits these. Workaround: add concatenation logic in the
📄 PDF Text extrahierennode. - Handwritten receipts (rare long tail) — OCR accuracy drops to ~60%. The workflow logs these with confidence=0 and routes them to manual review.
- Cross-border receipts (CH recipient, DE/AT sender with EUR amounts) — the workflow detects currency in the classification prompt, but the booking-API call needs separate VAT-handling logic (not included in this template).
MIT License. Use at your own risk. We run this in production for our own use-case, but every accounting setup is different — test with 10-20 receipts before scaling to 200/month.
swiss-shift.ch · info@swiss-shift.ch · We build workflow automation for Swiss SMBs. If this template helps and you want custom adaptations (bexio integration, multi-tenant version, confidence-feedback-loop), get in touch.
Changelog:
- 2026-05-11: Initial public release. Anonymized + sanitized from production workflow.