Create Google Drive Folders by Path
This workflow automatically creates multi-level nested folders in Google Drive recursively based on a path string input by the user, and returns the ID of the last-level folder. This process simplifies the cumbersome steps of manually creating folders layer by layer, avoids errors, and improves efficiency. It is suitable for both businesses and individuals to batch create folders for project or category management, as well as to build a standardized folder system in automated file archiving processes, ensuring clear and organized file management.

Workflow Name
Create Google Drive Folders by Path
Key Features and Highlights
This workflow automatically creates multi-level nested folders in Google Drive based on a user-provided path string. It recursively generates the folder hierarchy and ultimately returns the ID of the deepest-level folder, facilitating subsequent file uploads and management. The creation process can start from the root directory or any specified folder, greatly simplifying the batch creation of multi-layer folder structures.
Core Problem Addressed
Manually creating complex folder structures layer by layer in Google Drive is tedious and error-prone, especially when dealing with a large number of nested folders. This workflow automates the conversion from a path string to an actual folder hierarchy, eliminating repetitive operations and ensuring clear and accurate folder levels.
Use Cases
- Enterprises or individuals needing to batch-create folder structures based on categories such as projects, clients, or time periods.
- Pre-building standardized folder systems as part of automated file archiving workflows.
- Integration into larger automation pipelines to enable seamless dynamic folder creation and file upload processes.
Main Workflow Steps
- Trigger Execution: The workflow can be triggered manually for testing or called by other workflows.
- Input Preparation: Set the starting folder ID (e.g., “root”) and the target path string (e.g., “testXavier/2024/Q4/03 Documenten”).
- Path Splitting: Split the path string into multiple folder names using “/” as the delimiter.
- Layer-by-Layer Check and Creation:
- Check if the folder exists at the current level.
- If not, create the folder.
- Pass the current folder ID to the next level and repeat until the entire path is created.
- Return Result: Output the ID of the last-level folder for subsequent calls or file operations.
Involved Systems or Services
- Google Drive API: Used to check folder existence and create new folders.
- n8n Automation Platform: Handles the workflow logic and node orchestration.
Target Users and Value
- Enterprise administrators and team members who need efficient management of Google Drive folder structures.
- Automation developers and technical personnel, especially those building folder-based automated archiving or document management systems.
- Users seeking to improve folder creation efficiency and reduce repetitive tasks.
This workflow enables users to effortlessly automate the creation of complex folder structures, enhancing productivity and ensuring standardized and consistent file management.