Skip to main content

Classify documents with Gemini and organize them in Google Drive

Workflow preview

Workflow preview
100%
Classify documents with Gemini and organize them in Google Drive preview
Open on n8n.io

1. Workflow Overview

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, ...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.googledrive, n8n-nodes-base.switch, n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.googlesheets, n8n-nodes-base.googlecalendar

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Yanagita Yusuke.

Original n8n.io source

1.1 Workflow description

Title
Classify documents with Gemini and organize them in Google Drive
Workflow name
Classify documents with Gemini and organize them in Google Drive

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, moves, and logs them.

Get inbox filesLoop through filesDownload file fetches files one by one. Check file type routes PDFs and images to Convert to Base64; unsupported formats go to Handle unsupported formatSend error notificationLog error to sheet for manual review.

Gemini OCR classification classifies the document and Parse AI response extracts the result. If Classification check passes, Generate filenameRename fileMove to folder organizes the file, and Log to spreadsheet records it in Google Sheets. If Has deadline? finds a due date, Add to calendar creates a Google Calendar event and Send deadline alert sends a Gmail reminder.

How to set up

  1. Set your inbox folder ID in Get inbox files.
  2. Add a Gemini API key as a Query Auth credential (name: key).
  3. Set folder IDs for each document type in Generate filename.
  4. Set your spreadsheet ID in Log to spreadsheet and Log error to sheet.
  5. Set calendar and email in Add to calendar, Send deadline alert, and Send error notification.

Requirements

  • Google Drive, Google Sheets, Google Calendar, and Gmail accounts
  • Gemini API key (Google AI Studio)

How to customize

  • Edit the prompt in Gemini OCR classification to change document categories.
  • Adjust the confidence threshold (default: 0.6) in Parse AI response.
  • Modify the naming pattern in Generate filename.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 8 - Check file type

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.4

Block 9 - Convert to Base64

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Gemini OCR classification

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.4

Block 11 - Parse AI response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Classification check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 13 - Rename file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 14 - Move to folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 15 - Generate filename

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Log to spreadsheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 17 - Has deadline?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 18 - Add to calendar

Type / Role
n8n-nodes-base.googleCalendar - googleCalendar
Config choices
Version 1.3

Block 19 - Send deadline alert

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 20 - Send error notification

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 21 - Log error to sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 22 - Handle unsupported format

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Done - no deadline

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 24 - When clicking 'Execute workflow'

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Classify documents with Gemini and organize them in Google Drive
Complexity advanced
Nodes 26
Categories Document Extraction, AI Summarization
Author Yanagita Yusuke
Published 20 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15866/15866.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Classify documents with Gemini and organize them in Google Drive do?

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, ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.