# Reusable flows with different credentials (parameteraize/ programatically)

**URL:** <https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239>\
**Category:** Feature Requests\
**Tags:** node\
**Created:** [June 27, 2024, 1:43pm UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239 "2024-06-27T13:43:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Ho](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/david_ho/32/35880_2.png) [@David\_Ho](https://community.n8n.io/u/David_Ho)\
**Post date:** [June 27, 2024, 1:43pm UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/1 "2024-06-27T13:43:03Z")

</div>

Reusable flows with different credentials.

We need to support a lot of customers (embbeding), with a lot of different flow.  
Each customer (B2B) have his own credentials.

We need a secured way to run a flow only for specific customer. the current state of the platform is that we need to create a flow for each customer. this can be hundreds.  
we also update and upgrade flows.

The current state of N8N is that you need to create flow for each customer which is a huge overload to develop such a thing, upgrade is also huge and tragic event.  
Using expressions is not secured at all since you can see the credentials more than that there are way too many ways to use it : Oauth2/ ApiKey, etc…

I saw way too many tickets that have so many votes for this feature, but it seems like it is ignored.

> [@Select credentials via expression](http://community.n8n.io/t/select-credentials-via-expression/5150):
>
> Hi, When creating an HTTP Request node, I would like to be able to dynamically select the credentials set to use based on an expression. It is not exactly as [Access saved credentials from "expressions"](http://community.n8n.io/t/access-saved-credentials-from-expressions/857) as I don’t really need to access the credentials itself but only to tell HTTP Request node which credentials to use. My use case: I have 3 environments (dev, test, prod) When an event is detected on any of these envs, it triggers a n8n webhook. The payload contains the environment. A unique wo…

> [@Allow expression for credential selection](http://community.n8n.io/t/allow-expression-for-credential-selection/20047):
>
> The idea is: At the moment we can use expressions within the setup of credentials. But I would like to use an expression to set the ID of the credentials, this would allow flexibility without having the credentials visible within the workflow and executions. so instead of [image] to something like this: [image] My use case: Currently I am creating workflows to scrape Workflow and Execution data from multiple environments. Having URL and API key visible in the executions / workflow data is…

> [@How to use Expressions for Credentials in HTTP Request node?](http://community.n8n.io/t/how-to-use-expressions-for-credentials-in-http-request-node/27756):
>
> Describe the problem/error/question I have a workflow which runs though several URLs, each URL has its own Header Auth. How can I program the HTTP Request node to use a specific Auth for the specific URL using Expression? Please share your workflow

I don’t want to add more links since the team is already aware for that.

Today we are in the middle of examining the platform with license for (embedded + enterprise) vs competitors, we like the platform but this feature is a must for us, otherwise its a huge overload on RnD team. I know some other platforms don’t support it too, some does support it and we examined them too.

Is this feature gonna be implemented soon? or neglected? (feature requests made from 2020 already)

---

<div class="post-metadata">

**Author:** ![Sow\_B](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sow_b/32/29986_2.png) [@Sow\_B](https://community.n8n.io/u/Sow_B)\
**Post date:** [August 22, 2024, 5:21am UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/2 "2024-08-22T05:21:27Z")

</div>

I also need this but they way people request a solution above is bad and won’t work and possibly why it hasn’t been implemented yet… We shouldn’t allow ‘dynamic’ selection of credentials, instead I feel the best way to implement is as follows -

In the enterprise licence we can already create ‘projects’ which has their own ‘credentials’ for each ‘project’ - this is great and useful. We can replicate our master flow into each of these projects

THEN we introduce ‘local’ variables to each project - this is like global variables but only seen within the project and not to others. Local variables can be called the same thing like $myVar1 and used through any flow within the project.

THEN we create another master flow where we can do upgrades and enhancements and use the same variable of $myVar1 and once we copy and paste that flow into the project then the flow uses the local variables of the project.

This will mean that you can upgrade any flow and then copy and paste to deploy it on any project and it won’t break anything. It’s easy to maintain.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [August 22, 2024, 6:04am UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/3 "2024-08-22T06:04:28Z")

</div>

Morning,

I was chatting to one of our product managers about this earlier this week and he may be about to pick up using expressions to dynamically select credentials to use in a workflow which would solve most of these requests.

---

<div class="post-metadata">

**Author:** ![David\_Ho](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/david_ho/32/35880_2.png) [@David\_Ho](https://community.n8n.io/u/David_Ho)\
**Post date:** [August 22, 2024, 6:48am UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/4 "2024-08-22T06:48:19Z")

</div>

> [@Jon](#):
>
> I was chatting to one of our product managers about this earlier this week and he may be about to pick up using expressions to dynamically select credentials to use in a workflow which would solve most of these requests.

Thanks Jon for the update. Though as part of our needs we moved to other solution. If you had it we might have chosen your solution cause we really liked that it is open source and deployable on K8S, also the SSO using SAML.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [August 22, 2024, 7:14am UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/5 "2024-08-22T07:14:45Z")

</div>

Hey @David_Ho,

That is understandable, It takes time to pick up some features and they need a lot of ground work.

Maybe in the future once this has been implemented you can check it out again, One thing I would note is while our source is available it isn’t “open source”. Out of interest can you share what you went with in the end?

---

<div class="post-metadata">

**Author:** ![pemontto](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pemontto/32/2684_2.png) [@pemontto](https://community.n8n.io/u/pemontto)\
**Post date:** [August 22, 2024, 8:06am UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/6 "2024-08-22T08:06:28Z")

</div>

This is something I’ve discussed before, and what I thought the Vars feature was going to be.

Effectively like env vars in a unix context, depending on which file you choose/vars you load dictates what values are used. E.g. dev/prod etc.

---

<div class="post-metadata">

**Author:** ![gregatbci](https://avatars.discourse-cdn.com/v4/letter/g/cdc98d/32.png) [@gregatbci](https://community.n8n.io/u/gregatbci)\
**Post date:** [June 23, 2026, 2:48pm UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/7 "2026-06-23T14:48:57Z")

</div>

2 years later and I’m trying to see if I can figure out running a subflow to connect Microsoft Graph API multiple times for multiple customers.

I have OAuth2 credentials saved in n8n. What I had in mind approaching the problem was being able to pass the credential ID to use from main flow to subflow and have the subflow HTTP request look up that saved credential by ID.

Currently on n8n v2.20.6.

---

<div class="post-metadata">

**Author:** ![nguyenthieutoan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/nguyenthieutoan/32/120924_2.png) [@nguyenthieutoan](https://community.n8n.io/u/nguyenthieutoan)\
**Post date:** [June 23, 2026, 8:43pm UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/8 "2026-06-23T20:43:59Z")

</div>

@gregatbci for the Microsoft Graph API multi-tenant case, the workaround I use is storing each customer’s OAuth tokens (access\_token, refresh\_token, client\_id, client\_secret) in a database or encrypted key-value store, then retrieving them via a Code node at the start of the workflow. You then pass those values directly in the Authorization header of the HTTP Request node instead of using n8n’s saved credential object.

It’s not as clean as native credential switching, and you lose n8n’s automatic token refresh - so you’ll need to handle refresh logic in the Code node too. But it means one workflow serves all customers. Upvoted the feature request; this is a real gap for B2B embedding use cases.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [June 27, 2026, 6:03pm UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/9 "2026-06-27T18:03:27Z")

</div>

@gregatbci you could use credential overwrites so clients can single click to sign in. Keep in mind though our license only allows for internal business use only, if you are using clients credentials you will likely need a license.

you can read our license here: [Sustainable use license | Privacy and security | n8n Docs](https://docs.n8n.io/privacy-and-security/sustainable-use-license)

@nguyenthieutoan this may also apply to you.

if you do have a license you could reach out to your sales or technical contact and they can discuss what others do to achieve this.

---

<div class="post-metadata">

**Author:** ![Ahmad\_Shakir](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ahmad_shakir/32/178170_2.png) [@Ahmad\_Shakir](https://community.n8n.io/u/Ahmad_Shakir)\
**Post date:** [June 28, 2026, 1:51am UTC](https://community.n8n.io/t/reusable-flows-with-different-credentials-parameteraize-programatically/49239/10 "2026-06-28T01:51:58Z")

</div>

This is exactly where I’d avoid pushing raw tokens into the workflow.

The safer shape is: pass a client or workspace id into the reusable flow, resolve the saved credential in a runtime-owned boundary, then write a run receipt with client id, credential alias, workflow version, actor, and what changed. One flow stays reusable, but secrets and audit stay outside the editable workflow.
