Templates / Process and forecast AP invoices from Gmail with OpenAI and Google Sheets

Process and forecast AP invoices from Gmail with OpenAI and Google Sheets

Ready for 3.0

by Jeffy Thomas ✓ · 12 views · created 2026-09-08 · 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 15 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail, OpenAI Chat Model and Google Sheets.

How it runs

Trigger: On Gmail events (plus 1 other trigger).

  1. Extract Text from PDF Invoice (Extract from File): extracts data from a file (pdf)
  2. Read All Invoices (Google Sheets): uses Google Sheets
  3. AI Extract & Categorize Invoice (Information Extractor): extracts structured fields from text with AI, with model: OpenAI GPT-5 Invoice Analysis
  4. Build Weekly Digest (Code): runs custom JavaScript code
  5. Prepare & Prioritize (Edit Fields (Set)): sets 12 fields: vendor, invoice_number, invoice_date…
  6. Email Weekly AP Digest (Gmail): uses Gmail
  7. Append Invoice to Google Sheets (Google Sheets): append
  8. Read Logged Invoices (Google Sheets): uses Google Sheets
  9. Calculate Cash Flow (Code): runs custom JavaScript code
  10. High-Value Invoice? (If): checks a condition and branches into true / false

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

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.

Nodes used (10)

From the author

Quick overview This workflow watches Gmail for unread invoice emails with PDF attachments, extracts invoice details with OpenAI, logs them to Google Sheets, calculates month-to-date and upcoming cash needs, and sends Gmail alerts for high-value invoices plus…

Excerpt from Jeffy Thomas'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.