SharePoint - Create Folder Structure
What it does
Find or create a root folder, then ensure a deduplicated set of direct child folders exists underneath it.
This action is designed for repeatable structures. It finds or creates the root and deduplicates direct child names. It does not create arbitrarily deep nested paths from the Subfolders field.
When to use it
- Create a repeatable client or project folder structure in one action.
- Prepare standard direct child folders such as Contracts, Invoices, and Reports.
Create a repeatable client or project folder structure in one action.
Requirements
- A connected Microsoft 365 connection for this HighLevel Location.
- The Drive ID of the approved SharePoint document library.
- A root folder name; optional subfolders are entered one per line and are direct children only.
Inputs
| Input | Type | Required | Description | Example value |
|---|---|---|---|---|
Document Library (Drive ID) | string | Yes | Microsoft Graph Drive ID for the SharePoint document library. The Drive ID identifies the library itself and can be reused across workflow actions. | b!exampleDriveId123 |
Parent Folder Path | string | No | Folder path inside the selected document library, for example Customers/Acme Ltd. Do not include the document library name. Leave empty to use the document library root. | Customers/Example Client |
Root Folder Name | string | Yes | Direct child folder name to find or create. | Example Client |
Subfolders | textarea | No | Optional direct child folder names, one per line. Each entry creates a folder directly under the new root folder. Do not use / or \ in these entries. | Contracts\nInvoices\nReports |
Example values
- Document Library (Drive ID)
b!exampleDriveId123- Parent Folder Path
Customers/Example Client- Root Folder Name
Example Client- Subfolders
Contracts\nInvoices\nReports
Example workflow
- HighLevel workflow trigger
The business event that starts the workflow.
- SharePoint - Create Folder Structure
Run the SharePoint operation with the approved Drive ID and action-specific inputs.
- Use the confirmed result
Map only the documented outputs required by the next workflow step.
A common pattern is: client onboarding trigger → Create Folder Structure → use Root Folder ID and the returned Folders collection in later steps.
Outputs
| Output | Type | Description | Example value | Use in later steps |
|---|---|---|---|---|
Success | boolean | Confirms that the action completed successfully. | true | Use as a completion checkpoint before relying on other outputs. |
Root Folder ID | string | DriveItem ID of the root folder. | example-root-folder-id | Map into later operations that target the root folder. |
Root Folder Name | string | Name of the root folder. | Client Files | Use in workflow messages or audit text. |
Root Web URL | string | SharePoint web link for the root folder. | https://example.invalid/Client%20Files | Use when staff need a direct link to the root folder. |
Created Root | boolean | Whether this run created the root folder. | true | Use for reporting or repeated-run logic. |
Folder Count | numerical | Number of direct child folders returned by the action. | 2 | Use to confirm how many child folder results were returned. |
Folders | array | Array of direct child folder results, including IDs, names, links, and created flags. | [{"id":"example-child-folder-id-1","name":"Contracts","web_url":"https://example.invalid/Client%20Files/Contracts","created":true},{"id":"example-child-folder-id-2","name":"Invoices","web_url":"https://example.invalid/Client%20Files/Invoices","created":false}] | Use the returned child IDs, names, links, and created flags in later logic. |
How to use outputs in later HighLevel steps
Success: Use as a completion checkpoint before relying on other outputs.Root Folder ID: Map into later operations that target the root folder.Root Folder Name: Use in workflow messages or audit text.Root Web URL: Use when staff need a direct link to the root folder.Created Root: Use for reporting or repeated-run logic.Folder Count: Use to confirm how many child folder results were returned.Folders: Use the returned child IDs, names, links, and created flags in later logic.
Use Created Root to see whether the root was newly created. The Folders array reports each direct child and whether that child was created during this run.
Permissions required
- Microsoft Graph application permission Sites.Selected on the customer-owned Entra app.
- The SharePoint site containing the document library must grant the app at least write access for this operation.
- The action does not require tenant-wide SharePoint access merely for discovery or name matching.
Common errors
Authentication unavailable / 401- This HighLevel Location does not have a usable Microsoft connection. Verify the Location connection before changing SharePoint permissions.
403- The Entra app lacks access to the selected SharePoint site or the granted role is too narrow for the operation. Verify Sites.Selected consent and the site's write grant.
404- The Drive ID, folder path, or Item ID does not resolve in the connected tenant and approved site. Recheck the administrator's Drive ID map and the exact path or Item ID.
429- Microsoft Graph throttled the request. Retry later and avoid high-volume loops without bounds.
Related actions
Product/action version
- Product version
- Pre-launch technical release · 2026-10-04
- Action version
- 1.2
- Implementation reference
- Integration commit 8440a0f · src/modules/workflows/actions/sharepoint-create-folder-structure.json · code/sharepoint_create_folder_structure.1.2.js