// the pipeline, end to end

  1. 01
    Read
    Gmail trigger · has-PDF gate
  2. 02
    Extract
    Mistral /v1/ocr · parsed annotations
  3. 03
    Validate
    business rules · uid join + dedupe
  4. 04
    Route
    audit trail first · approval email or auto-notice

The problem

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.

The pipeline

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.

v4: built to be measured

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
runvendoramountlatencyroute
#e3f1a02Northwind Traders$842.1041 sauto-approved
#e3f19c7Globex Supply Co$3,180.0047 sneeds approval
#e3f1985Initech Office$128.5538 sauto-approved
#e3f1971Umbrella Logistics$1,540.7552 sneeds approval
#e3f195fAcme Print Co·44 ssent to human

↳ A flagged extraction (math mismatch) is sent to a human rather than guessed; the pipeline degrades gracefully on purpose.