Automated Google Drive Folder Creation from Path
detail.loadingPreview
Seamlessly create nested folders in your Google Drive with this powerful n8n workflow. Simply provide a path, and let the automation handle the rest, ensuring your file organization is always on point.
About This Workflow
This n8n workflow automates the intricate process of creating a series of nested folders within your Google Drive based on a user-defined path string. It intelligently parses the path, checks for existing folders, and creates any missing ones recursively. The workflow begins with dummy input data for testing or can be integrated into larger automation sequences by providing a google_drive_folder_id (starting point like 'root') and a desired_path string (e.g., 'Projects/Clients/Reports'). It ensures that even complex directory structures are built correctly, returning the ID of the final created folder for immediate use in subsequent automation steps.
Key Features
- Dynamic Folder Creation: Automatically builds nested folder structures based on any provided path.
- Smart Existence Check: Verifies if parent folders already exist, preventing duplicates and errors.
- Recursive Building: Handles multi-level folder creation efficiently.
- ID Output: Returns the ID of the final created folder for integration with other workflows.
- Flexible Integration: Can be triggered manually or called as a sub-workflow.
How To Use
- Trigger Configuration: Start with the 'When clicking ‘Test workflow’' manual trigger for testing, or the 'Execute Workflow Trigger' node to integrate this workflow as a sub-flow.
- Input Data: Use the 'Dummy input data' node (for testing) or ensure your calling workflow passes
google_drive_folder_id(e.g., 'root') anddesired_path(e.g., 'Year/Month/Document Type') to the workflow. - Path Splitting: The 'Split the desired path' node breaks down the
desired_pathstring into an array of folder names. - Initial Path Setup: The 'Create desired path' node prepares the data for subsequent steps.
- Top Folder Check: The 'Check if top folder exists' node queries Google Drive for the first folder in your
desired_path. - Conditional Folder Creation: The 'If top folder doesn't exist' node determines if the first folder needs to be created.
- Create New Subfolder: If the top folder is missing, the 'Create new subfolder' node creates it in Google Drive.
- Path Parameter Update: The 'Set parameters for next run' node refines the
desired_pathandgoogle_drive_folder_idfor recursive creation of subsequent folders. - Completion Check: The 'If path has been completely created' node checks if there are any remaining parts of the
desired_pathto process. - Final Output: The 'Return the ID of the last folder' node outputs the
google_drive_folder_idof the most recently created or identified folder, ready for further actions.
Apps Used
Workflow JSON
{
"id": "718e8149-4b55-4c2f-94fc-86f7057072a5",
"name": "Automated Google Drive Folder Creation from Path",
"nodes": 5,
"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: 718e8149-4b55...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
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.