Templates / Extract invoice data from Gmail PDFs to Google Drive, Sheets, and OpenAI

Extract invoice data from Gmail PDFs to Google Drive, Sheets, and OpenAI

Ready for 3.0

by Incrementors ✓ · 5 views · created 2026-08-24 · 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 22 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects OpenAI Chat Model, Google Drive, Gmail and Google Sheets.

How it runs

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

  1. Skip unwanted senders (Filter): keeps only the items that match a condition
  2. Get emails in a date range (Gmail): get many
  3. Pull PDF attachments out (Code): runs custom JavaScript code
  4. Combine PDFs and folder (Merge): merges the data from its input branches
  5. Find this month folder in Drive (Google Drive): work with file folder
  6. Loop over PDFs (Loop Over Items (Split in Batches)): loops over the items in batches
  7. Upload PDF to Drive (Google Drive): uses Google Drive
  8. Download PDF back (Google Drive): download
  9. Build Drive links (Code): runs custom JavaScript code
  10. Combine file and links (Merge): merges the data from its input branches

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

Services it uses

OpenAI Chat ModelGoogle DriveGmailGoogle 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) (Check inbox hourly).

Nodes used (16)

From the author

Quick overview This workflow checks Gmail for emails with PDF invoice attachments, saves each PDF to a month-based Google Drive folder, uses OpenAI to extract key invoice fields, and appends qualifying invoices to a month-named tab in Google Sheets. How it…

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