AI Invoice Intake & Approval
A production-style n8n pipeline (v4): Mistral OCR extracts invoices (including scans), business rules validate them, every run lands in an audit trail keyed by uid, and humans approve only what matters.
A production-style n8n pipeline (v4): Mistral OCR extracts invoices (including scans), business rules validate them, every run lands in an audit trail keyed by uid, and humans approve only what matters.
// the pipeline, end to end
Finance teams processing 50+ invoices a month lose 8–12 hours a week opening emails, re-typing vendor names and totals into spreadsheets, and chasing managers for sign-off. And real invoices are messy: scans, phone photos, layouts that change vendor to vendor.
A Gmail trigger watches the intake inbox; a has-PDF gate skips anything without an attachment. The document is prepared for OCR, then one call to Mistral’s /v1/ocr with a document-annotation JSON schema (so the API itself guarantees the output shape), and the annotations are parsed into vendor, invoice number, dates, totals, terms; null when genuinely missing, never guessed.
A Code node validates and applies the business rules (required fields, subtotal + tax ≈ total, ≥ $1,000 needs a human). Every invoice is appended to a Google Sheets audit trail before any routing happens, then a needs-human-approval gate sends either a request-approval email to the manager or an auto-approval notice back to the sender. Failed extractions degrade gracefully to human review.
The v4 revision exists for one reason: auditability. Every invoice the audit harness sends carries a uid in the email subject; the workflow carries that uid through to the audit trail and dedupes on it, so re-runs can’t double-count. The result is an audit trail that can be joined row-for-row against a ground-truth register, which is exactly what the Invoice Pipeline Audit Harness does.
Recent activity · last 5 runs
sample rows · connect the status webhook to go live| run | vendor | amount | latency | route |
|---|---|---|---|---|
| #e3f1a02 | Northwind Traders | $842.10 | 41 s | auto-approved |
| #e3f19c7 | Globex Supply Co | $3,180.00 | 47 s | needs approval |
| #e3f1985 | Initech Office | $128.55 | 38 s | auto-approved |
| #e3f1971 | Umbrella Logistics | $1,540.75 | 52 s | needs approval |
| #e3f195f | Acme Print Co | · | 44 s | sent to human |
↳ A flagged extraction (math mismatch) is sent to a human rather than guessed; the pipeline degrades gracefully on purpose.