n8n Gmail Invoice Matching: OpenAI PDF OCR + Data Table PO Match
n8n Gmail Invoice Matching: OpenAI PDF OCR + Data Table PO Match
Regular price
£53.99
Regular price
£53.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Gmail Invoice Matching: OpenAI PDF OCR + Data Table PO Match
Regular price
£53.99
Regular price
£53.99
Sale price
Unit price
/
per
Automatically match Gmail PDF invoices to your open PO records—using OpenAI OCR + data-table PO matching
This n8n workflow watches a Gmail label for unread supplier invoice emails, extracts invoice details from PDF attachments with OpenAI, matches them against open purchase orders in n8n Data Tables, and then logs results—or drafts a Gmail reply when validation fails.
What this workflow does
- Polls Gmail every 10 minutes for unread messages in your configured invoice label and downloads all attachments.
- Processes only PDF invoices: filters attachments to PDFs and stops if no PDF invoice is found.
- Extracts invoice fields with OpenAI PDF OCR, pulling out key data such as invoice number, vendor, PO reference, currency, total, and line items.
- Normalizes values by converting printed money formats into numeric amounts.
- Loads matching context from n8n Data Tables: retrieves open purchase orders and previously seen invoices.
- Matches invoices to purchase orders by PO number or—when needed—by vendor and closest amount.
- Validates correctness by checking duplicates, currency mismatches, tolerance breaches, and whether totals align with line items.
-
Clears or escalates:
- When valid, logs the invoice into invoices_seen with a cleared status.
- When held, uses OpenAI to draft a short supplier query, logs the issue, and creates a Gmail draft reply in the original email thread.
Use cases
- AP teams processing supplier invoices from email: auto-match PDFs to PO data and prevent duplicate processing.
- SaaS operators centralizing invoice approval: keep a controlled audit trail in invoices_seen.
- Automation engineers reducing manual invoice triage by drafting supplier follow-ups for mismatches.
Technical details
- n8n workflow nodes: if, set, code, no op, gmail, merge.
- Integrations/tech: Gmail (label-based trigger + draft replies), OpenAI (PDF text extraction + query drafting), and n8n Data Tables (open POs + invoices_seen).
