Automate Nested Google Drive Folder Creation N8N — Complete Guide [2026]

Learn how to automate nested google drive folder creation n8n with this step-by-step guide. Includes workflow examples, tips, and best practices for 2026.
googleDrive
code
if
+4
Workflow Identifier: 2131
NODES in Use: ManualTrigger, Set, Code, ExecuteWorkflowTrigger, If, GoogleDrive, StickyNote
Automate Google Drive folders with n8n and GoogleDrive

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow creates nested folders in Google Drive automatically.

It solves the problem of making many folders one by one, which is slow and can cause mistakes.

The final result is a full folder path created or found, returning the deepest folder’s ID.

Who should use this workflow

People who manage lots of files on Google Drive and need to create folders regularly.

It is for anyone wanting to save time and avoid mistakes in folder creation.

Tools and services used

  • n8n: Automation platform to build workflows.
  • Google Drive API: To list, find, and create folders.

Inputs, processing steps, and output

Inputs

  • Root Google Drive folder ID (like “root” for main Drive).
  • Full desired folder path as a string, separated by slashes (example: Projects/Clients/Reports).

Processing steps

  • The path string is split into individual folder names.
  • For each folder name, the workflow checks if it exists inside the current parent folder.
  • If a folder does not exist, it creates the folder in Google Drive.
  • The parent folder ID updates to the newly created or found folder ID for the next step.
  • This process repeats until the full path is processed.

Output

  • The ID of the last (deepest) folder created or found in Google Drive is returned.

Beginner step-by-step: How to use this workflow in n8n

Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor and select “Import from File” to upload the downloaded workflow.

Configure the workflow

  1. Add Google Drive API credentials in n8n if not already set up.
  2. Update the root folder ID and desired path in the Set node to your own folders.

Test the workflow

  1. Run the workflow manually by clicking “Execute Workflow” to check for errors.

Activate for production

  1. Once happy with how it works, toggle the workflow to active to let it run automatically.

For users running self hosting n8n, see self-host n8n for deployment tips.

How the workflow works in detail

Step 1: Manual trigger

Starts the workflow execution manually or by external calls.

Step 2: Set input parameters

Uses a Set node to provide the starting folder ID and the path string.

Step 3: Split path

A Code node splits the path string into array of folder names.

Step 4: Prepare data

Another Code node passes the current folder ID and folder array forward.

Step 5: Check folder existence

The Google Drive node lists folders under the current parent to find the next folder.

Step 6: Decision check

An If node decides whether the folder exists or needs to be created.

Step 7: Create folder if missing

If missing, a Google Drive node creates the new folder under the current parent.

Step 8: Setup for next folder

A Code node updates the folder array and folder ID for the next iteration.

Step 9: Loop control

An If node checks if all folders are processed or to loop back for next folder.

Step 10: Output final folder ID

A Set node returns the ID of the last folder created or found.

Customization ideas

  • Change root folder ID in the input Set node to create folders inside another folder.
  • Add prefixes or suffixes to folder names in the Create new subfolder node for naming conventions.
  • Return extra folder details like creation date or URL by updating the final Set node.
  • Adapt the workflow to accept multiple folder paths in batch and loop over them.

Common edge cases and errors

  • If Google Drive node returns authentication errors, it usually means the OAuth2 credentials need reauthorization.
  • If folder creation does not work or layers are missing, check if the workflow correctly passes folder IDs and arrays between nodes.
  • Using debug nodes inside n8n can help inspect variable values at each step.

Summary of benefits

✓ Saves time by automating nested folder creation.

✓ Prevents errors caused by missing or misplaced folders.

✓ Returns the exact folder ID for use in other workflows.

✓ Can be reused as a sub-workflow in larger automations.


Automate Google Drive folders with n8n and GoogleDrive

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow splits a full folder path into parts, checks if each folder exists under the current parent, and creates missing folders step-by-step until the full path is made.
The workflow requires a root Google Drive folder ID to start from, and a string containing the full desired nested folder path separated by slashes.
If a folder exists, the workflow skips creating it and uses its ID to check or create the next folder in the path.
The base workflow handles one path at a time. To create multiple paths, it must be modified to loop over an array of paths.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.