National Commerce Docs
n8n flows

New Brand Onboarding

End-to-end provisioning of a new brand: credentials, 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 credentials, 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.
  • Talks to: Supabase (Brands, warehouses, vendors, userRoles and junction tables); ShipHero (credential vault, warehouse/vendor lookups, webhook registration); three sibling n8n workflows over HTTP.

How it works

  1. The webhook payload is validated and normalized.
  2. ShipHero credentials are stored in the vault, then Add New Brand Record inserts the brand.
  3. Warehouses are fetched from ShipHero and looped to create warehouse and brand-to-warehouse records.
  4. Vendors are fetched and looped similarly, creating the vendor or adding the brand to an existing one.
  5. ShipHero GraphQL webhooks are registered for shipments and purchase orders.
  6. A userRole row is created and the flow calls the Invite Users workflow.
  7. 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 Wait node.
  • Includes a (TEST) Delete Brand Record cleanup node.
  • Shared error-handler set as the error workflow.

On this page