Templates / Log email receipt data to Google Sheets with Gmail and OpenAI

Log email receipt data to Google Sheets with Gmail and OpenAI

Ready for 3.0

by 43 Sunsets ✓ · 38 views · created 2026-07-10 · 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 Gmail, OpenAI, OpenAI Chat Model and Google Sheets.

How it runs

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

  1. ⚙️ Your settings (Edit Fields (Set)): sets 4 fields: ownerEmail, sheetUrl, defaultCurrency…
  2. Receipt or monthly summary? (If): checks a condition and branches into true / false
  3. Read what is already logged (Google Sheets): uses Google Sheets
  4. Read the full ledger (Google Sheets): uses Google Sheets
  5. Keep only the new receipts (Code): runs custom JavaScript code
  6. Total last month by category (Code): runs custom JavaScript code
  7. PDF or photo? (Switch): routes items into 2 branches
  8. Email the monthly summary (Gmail): uses Gmail
  9. Extract text from PDF (Extract from File): extracts data from a file (pdf)
  10. Transcribe photo with AI vision (OpenAI): analyze (image)

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

Services it uses

GmailOpenAIOpenAI 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) (Receipt arrives (Gmail)).

Nodes used (13)

From the author

Quick overview This workflow logs Gmail receipt attachments to Google Sheets by extracting structured fields with OpenAI (including category selection from your list), prevents duplicates by checking the ledger, and sends a monthly spending summary email via…

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