Templates / Match supplier invoices to purchase orders with Gmail, OpenAI, and Data Tables

Match supplier invoices to purchase orders with Gmail, OpenAI, and Data Tables

Ready for 3.0

by Daniel Shashko ✓ · 37 views · created 2026-08-31 · Invoice Processing, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 19 nodes and runs on Gmail events. Along the way it connects Gmail and OpenAI Chat Model.

How it runs

Trigger: On Gmail events.

  1. Settings (Edit Fields (Set)): sets 3 fields: tolerance_percent, tolerance_amount, supplier_label
  2. Keep Only The PDFs (Code): runs custom JavaScript code
  3. Is There An Invoice Attached? (If): checks a condition and branches into true / false
  4. Read The PDF (Extract from File): extracts data from a file (pdf)
  5. Pull Out The Invoice Fields (Information Extractor): extracts structured fields from text with AI, with model: Model
  6. Parse The Money (Code): runs custom JavaScript code
  7. Read The Open Purchase Orders (Data table): get
  8. Everything In Hand (Merge): merges the data from its input branches
  9. Read The Invoices You Have Seen (Data table): get
  10. Match It Against A Purchase Order (Code): runs custom JavaScript code

…plus 6 more steps. See the full node list below.

Services it uses

GmailOpenAI Chat Model

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (13)

From the author

Quick overview This workflow monitors a Gmail label for unread supplier invoice emails, extracts key fields from PDF attachments with OpenAI, matches invoices against n8n Data Tables of open purchase orders and previously seen invoices, then logs cleared…

Excerpt from Daniel Shashko's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.