Smart Nested Folder Creation in OneDrive with Existence Checking — n8n Workflow

Medium complexity Trigger11 nodes🏷️ File Managementby Marko Korhonen

Overview

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

How it works

It creates a nested folder in your OneDrive's My Files You could be creating folders like:

Foobar Foobar/Barfur Foobar/Barfur/Furbar

Workflow checks if any of the folders in the path exists and created only the ones that don't exist.

The usual case it to use it in your other workflows and execute it as Sub-workflow.

Requirements

n8n-nodes-datastore Community node Microsoft Dri

Nodes used

Microsoft OneDriveCode

Workflow Preview

Create folder if it does not exist
Pass the ID of created folder forward and store it
Create a nested folder in Microsoft OneDrive
- This workflow loops you nested folder e.g. `Foobar/Ba
- This is because OneDrive API c
W
When Executed by Another…
S
Split Out
Paths
Search
L
Loop Over Items
Create a folder
E
Exists
S
setParentFound
S
setParentCreated
G
getParent
C
clearParent
11 nodes12 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a trigger trigger.

  2. 2

    Process

    Data flows through 11 nodes, connecting code, executeworkflowtrigger, if.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (11)

MI

Microsoft OneDrive

microsoftOneDrive

#1
CO

Code

code

#2

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows → New → Import from file.
  3. 3Select the downloaded smart-nested-folder-creation-in-onedrive-with-existence-checking file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n → Import from JSON:

{ "name": "Smart Nested Folder Creation in OneDrive with Existence Checking", "nodes": [...], ...}

Integrations

codeexecuteworkflowtriggerifmicrosoftonedriven8n-nodes-datastore.datastoresplitinbatchessplitout

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes11
Complexitymedium
Triggertrigger

Created by

Marko Korhonen

Marko Korhonen

@back295

Tags

codeexecuteworkflowtriggerifmicrosoftonedriven8n-nodes-datastore.datastoresplitinbatchessplitout

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free →

Related File Management Workflows

COCOGOHT+5
medium

Sync SharePoint to Google Drive via Supabase (n8n Workflow)

Eliminate manual file transfers and data silos with this enterprise-grade synchronization pipeline. This n8n workflow automates the heavy lifting of mirroring your Microsoft SharePoint document libraries to Google Drive while maintaining a robust audit trail in Supabase or Postgres. Designed for high-reliability environments, the automation utilizes a sophisticated delta-check logic: it fetches SharePoint metadata, compares it against your existing database records using the 'Compare Datasets' node, and identifies only new or modified files for processing. By leveraging the 'Split in Batches' node, the system handles large volumes of data without hitting memory limits, ensuring every document is securely downloaded via HTTP and re-uploaded to its destination. Once the transfer is verified, the workflow updates your database status in real-time, providing a transparent log of your synchronization history. This is an essential solution for organizations transitioning between cloud ecosystems or those requiring a redundant, cross-platform backup strategy. It effectively bridges the gap between Microsoft and Google ecosystems using Supabase as a high-performance state-management layer. **Common Use Cases:** - Automated Multi-Cloud Disaster Recovery: Maintain a real-time mirror of critical SharePoint corporate assets in Google Drive to ensure business continuity during service outages. - Cross-Departmental Collaboration: Automatically sync project documentation from an executive SharePoint site to a creative team's Google Drive folder for seamless cross-platform access. - Centralized Document Auditing: Use Supabase to track every file movement between ecosystems, creating a searchable metadata index for compliance and regulatory reporting.

Scheduled·15 nodes
FOGOGOHT+2
medium

Automate Threads Video Backups to Google Drive & Sheets

Streamline your social media asset management with this robust n8n automation designed for digital marketers and content creators. This workflow eliminates the manual effort of downloading Threads content by providing a seamless bridge between Instagram's text-based platform and your cloud storage. Once triggered via a simple form input, the automation utilizes a RapidAPI connection to fetch high-quality video assets, processes the binary data, and securely uploads the file to a designated Google Drive folder. Simultaneously, the workflow maintains a centralized audit log in Google Sheets, capturing essential metadata such as timestamps and file IDs. Built-in logic gates and wait nodes ensure API rate limits are respected and file transfers are verified before logging. This is an essential tool for agencies managing high volumes of social content who need a reliable, automated pipeline for content repurposing, archival compliance, or collaborative review processes. By centralizing your Threads media assets, you ensure your creative team has instant access to raw footage without the friction of manual downloads. **Common Use Cases:** - Automated Social Media Content Archiving for Compliance - Centralized Asset Library Syncing for Creative Agencies - Competitor Research and Video Content Benchmarking

Trigger·9 nodes