Financial document extraction from Gmail to Google Sheets
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) 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 Gmail, Guardrails, Google Sheets and OpenAI Chat Model and 1 more.
How it runs
Trigger: On Gmail events.
- Get Email Content (Gmail): get many
- Guardrail: Is Finance? (Guardrails): uses Guardrails, with model: Gemini 2.5 flash
- Configuration: User Settings (Edit Fields (Set)): sets or maps fields
- If: checks a condition and branches into true / false
- Filter: keeps only the items that match a condition
- Check for Attachment (If): checks a condition and branches into true / false
- Extract PDF Data (Extract from File): extracts data from a file (pdf)
- AI Agent: runs an AI agent, with model: gpt 4o mini
- AI Agent: runs an AI agent, with model: gpt 4o mini
- Validate Extraction (Code): runs custom JavaScript code
…plus 7 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (PDF OCR) (v1.9), AI Agent (Email OCR) (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
- Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (PDF OCR) (v1.9), AI Agent (Email OCR) (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (12)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Gmail
n8n-nodes-base.gmail - Guardrails
@n8n/n8n-nodes-langchain.guardrails - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Filter
n8n-nodes-base.filter - Extract from File
n8n-nodes-base.extractFromFile - AI Agent
@n8n/n8n-nodes-langchain.agent - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
From the author
Overview Manual financial reconciliation is tedious and prone to error. This workflow functions as an AI Financial Controller, automatically monitoring your inbox for invoices, receipts, and bills, extracting the data using OCR, and syncing it to Google…