Templates / Extract and validate Gmail invoice PDFs into Google Sheets with OpenAI

Extract and validate Gmail invoice PDFs into Google Sheets with OpenAI

Ready for 3.0

by Jessy Mariau ✓ · 42 views · created 2026-08-23 · 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 9 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI Chat Model and Google Sheets.

How it runs

Trigger: On Gmail events.

  1. Only PDF Attachments (Filter): keeps only the items that match a condition
  2. PDF To Text (Extract from File): extracts data from a file (pdf)
  3. Read The Invoice (Information Extractor): extracts structured fields from text with AI, with model: Extraction Model
  4. Validate Before Booking (Code): runs custom JavaScript code
  5. Did It Reconcile? (If): checks a condition and branches into true / false
  6. Append To Books (Google Sheets): append
  7. Send To Exceptions Queue (Google Sheets): append

Services it uses

GmailOpenAI Chat ModelGoogle Sheets

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.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (New Invoice Email).

Nodes used (8)

From the author

Quick overview This workflow watches a Gmail label for invoice emails with PDF attachments, extracts the PDF text, uses OpenAI to pull structured invoice fields, validates totals and VAT logic, and then appends clean invoices to an Invoices tab in Google…

Excerpt from Jessy Mariau'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.