Hey community,
After seeing a lot of questions about this (and hitting the wall myself), I wanted to share the pattern that works in production.
The problem: You’re building automations for multiple clients. Each has their own Gmail / Google Calendar / Slack. n8n forces you to hardcode credentials at design time → you end up with 20 copies of the same workflow. One bug = 20 fixes.
The pattern:
-
Each client completes a one-time OAuth flow → tokens stored encrypted externally
-
At the start of your n8n workflow, one HTTP Request node fetches the right token for the current tenant
-
Inject via
{{$json.access_token}}into all downstream nodes -
One workflow. All clients. Forever.
The annoying part is building the token storage + refresh logic. I got tired of rebuilding it so I packaged it in a webapp
Happy to share the raw HTTP pattern too if you want to DIY it.