Templates / Extract invoice data from Gmail PDF invoices with Gemini and Google Sheets

Extract invoice data from Gmail PDF invoices with Gemini and Google Sheets

Ready for 3.0

by Mohamed Zaghloul ✓ · 16 views · created 2026-10-18 · 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-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 10 nodes and runs on Gmail events. Along the way it connects Gmail, Google Gemini Chat Model and Google Sheets.

How it runs

Trigger: On Gmail events.

  1. Split PDF Attachments (Code): runs custom JavaScript code
  2. Extract PDF Text (Extract from File): extracts data from a file (pdf)
  3. Keep Email Context (Edit Fields (Set)): sets 3 fields: text, email_subject, email_from
  4. Extract Invoice Fields (Gemini) (Basic LLM Chain): sends a prompt to an LLM, with model: Gemini Chat Model; output parser: Invoice JSON Schema
  5. Normalize Invoice (Code): runs custom JavaScript code
  6. Log Invoice to Google Sheets (Google Sheets): append
  7. Mark Email as Read (Gmail): mark as read

Services it uses

GmailGoogle Gemini 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) (Watch Inbox for Invoice PDFs).

Nodes used (9)

From the author

Quick overview This workflow monitors a Gmail label for unread emails with PDF invoice attachments, extracts the PDF text, uses Google Gemini to parse key invoice fields into structured JSON, and appends the cleaned results to a Google Sheets tab before…

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