Automate Google Drive Nested Folder Creation
detail.loadingPreview
This n8n workflow intelligently creates nested folder structures in Google Drive from a simple path string. It streamlines file organization by automatically checking for existing folders and only creating new ones when necessary, ultimately returning the ID of the final, deepest folder for subsequent actions.
About This Workflow
Manually creating deep, nested folder hierarchies in Google Drive can be tedious and prone to errors. This n8n workflow provides a robust solution to automate this process. You simply provide a google_drive_folder_id (or 'root') and a desired_path string like Projects/ClientName/Reports/2024. The workflow then intelligently parses the path, checks if each subfolder exists, and creates it if missing, moving sequentially down the hierarchy. This ensures idempotency – avoiding duplicate folders – and guarantees a consistent structure. Once the full path is established, it returns the ID of the final created (or existing) folder, ready for immediate use in subsequent automation steps.
Key Features
- Recursive Folder Creation: Automatically creates a multi-level nested folder structure from a single path string.
- Idempotent Operation: Prevents duplicate folders by checking for the existence of each subfolder before creating it.
- Returns Final Folder ID: Provides the Google Drive ID of the deepest created or existing folder, enabling seamless chaining with other workflows.
- Flexible Starting Point: Define your starting point as 'root' for your Google Drive or any specific parent folder ID.
- Clean Path Handling: Easily define your desired structure using common slash-separated paths (e.g.,
Department/Projects/Year).
How To Use
- Trigger the Workflow: You can call this workflow from another n8n workflow using the
Execute Workflow Triggernode, or expose it via a Webhook. - Input
google_drive_folder_id: Pass the ID of the parent Google Drive folder where you want to start creating the path. Use"root"(as a string) to begin at the root of your Google Drive. - Input
desired_path: Provide a string representing the nested folder structure you wish to create. For example:"Projects/NewClient/Q1_2024/Documents". - Receive Final Folder ID: The workflow will process the path, creating any missing folders. Upon completion, it will return the Google Drive ID of the deepest folder in the specified path, which you can then use for uploading files or further actions.
Apps Used
Workflow JSON
{
"id": "c0e800ce-28ee-4f16-be55-774df6104fa8",
"name": "Automate Google Drive Nested Folder Creation",
"nodes": 27,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: c0e800ce-28ee...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.
Automate Getty Images Editorial Search & CMS Integration
This n8n workflow automates searching for editorial images on Getty Images, extracts key details and embed codes, and prepares them for seamless integration into your Content Management System (CMS), streamlining your content creation process.