n8n flows
Invite Users to Client Portal
Invites one or more users to a brand's client portal, creating auth invites, brand roles, and emailing a set-password link.
Invites one or more users to the National Commerce client portal for a given brand (account), creating Supabase auth invites, assigning brand roles, and emailing a branded set-password link. It also handles the "already a member" case.
At a glance
- Status: Active
- Trigger: Webhook (
POST /webhook/0805be40-1cc9-4415-8355-80bc16122185), answered by a Respond-to-Webhook node. - Runs on: A call carrying one or more users and a target brand, typically from New Brand Onboarding or the Users screen.
- Talks to: Supabase (Auth Admin
generate_link,get_user_uuid_by_emailRPC, userRoles, user_settings, userParentBrands); Gmail.
How it works
- The webhook responds immediately, then
Prepare Users Arrayfeeds a counter loop over each user. Get User Via Emailcalls the Supabase RPCget_user_uuid_by_email, then branches on whether the user exists.- Existing users: check
userRolesfor the brand and either return a 400 "already exists" or add a new brand role. - New users:
Generate Invite Link For User(Supabase Admingenerate_link, typeinvite, redirect/update-password), then send the invite email and add the brand role in parallel. Send Invite Emaildelivers a branded HTML message via Gmail with the one-time action link.Create Default User Preferencesseeds auser_settingsrow with default notification prefs.
Notes
- Called by New Brand Onboarding.
callerPolicy: workflowsFromSameOwner; a fixedroleIdis assigned to invitees.- Shared
error-handlerset as the error workflow.