Skip to content

Invoice Approval Workflow

An n8n workflow that picks invoices up from Gmail and Google Drive, extracts them with a multimodal LLM, asks a human to approve, and writes clean rows to PostgreSQL.

Year
2026
Role
Solo: workflow design, schemas, integration
Status
Shipped
Context
Product
Automation · n8n · Human-in-the-loop2026

Results

  • 85%

    shorter processing cycle

    Compared with manual invoice handling

  • 99.8%

    structural insertion accuracy

    Rows written to PostgreSQL

Gmail and Google Drive webhooks pick up incoming PDF invoices. A multimodal LLM extracts them against strict JSON schemas, so the output is structured before anything downstream sees it.

Every extraction then goes to a human through an n8n Form for approval, and a vector-storage risk assessment flags anything that looks unusual before it is written to PostgreSQL.

The result is a processing cycle 85% shorter than the manual one, with 99.8% structural accuracy on database inserts.

I also published an open-source accounts-payable version under MIT. It watches a Gmail AP inbox and archives originals to Google Drive, runs Mistral Document AI OCR into Markdown, and extracts with Gemini 2.5 Pro at temperature 0 against a strict schema covering vendor, tax ID, line items, totals and a GL category. Validation reconciles line items to totals and checks confidence; duplicates are blocked, exceptions are emailed to AP, high-value invoices go to Slack for one-tap approval, and clean ones are upserted into a Google Sheets ledger. Invoice text is treated as untrusted, so instructions hidden in a document are ignored.