n8n flows
ShipHero Access Token Rotation
Refreshes each brand's ShipHero public-API access token weekly using the stored refresh token.
Keeps every brand's ShipHero public-API access token fresh. Once a week it uses the stored refresh token to fetch a new access token, so token expiry never breaks the downstream integrations that call the ShipHero public API.
At a glance
- Status: Active
- Trigger: Schedule, weekly (every Monday); also a manual trigger.
- Runs on: All active brands with a stored access and refresh token.
- Talks to: ShipHero (public API
/auth/refresh); Supabase (Brandsread/update).
How it works
Get All Active Brandsqueries SupabaseBrandsfor rows with a non-empty access and refresh token.Prepare Brands Arraypacks those rows for a counter loop.- Per iteration,
Refresh The Shiphero TokenPOSTs tohttps://public-api.shiphero.com/auth/refresh, thenUpdateCounteradvances. Store New Tokenwrites the returnedaccess_tokenback to that brand's row.- The
Ifnode loops whilecounter < total.
Notes
- Uses a hand-rolled counter loop rather than SplitInBatches.
- Error workflow
pqNfn3sZJQOn1GaG;callerPolicy: workflowsFromSameOwner.