Templates / Extract & organize email invoices with Gmail, Drive & OpenAI GPT

Extract & organize email invoices with Gmail, Drive & OpenAI GPT

Ready for 3.0

by Feras Dabour ✓ · 664 views · created 2025-12-26 · 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 20 nodes and runs on Gmail events. Along the way it connects OpenAI Chat Model, Gmail, Google Drive and Google Sheets.

How it runs

Trigger: On Gmail events.

  1. Get a message (Gmail): get
  2. Code: runs custom JavaScript code
  3. Extract from File: extracts data from a file (pdf)
  4. Merge: merges the data from its input branches
  5. Invoice Recognition Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
  6. Upload file (Google Drive): uses Google Drive
  7. Check wether it is an invoice (If): checks a condition and branches into true / false
  8. Update Invoice parameters (Google Sheets): append or update
  9. Invoice Data extractor (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
  10. Mark a message as read (Gmail): mark as read

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

Services it uses

OpenAI Chat ModelGmailGoogle DriveGoogle 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) (Gmail Trigger).

Nodes used (12)

From the author

Who’s it for This template is for founders, finance teams, and solo operators who receive lots of invoices by email and want them captured automatically in a single, searchable source of truth. If you’re tired of hunting through your inbox for invoice PDFs or…

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