Best Practices on Dynamic Credentials?

Hey guys,

I know N8N doesn’t natively support dynamic credentials out of the box and there are a number workarounds I’ve seen people apply. I’m curious to hear the communities perspective on the best way to do this and any resources that might be helpful to solve this problem. I have a SAAS I’ve been building for sometime now. I have a multi-factor authentication all set-up within the app and have a chatbot. I’d like to connect the chatbot to N8N and run it through some multi-agents I’ve built.

However each user is fully authenticated on my app and has their own workspace (in some cases many). What are best practices / how do people building SAAS platforms normally use N8N to dynamically switch between users while keeping just one N8N environment? Namely - if Sally (one of my users) runs a query to trigger my AI agents and then Tom (another user) triggers another query, how do most people switch credential? Are there any tutorials that walk through the whole process?

Also - if a user is authenticated in my app, can i use the chatbot to pass the authentication and run

commands via n8n on their computer. For example, if someone types in: “Draft an email in GMAIL” → this passes to N8N which runs a workflow and uses their credentials to open their GMAIL on their computer without having to manually set-up individual users using Google Cloud Console.

Any advice, resources would be greatly appreciated.

I did not get the dynamic credentials part of your question. we can use expressions when creating credentials and read for example the token from $input ( {{ $json.token }} for instance) so we have a single node and a single credentials but the token changes based on the input of the node

1 curtida

My main blocker right now. How can I authenticate a node for different users? with their data in the supabase

Jumping in here because I was actually just talking about this exact workaround in another thread where folks were hitting the same multi-tenant roadblock.

@ltg220 To answer your specific question about dynamically switching between Sally and Tom: Yes, you can absolutely do this with just one n8n environment, but you have to stop using the native Google/Gmail nodes since they lock the credentials per node.

Here is how most people handle the SaaS flow you described:

  • Auth happens in your app: Your SaaS/chatbot frontend handles the multi-factor authentication and the Google OAuth login for the user.

  • Trigger via Webhook: When Sally asks the chatbot to draft an email, your frontend passes her prompt and her short-lived Google access token dynamically into an n8n Webhook node.

  • Make the API Call: Inside n8n, swap the native Gmail node for an HTTP Request node. This allows you to map Sally’s token directly into the Authorization header using a standard expression (like {{ $json.body.token }}).

@Paul_Steve Since so many people have been hitting this exact blocker lately, we actually just published a complete step-by-step guide on how to architect this.

It walks you through exactly how to set up these HTTP nodes for dynamic credentials, using step-by-step examples for OpenAI, OpenRouter, and Google Sheets: Dynamic Credential Management in n8n: One Workflow, Many Clients | Five

Hope this helps