Automated Nested Folder Creation in OneDrive

somdn_product_page

This workflow automates the creation of nested folders in Microsoft OneDrive based on a provided folder path. It allows users to ensure a structured folder hierarchy exists without manual intervention, making it especially useful for organizing files systematically.

The process begins with a trigger node that activates when another workflow executes, passing the folder path as input. The ‘Paths’ code node then parses this path, splitting it into individual folder names and constructing their respective paths within OneDrive.

Next, the ‘Search’ node checks if each folder or subfolder already exists in OneDrive. The workflow uses a loop (‘Loop Over Items’) to iterate over these folder segments. For each folder, it performs an existence check. If the folder doesn’t exist, the workflow creates it using the ‘Create a folder’ node, specifying the parent folder ID to maintain hierarchy.

Additional nodes handle storing parent folder IDs in a datastore for reference and clearing this cache as needed. Sticky notes nodes provide inline documentation, explaining the workflow’s purpose and usage.

Use cases for this automation include preparing project-specific folders, organizing files for team collaboration, or maintaining consistent directory structures across multiple projects. Triggering this workflow from another process ensures seamless integration within larger automation setups or content management routines.

Node Count

11 – 20 Nodes

Nodes Used

code, executeWorkflowTrigger, if, microsoftOneDrive, n8n-nodes-datastore.datastore, splitInBatches, splitOut, stickyNote

Reviews

There are no reviews yet.

Be the first to review “Automated Nested Folder Creation in OneDrive”

Your email address will not be published. Required fields are marked *