Create Google Drive Folders by Path
Configured with Execute Workflow Trigger, Google Drive. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Code
- Transform
- Files / media
- Routing
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When clicking ‘Test workflow’ | Trigger | Manual Trigger | See node parameters |
| Set parameters for next run | Code | Code | See node parameters |
| Execute Workflow Trigger | Trigger | Execute Workflow Trigger | See node parameters |
| Dummy input data | Transform | Edit Fields | See node parameters |
| Split the desired path | Code | Code | See node parameters |
| Create desired path | Code | Code | See node parameters |
| Check if top folder exists | Files / media | Google Drive | fileFolder |
| If top folder doesn't exist | Routing | If | See node parameters |
| Create new subfolder | Files / media | Google Drive | folder |
| If path has been completely created | Routing | If | See node parameters |
| Return the ID of the last folder | Transform | Edit Fields | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
googleDriveOAuth2Api
Workflow notes
Create Google Drive Folders by Path
Create Google Drive Folders by Path
This workflow created nested Google Drive folder from a path string and returns the ID of the final folder for immediate use.
Use this workflow in your other flows by calling it directly with the following data:
google_drive_folder_id-> The ID of the folder where you want to create additional folders in. You can use "root" if you want to begin at root level of your Drive.desired_path-> The folder structure you'd like to create in Google Drive. Each folder is separated by a slash, eg:Projects/Clients/Reports
Test data for the workflow
Test data for the workflow
Use this in case you want to test the workflow.
Triggered from another workflow
Triggered from another workflow
This workflow is intended to be triggered by other workflows. Don't copy/paste this workflow as it will be more difficult to maintain and keep up-to-date.
Main loop
Main loop
Take the desired_path and split it into parts. Eg: Projects/Clients/Reports will turn into 3 parts: Projects, Clients, Reports.
We then check if the top folder exists and create it if not. We repeat this process until all subfolders have been created and correctly nested.
Rerturn data
Rerturn data
Here we return the ID of the last folder in the path, so you can start uploading new files to it.
Create Google Drive Folders by Path
Create Google Drive Folders by Path
Purpose and structure
This folder contains the Create Google Drive Folders by Path workflow. Its executable nodes use code, executeWorkflowTrigger, googleDrive, if, manualTrigger, set. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When clicking ‘Test workflow’, Execute Workflow Trigger
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/0891_Code_Manual_Create_Triggered.json MIT; preserve source notices.