n8n flows
New Brand Onboarding
End-to-end provisioning of a new brand: ShipHero tokens, warehouses, vendors, webhooks, users, and initial pulls.
The onboarding orchestrator. It provisions a new brand (account) end-to-end: it stores the brand and its ShipHero tokens, imports warehouses and vendors, registers ShipHero webhooks, invites portal users, and kicks off the initial SKU and historical-shipment pulls.
At a glance
- Status: Active
- Trigger: Webhook (
New Brand Attempt,POST /webhook/create-new-brand), answered by a Respond-to-Webhook node. - Runs on: A new-brand submission from the portal's create-connection wizard. The portal reads this webhook's URL from
N8N_CREATE_BRAND_WEBHOOK_URL, which is set on production only. - Talks to: Supabase (Brands, warehouses, vendors, userRoles and junction tables); ShipHero (warehouse/vendor lookups, webhook registration); three sibling n8n workflows over HTTP.
How it works
- The webhook receives the account name, the ShipHero access and refresh
tokens pasted into the wizard, the invited users, and the creator's user id.
It gets no ShipHero email or password, because the wizard no longer asks for
them.
Extract Last 4 Access Token Characterstakes the token's last four characters for the brand's default name. Add New Brand Recordinserts the brand with those tokens. TheHas ShipHero Login?check runsAdd Shiphero Credentials To The Vaultonly when the payload carries both a ShipHero email and password. The portal's payload doesn't, so nothing is stored in the vault.- Warehouses are fetched from ShipHero and looped to create warehouse and brand-to-warehouse records.
- Vendors are fetched and looped similarly, creating the vendor or adding the brand to an existing one.
- ShipHero GraphQL webhooks are registered for shipments and purchase orders.
- The flow calls the Invite Users workflow for the invited users. It doesn't add the creator itself: the
trg_add_super_admins_to_new_brandtrigger onBrandsadds every NC Super Admin, the creator included, the momentAdd New Brand Recordinserts the account. The oldCreate userRole rownode is disabled. - It triggers Pull Brand SKUs and starts a historical-shipment backfill, then returns OK or a structured error keyed by failure point.
Notes
- Orchestrator that fans out to multiple downstream scenarios, sequenced with a
Waitnode. - Includes a
(TEST) Delete Brand Recordcleanup node. - Shared
error-handlerset as the error workflow.