Invoice Processing Workflow
Workflow DemonstrationEmail inbox โ OCR โ field extraction โ validation โ human approval โ accounting export โ report
Press Run and watch the workflow execute against sample data. Steps that need a person will stop and wait for you.
Supplier invoices arrive as PDFs and photos across several mailboxes. Someone opens each one, retypes the supplier, number, date, VAT and total into a spreadsheet or the accounting system, then chases approvals over chat. The work is invisible until something is paid twice or a deadline is missed.
Mailbox โ manual download โ manual retyping โ ad-hoc chat approval โ manual entry into accounting โ month-end reconciliation from memory.
A watched inbox feeds an extraction pipeline. OCR plus an LLM pull the fields into a strict schema, deterministic code validates them, and anything uncertain or above a threshold goes to a human approval queue before it is exported. Nothing reaches the accounting system unapproved.
- Trigger โ IMAP/Gmail watcher on a dedicated inbox, attachment filter by MIME type and size
- Extract โ OCR for scans and photos โ LLM extraction into a fixed JSON schema (supplier, VAT ID, invoice number, dates, currency, net, VAT, total, line items)
- Validate โ Deterministic checks in code, not in the model: arithmetic, VAT-ID format, duplicate invoice number per supplier, due date sanity, currency allow-list
- Route โ Confidence score and amount threshold decide auto-pass vs. human approval queue
- Approve โ Approval message with the parsed fields and a link to the original file; approve / correct / reject
- Export โ Approved records appended to the accounting export (Sheets/CSV/API) with the source file reference
- Report โ Daily digest: processed, held for review, rejected, duplicates caught
Reads unstructured documents and proposes structured fields. Classifies document type. Flags low-confidence extractions. It never decides that an invoice is payable.
Approves or corrects every record above the configured threshold, and every low-confidence one. Owns the chart of accounts, VAT treatment and the decision to pay. Final financial and accounting decisions remain under human control.
Per-step retries with exponential backoff on transient API failures. Poison-message queue: a document that fails three times is parked with the raw payload and the error, never silently dropped. Arithmetic and duplicate failures always route to a human rather than being auto-corrected. Every run writes a structured log line with the document id.
Least-privilege API credentials held in the automation platform, never in a frontend. Originals stay in the client's own storage. Only extracted fields, not full documents, are sent to the model, and PII fields can be masked before extraction. Access to the approval queue is role-based. Full audit trail of who approved what and when.
n8n ยท IMAP or Gmail API ยท OCR service ยท OpenAI/Anthropic API ยท Google Sheets or accounting-system API ยท Slack or email for approvals ยท object storage for originals
This is a reference implementation. No client data was used and no performance figures are claimed.