Skip to main content

Auto file organizer for Google Drive: sort PDFs, images & documents by type

Workflow preview

Workflow preview
100%
Auto file organizer for Google Drive: sort PDFs, images & documents by type preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Description: This ready to deploy n8n automation template smartly detects and classifies files uploaded to a specified Google Drive folder based on MIME type. It automatically moves each file into ...

Best for

  • File Management automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.if, n8n-nodes-base.googledrive, n8n-nodes-base.splitinbatches, n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Auto file organizer for Google Drive: sort PDFs, images & documents by type
Workflow name
Auto file organizer for Google Drive: sort PDFs, images & documents by type

Description:

This ready-to-deploy n8n automation template smartly detects and classifies files uploaded to a specified Google Drive folder based on MIME type. It automatically moves each file into its correct destination folder: Documents, PDFs, or Images โ€” ensuring a clean and organized Drive, effortlessly.

Perfect for remote teams, admins, educators, legal pros, and automation-focused operations, this workflow eliminates manual sorting and saves hours of repetitive work.

What This Template Does (Step-by-Step)

โš™๏ธManual Trigger: Launch the workflow on demand using the "Execute Workflow" trigger.

๐Ÿ“ Search Files in Source Folder (Google Drive): Lists all files inside your chosen folder (e.g., "Uploads").

๐Ÿ” Loop Over Files (SplitInBatches): Iterates through each file one-by-one to ensure reliability.

๐Ÿ“ฅ Download File (Google Drive): Retrieves file metadata and MIME type required for filtering.

๐Ÿง  Smart File Type Detection via If Nodes

  • application/json โ†’ Move to Documents folder
  • application/pdf โ†’ Move to PDFs folder
  • image/jpeg โ†’ Move to Images folder (Easily customizable to support additional types like PNG, DOCX, etc.)

๐Ÿ“‚ Move Files to Designated Folders: Uses Google Drive API to relocate each file to its proper location.

๐Ÿ” Loop Returns for Next File After each move, the loop picks the next file in queue.

Key Features

โš™๏ธ Google Drive API v3 Integration ๐Ÿ” OAuth2 for secure access ๐Ÿ“„ MIME-typeโ€“based routing logic ๐Ÿ” Batch-safe with looping logic โœ… File properties are preserved ๐Ÿ”„ Auto-removal from source after sorting

Required Integration Google Drive (OAuth2)

Use Cases

  • Auto-organize client uploads
  • Separate scanned PDFs, images, or forms
  • Route invoices, receipts, or contracts into folders
  • Automatically sort uploaded assignments or resources
  • Maintain structured cloud storage without manual intervention

Why Use This Template?

โœ… No-code deployment โœ… Saves hours of manual work โœ… Works across teams, departments, or shared Drives โœ… Easy to expand with more file types or routing rules โœ… Keeps your Drive clean, fast, and organized

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 - If Image

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

Block 2 - If PDF

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

Block 3 - Move to Images

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

Block 4 - Move to PDFs

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

Block 5 - If Document

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

Block 6 - Move to Documents

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

Block 7 - Download file

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

Block 8 - Loop Over Items

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

Block 9 - When clicking โ€˜Execute workflowโ€™

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

Block 10 - Search files and folders

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

Block 11 - Sticky Note

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

Block 12 - Sticky Note1

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

Block 13 - Sticky Note2

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

Block 14 - Sticky Note3

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

Block 15 - Sticky Note4

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

Block 16 - Sticky Note5

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

Block 17 - Sticky Note6

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

Block 18 - Sticky Note7

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

Block 19 - Sticky Note8

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

3. Summary Table

Workflow Auto file organizer for Google Drive: sort PDFs, images & documents by type
Complexity advanced
Nodes 19
Categories File Management
Author Rahul Joshi
Published 29 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6611/6611.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 Auto file organizer for Google Drive: sort PDFs, images & documents by type do?

Description: This ready to deploy n8n automation template smartly detects and classifies files uploaded to a specified Google Drive folder based on MIME type. It automatically moves each file into ...

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 File Management use case.