Classify documents with Gemini and organize them in Google Drive
Ready for 3.0What this workflow does
This workflow has 20 nodes and runs manually, when you click “Execute workflow”. Along the way it connects Google Drive, Google Sheets, Google Calendar and Gmail. It also calls generativelanguage.googleapis.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Get inbox files (Google Drive): work with file folder
- Loop through files (Loop Over Items (Split in Batches)): loops over the items in batches
- Download file (Google Drive): download
- Check file type (Switch): routes items into 2 branches
- Convert to Base (Code): runs custom JavaScript code
- Handle unsupported format (Code): runs custom JavaScript code
- Gemini OCR classification (HTTP Request): calls generativelanguage.googleapis.com (POST)
- Send error notification (Gmail): uses Gmail
- Parse AI response (Code): runs custom JavaScript code
- Log error to sheet (Google Sheets): append
…plus 8 more steps. See the full node list below.
Services it uses
HTTP calls to: generativelanguage.googleapis.com
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 (11)
- Google Drive
n8n-nodes-base.googleDrive - Switch
n8n-nodes-base.switch - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Google Calendar
n8n-nodes-base.googleCalendar - Gmail
n8n-nodes-base.gmail - No Operation, do nothing
n8n-nodes-base.noOp - Manual Trigger
n8n-nodes-base.manualTrigger - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches
From the author
Who is this for Accountants and office managers who want to automatically classify and organize documents in Google Drive. What this workflow does Retrieves files from a Google Drive inbox folder, classifies each using Gemini 2.5 Flash OCR, then renames,…