Templates / Extract invoice data from Gmail PDF invoices into a Google Sheets CRM with OpenRouter

Extract invoice data from Gmail PDF invoices into a Google Sheets CRM with OpenRouter

Ready for 3.0

by Sufyan Uraizee · 47 views · created 2026-08-29 · 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 11 nodes and runs on Gmail events. Along the way it connects Gmail, OpenRouter Chat Model and Google Sheets.

How it runs

Trigger: On Gmail events.

  1. Split Attachments (Code): runs custom JavaScript code
  2. Has PDF Attachment? (If): checks a condition and branches into true / false
  3. Extract PDF Text (Extract from File): extracts data from a file (pdf)
  4. Flag for Manual Review (Google Sheets): append
  5. Text Extracted? (If): checks a condition and branches into true / false
  6. Extract Invoice Data (AI Agent): runs an AI agent, with model: OpenRouter Model; output parser: Invoice Fields Parser
  7. Add Metadata (Edit Fields (Set)): sets 3 fields: received_date, source_email, status
  8. Add to Invoice CRM (Google Sheets): append

Services it uses

GmailOpenRouter 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) (New Invoice Email).

Nodes used (9)

From the author

Quick overview This workflow polls Gmail for new invoice emails, extracts text from PDF attachments, uses OpenRouter to parse key invoice fields, and appends the results to a Google Sheets “Invoice” tab, while sending non-PDFs or unreadable PDFs to a “Review”…

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