Initial challenge
The client received purchase orders by email from a trusted sender. Every document required manual processing:
- Download PO PDF
- Extract values manually
- Create invoice in banking/accounting system
- Download invoice PDF
- Upload to cloud storage
- Prepare response email with attachment
- Archive references internally
The process was repetitive and error-prone.
Implemented workflow
1. Email monitoring
- Monitored inbox for trusted senders
- Filtered by subject patterns
- Blocked unauthorized sender execution
2. PDF extraction and validation
Extracted:
- Purchase order number
- Net, tax, and gross totals
- Currency
- Buyer tax ID
Validation included tax and amount consistency checks.
3. Client lookup
- Queried client data source
- Retrieved legal and tax data used in invoice generation
4. Invoice creation via API
- Generated invoice through banking/accounting API
- Applied issue date, service date, payment deadline, and VAT mapping rules
- Downloaded generated invoice PDF
5. Cloud document storage
- Stored invoice file in a year/month folder structure
- Created missing folders automatically
6. Email draft preparation
- Created draft email with invoice attached
- Left final send decision to operator review
Technology
- n8n automation runtime
- Gmail API
- Banking/accounting REST API
- Google Drive API
- Firestore data source
- JavaScript transformation nodes
Results
- End-to-end process time reduced to under 30 seconds per invoice
- Manual copy/paste errors removed
- Validation checks reduced financial risk
- Workflow can scale to higher invoice volumes without headcount growth