All work

Campaign folders created automatically in SharePoint

When a subscriber finishes the intake form, n8n copies a ready-made folder template into SharePoint, names it after the business and tells the project manager in Slack. A second workflow undoes the copy if anything fails.

Client
Home-services marketing client
My role
Built version 2 from a handover: research, both workflows, testing and installing it
Period
Jun 2026
Status
Tested and installed, not yet switched on

Mock-up: made-up business and folder names

18 of 18
checks passed
43 and 13
steps in the two workflows
2
bugs caught before release
0
test leftovers after cleanup

The problem

The live version built every folder from scratch at payment. Version 2 had to start from a different event, the completed intake form, with different information, so it shipped as its own workflow. A run that fired twice or stopped halfway could not be allowed to leave a mess in the client's SharePoint.

The workflow

The folder-creation workflow (n8n)

It starts from an automatic message, and also checks for new orders every 5 minutes.

truefalsetruefalsetruefalsetruefalsetruefalsePoll Schedule (5min)Poll: List Orders(MCP)Poll: Filter WorkingOrdersPoll: CheckProcessedPoll: Not YetProcessed?Poll: Take OnePoll: Skip (alreadyprovisioned)Poll: Rejoin OrderNumberIntake WebhookValidate Token &Extract OrderFetch Order (portalMCP)Parse Order & DeriveSlugIntake Qualifies?Skip: Non-QualifyingIntakeAcquire LockStore Rollback Ctx(locked)Lock Acquired?Reject DuplicateResolve ClientFolderClient FolderExists?Plan: ExistingClientResolve LetterFolderPlan: New ClientMerge Copy PlanInitiate CopyExtract Monitor URLStore Rollback Ctx(pre-poll)Wait For CopyPoll Copy StatusCheck Copy StatusCopy Complete?Get Copy RootChildrenResolve TargetsGet CampaignChildrenResolve Workbook IdRename WorkbookRename CampaignFolderStore Rollback Ctx(final)Slack NotificationLog ExecutionRelease LockCleanup Rollback CtxMark Processed
Drawn from the real workflow export in the style of the n8n editor. 43 working steps (n8n calls them nodes). Drag to move around, or use the zoom buttons.

The undo workflow (n8n)

It runs when the folder-creation workflow fails.

truefalsetruefalseError TriggerGet Rollback ContextParse ContextHas Direct Delete?Delete FolderHas Fallback?List Parent ChildrenResolve Fallback IdDelete FallbackRelease LockCleanup Rollback CtxLog ErrorSlack Error Alert
Drawn from the real workflow export in the style of the n8n editor. 13 working steps (n8n calls them nodes). Drag to move around, or use the zoom buttons.

What I built

  • A 43-step main workflow. It copies the template through Microsoft's service, keeps checking until the copy finishes, then renames the folder and the workbook after the business.
  • Three protections against double runs: a 30-day "already processed" record in Redis (a fast short-term store), a 15-minute lock, and a copy that fails if the name is already taken.
  • A 13-step undo workflow that removes only what that run created: the campaign folder for an existing client, or the whole folder for a new one. Every step carries on after an error, so the alert always goes out.
  • Reads the business name from three versions of the live form. The first build read only one, which would have failed most real orders, and that was caught before release.
  • Moved the secret access key out of the workflow into a protected setting, and removed personal data from the logs.

Tools used

  • n8n
  • Microsoft Graph (SharePoint and OneDrive)
  • Redis
  • Slack
  • GitHub