Extract and log invoice data from Google Drive PDFs to Google Sheets with Gemini
Ready for 3.0What this workflow does
This AI workflow has 23 nodes and runs on a schedule (every hour). Along the way it connects Google Sheets, Google Drive and Google Gemini Chat Model.
How it runs
Trigger: On a schedule (every hour).
- Config (Edit Fields (Set)): sets 11 fields: inbox_folder_id, processed_folder_id, review_folder_id…
- Read existing invoices (Google Sheets): read
- List PDFs in Inbox (Google Drive): work with file folder
- Download PDF (Google Drive): download
- Extract PDF text (Extract from File): extracts data from a file (pdf)
- Prepare invoice text (Edit Fields (Set)): sets 4 fields: file_id, file_name, file_link…
- Has text? (If): checks a condition and branches into true / false
- Extract invoice data (Basic LLM Chain): sends a prompt to an LLM, with model: Gemini model; output parser: Parse AI output
- Mark as scanned (Edit Fields (Set)): sets 4 fields: file_id, file_name, file_link…
- Add file details (Edit Fields (Set)): sets 4 fields: file_id, file_name, file_link…
…plus 10 more steps. See the full node list below.
Services it uses
Other Google Gemini + Google Sheets templates (819) · Other Google Drive + Google Sheets templates (720) · Other Google Gemini + Google Drive templates (272)
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.
Nodes used (13)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Google Drive
n8n-nodes-base.googleDrive - Extract from File
n8n-nodes-base.extractFromFile - If
n8n-nodes-base.if - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Merge
n8n-nodes-base.merge - Code
n8n-nodes-base.code - Filter
n8n-nodes-base.filter - Send Email
n8n-nodes-base.emailSend
From the author
Quick overview This workflow runs hourly to scan a Google Drive “Inbox” folder for PDF invoices, extract invoice fields with Google Gemini, and log the results to Google Sheets while filing PDFs into Processed or Review folders, with an optional summary…