Introduction to n8n Node: Shared Google Drive Folder


Introduction

Are you having trouble working with files shared on Google Drive in n8n? The default Google Drive node cannot search for files in shared folders?

Today I would like to introduce n8n-nodes-shared-folder-google-drive – a community n8n node that I developed to completely solve this problem!

Introduction to n8n Node: Shared Google Drive Folder
Introduction to n8n Node: Shared Google Drive Folder

Problem to Solve

The built-in Google Drive node in n8n encounters serious issues when working with shared folders:

  • Cannot find files in shared folders
  • Cannot search for files in shared folders
  • Lacks important API parameters
  • “File not found” error with existing files
  • Cannot access Team Drives/Shared Drives

Cause: Default node is missing important parameters such as supportsAllDrives=true, includeItemsFromAllDrives=true, and sharedWithMe for shared folders.


Solutions

n8n-nodes-shared-folder-google-drive is an n8n community node specially designed to:

  • Powerful file search in all shared folders
  • Work with shared folders easily
  • Support upload/download files in shared folders
  • Seamless integration with Google OAuth2
  • Automatically add required API parameters

Key Features

Smart File Search

  • All shared files: Search in all files shared with you
  • Specific folder: Search in a specific folder
  • Powerful query: Support Google Drive API search syntax
  • File type: Filter by file type (PDF, video, image, etc.)

Folder Management

  • List Items: List files/folders in shared folder
  • Get Item: Get metadata or download file content
  • Upload Item: Upload files to shared folders
  • Update/Remove: Manage metadata and delete files

Flexible Interface

  • Simple Mode: Search all shared files (no ID required)
  • Query Language: Use Google Drive query syntax
  • Error Handling: Smart error handling with continue-on-fail

Settings

Method 1: Via Community Nodes (Recommended)

  1. Go to Settings > Community Nodes in n8n
  2. Select Install
  3. Import: n8n-nodes-shared-folder-google-drive
  4. Accept and install
  5. Restart n8n

Method 2: Manual Installation

cd ~/.n8n/nodes
npm install n8n-nodes-shared-folder-google-drive

OAuth2 Configuration

  1. In n8n, create a new credential: Shared Folder Google Drive OAuth2 API
  2. Go to Google Cloud Console
  3. Create a new project or select an existing project
  4. Enable Google Drive API
  5. Create OAuth 2.0 Client ID
  6. Add authorized redirect URI: https://your-n8n-instance.com/rest/oauth2-credential/callback
  7. Copy Client ID and Client Secret into n8n
  8. Connect your Google account

How to Get Folder ID

  1. Open the shared folder in Google Drive
  2. Look at the URL: https://drive.google.com/drive/folders/16prcpIImJ6vb73yh05q_zaT4qQJhQzJK
  3. Copy the ID part: 16prcpIImJ6vb73yh05q_zaT4qQJhQzJK

Common Search Syntax

Introduction to n8n Node: Shared Google Drive Folder
Introduction to n8n Node: Shared Google Drive Folder

Find files in a specific folder:

'FOLDER_ID' in parents

Find videos in a folder:

'FOLDER_ID' in parents and mimeType contains 'video'

Find PDFs by name:

name contains 'invoice' and mimeType = 'application/pdf'

Find recent files:

modifiedTime > '2024-11-01T00:00:00'

Find large files (over 10MB):

'FOLDER_ID' in parents and size > 10485760

Find files by time range:

createdTime > '2024-11-01T00:00:00' and createdTime < '2024-11-30T23:59:59'

Search by content:

fullText contains 'invoice'

Search with multiple conditions:

(name contains 'report' or name contains 'report') and mimeType = 'application/pdf'

Real-World Use Cases

1. Automatically Clean Up Old Files

modifiedTime < '2024-10-01T00:00:00' and trashed = false

2. Invoice Backup

name contains 'invoice' and mimeType = 'application/pdf' and modifiedTime > '2024-11-01'

3. Media Management

mimeType contains 'video' and size > 104857600

4. Data Sync (files modified within 7 days)

modifiedTime > '2024-11-16T00:00:00'

5. Word File Processing

mimeType = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

Comparison With Default Node

FeatureBuilt-in Node (Default)Shared Folder Node (Custom)
Search in Shared Folders❌ Not working✅ Works perfectly
Requires Folder ID❗ Required➖ Not required (optional)
Supports sharedWithMe❌ No✅ Yes
Full Google Query support⚠️ Limited✅ Full
404 error when accessing folder🔥 Frequent🛠️ Fixed
Upload to Shared Folders🚫 Limited✅ Works well

Tips and Tricks

Performance Tips

  • Use the field parameter to retrieve only necessary fields
  • Limit the limit with a reasonable value (100-1000)
  • Use specific queries instead of fetching all

Search Tips

  • Use quotes for file names with spaces: name contains "my file"
  • Combine multiple conditions with and, or
  • Use not to exclude: not trashed = true

Best Practices

Backup important data before performing bulk operations

Test the query in the Google Drive UI before adding it to the workflow

Verify the correct folder ID

DPS.MEDIA