Allow expression for credential selection

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 isn’t really secure.
If this feature isn’t added I am forced to duplicate my workflows for each n8n environment.
I really hate duplication :sweat_smile:

I think it would be beneficial to add this because:

More secure, more flexibility, and best of all less duplication. :slight_smile:

Any resources to support this?

Nope

Are you willing to work on this?

Willing to do the PR myself If I knew where to find the code that makes the selection possible. so far I have only found the credential type that is being set for the execution of the node, but not its ID.
Guessing I am looking in the wrong place.
Searching credentials is of course not really helpful as there is a lot of code referring to it. :slight_smile:

Completely agree, this would help make reusable generic subflows.

I think this might be covered with the new upcoming Environments feature.

1 Like

I don’t expect this be to in the environments feature. But we can hope of course. :slight_smile:

BTW this is similar to/dupe of Send Email / SMTP Credentials: Choose by ID number (and expression) with 9 votes now.

And Select credentials via expression with 12 votes.

1 Like

Good news is this will be coming, just not sure when.

4 Likes

is there any update on this feature?

@Yalcin_Ari not that I have seen but I will see if I can dig out the ticket to see if there is an update.

I look forward to that update. It will be great for me since I’m currently duplicating workflows for different credentials.

There is also a community node for this, it is not pretty but it works well. :slight_smile:

1 Like

I tried it – fantastic.

How to apply this to code node with api calls ?

I would like credetialls to pass within a node to do a complex chain of queries and filtering within a single code node. Since I noticed that filtering and queries combined in one node can be much faster.

1 Like

You cannot use credentials in code nodes so no there is no way to do that with this node either.

1 Like

Exatamente o que precisamos. Assim podemos simplificar workflows se precisar criar dezenas de cópias.

English only please.

any updates on this ??

1 Like