August 22, 2026
Field Notes: SharePoint Folders That Create Themselves
A short walkthrough of triggering SharePoint folder creation from a HubSpot deal stage, and the permission mistake that makes it dangerous.
By Ian Phillips, Founder & CEO, Phillips Data Solutions
A short one. Someone asked how the folder-creation piece works, so here it is end to end.
The trigger
A HubSpot workflow fires on deal stage change โ in our case entering "Won", though "Contract Sent" is the more common choice because people want the folder before they need it. The workflow calls a webhook with the deal ID.
The build
The webhook lands in n8n, which does four things in order:
- Fetch the deal from HubSpot to get the company name, deal name, and close date. Don't trust the webhook payload to carry everything; fetch fresh.
- Build the folder name from record fields โ we use
CompanyName - DealNamewith characters SharePoint rejects stripped. Never let a human type this; the whole point is that the name is predictable. - Create the folder tree via Microsoft Graph, from a template structure. Same subfolders every time.
- Write the folder URL back onto the HubSpot deal as a property, so the link is on the record rather than in somebody's bookmarks.
That last step is what makes people actually use it.
The permission mistake
Here's the part worth the post.
The obvious way to build this is with an app registration holding Sites.ReadWrite.All. It works immediately, and it means your automation can write to every SharePoint site in the tenant โ including HR and Finance.
Nothing about the folder feature requires that. Use Sites.Selected instead, then grant the app write access to the one document library it needs. It's more setup and one more conversation with whoever owns the tenant, and it means a bug in your workflow can't reach payroll.
We've seen the broad-permission version in the wild more than once, usually because a tutorial used it. If you inherit one of these, that's the first thing to change.
What it doesn't do
It doesn't move existing documents, and it doesn't reorganize a library that's already a mess. Creating structure going forward is a different job from cleaning up what's there โ if you need both, do the cleanup as its own project first, or you'll have two conventions living side by side.
More detail on the SharePoint automation page, and the extraction side is on document automation.
Free checklist
HubSpot + Microsoft 365 Integration Checklist
The 12-point checklist we run on every client integration โ covering the native connector, the gaps, and the middleware that closes them.
Instant access โ no spam, unsubscribe anytime.
Get a free HubSpot + Microsoft 365 integration audit
Weโll review your current setup, flag the gaps the native connector leaves open, and map the fixes โ in one free 30-minute session.
Book My Free Integration AuditKeep reading
Microsoft Graph: The Automation API You Already Pay For
Read article โHubSpot + Microsoft 365 + AI Agents: Integration Pattern
Read article โMicrosoft 365 + HubSpot: The Integration Guide
Read article โRelated services: Microsoft 365 Integration ยท HubSpot Automation ยท CRM Integration