Extract invoice data from PDFs with Gemini AI to Google Sheets 📄
Needs changesWhat this workflow does
This AI workflow has 17 nodes and runs on Google Drive events. Along the way it connects Google Gemini Chat Model, Google Sheets, Google Drive and Gmail.
How it runs
Trigger: On Google Drive events.
- Get list of pdf files (HTTP Request): calls an HTTP API
- Read processed docs (Google Sheets): uses Google Sheets
- Cleans output (Code): runs custom JavaScript code
- Compare Datasets: uses Compare Datasets
- Limit: keeps the first few items
- Download file (Google Drive): uses Google Drive
- Extract from File: extracts data from a file
- AI Agent: runs an AI agent, with model: Google Gemini Chat Model; output parser: Structured Output Parser
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Send a message (Gmail): uses Gmail
…plus 3 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other Google Gemini + Google Sheets templates (819) · Other Google Drive + Google Sheets templates (720)
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 - get targeted elements from text1 (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent - get targeted elements from text1 (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (13)
- Compare Datasets
n8n-nodes-base.compareDatasets - Extract from File
n8n-nodes-base.extractFromFile - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - AI Agent
@n8n/n8n-nodes-langchain.agent - Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Google Drive
n8n-nodes-base.googleDrive - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Limit
n8n-nodes-base.limit - Gmail
n8n-nodes-base.gmail - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches
From the author
📄 Automated Invoice Processing (n8n + AI + Google Workspace) This workflow automates the extraction and processing of invoice data from PDFs stored in a Google Drive folder. It leverages Google Drive, Google Sheets, and Gemini AI to streamline invoice…