# Set Credentials programmatically \[GOT CREATED\]

**URL:** <https://community.n8n.io/t/set-credentials-programmatically-got-created/1748>\
**Category:** Feature Requests (done)\
**Created:** [July 9, 2020, 4:15am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748 "2020-07-09T04:15:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndresWatson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/andreswatson/32/1345_2.png) [@AndresWatson](https://community.n8n.io/u/AndresWatson)\
**Post date:** [July 9, 2020, 4:15am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/1 "2020-07-09T04:15:50Z")

</div>

I’m trying to figure out if it is possible to set the credentials programmatically, for instance, I’m interested in the Pipedrive Node, I would like to create a Flow were the credential information is stored somewhere, maybe a database and I can take that string and use it dynamically in runtime in a Pipedrive Node as a variable, the credential. Make sense?

Thanks,  
Andrés Watson

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [July 9, 2020, 5:55am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/2 "2020-07-09T05:55:23Z")

</div>

It sounds similar to something which gets discussed here:

> [@Outsource Credentials](http://community.n8n.io/t/outsource-credentials/1298/2):
>
> Welcome to the forums @EnCz! This is an excellent idea and actually one that @jan and I spoke about a couple of weeks ago. I’m actually playing around with integrating a 3rd party password manager into my flows. Some of my candidates are: [Keepass](https://keepass.info/)[Dashlane](https://www.dashlane.com/)[Bitwarden](https://bitwarden.com/)[Lastpass](https://www.lastpass.com/)[1Password](https://1password.com/) I will probably end up creating some custom nodes around at least one of these solutions.

---

<div class="post-metadata">

**Author:** ![AndresWatson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/andreswatson/32/1345_2.png) [@AndresWatson](https://community.n8n.io/u/AndresWatson)\
**Post date:** [July 15, 2020, 8:57pm UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/3 "2020-07-15T20:57:57Z")

</div>

Great Jan. The idea is not to use a CUSTOM but use the NODES available in n8n. I understand that this could mean a different approach… maybe you can create a CREDENTIAL TYPE that when you use it, it requires to heritage the parameters… just talking laud, you are are one who knows…

The idea I have in mind is that I can use n8n as a middleware between an App I’m developing and the different other platforms, this is why I need to be able to dynamically set the credentials.

I think this could be useful for others too.

What do you think?

---

<div class="post-metadata">

**Author:** ![AndresWatson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/andreswatson/32/1345_2.png) [@AndresWatson](https://community.n8n.io/u/AndresWatson)\
**Post date:** [July 20, 2020, 2:13am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/4 "2020-07-20T02:13:38Z")

</div>

What do you think @RicardoE105 ?

---

<div class="post-metadata">

**Author:** ![Vitalie\_Svet](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/vitalie_svet/32/2061_2.png) [@Vitalie\_Svet](https://community.n8n.io/u/Vitalie_Svet)\
**Post date:** [October 8, 2020, 8:22am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/5 "2020-10-08T08:22:11Z")

</div>

Hello @AndresWatson have you found any solutions?  
At the moment I am looking how can I parametrize username/password for basicAuth in my workflow

---

<div class="post-metadata">

**Author:** ![Vitalie\_Svet](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/vitalie_svet/32/2061_2.png) [@Vitalie\_Svet](https://community.n8n.io/u/Vitalie_Svet)\
**Post date:** [October 8, 2020, 9:17am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/6 "2020-10-08T09:17:39Z")

</div>

Hello @jan ,  
I am new in using n8n and first of all want to say thank you for great product 👍  
It looks like my question is related to this post that why don’t want pollute or create duplication.  
Is it possible to use variable expression in node/credential parameters?  
I have a scenario that my workflow is triggered by webhook where from I receive url,username and password so I would like to pass them further.  
Example

 ![Selection_013](https://europe1.discourse-cdn.com/n8n/original/2X/4/4cd84b52e167816d0eeb2e2de4319a8e29c8ce80.png)

Thank you in advance,  
Vitalie.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [October 8, 2020, 11:55am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/7 "2020-10-08T11:55:53Z")

</div>

Welcome to the community @Vitalie_Svet!

Great to hear that you enjoy n8n!

What you want to do is currently sadly not possible. What can be done right now is to only write expressions which reference data from other parameters, from within the credentials but not from the workflow. Sorry!

---

<div class="post-metadata">

**Author:** ![Vitalie\_Svet](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/vitalie_svet/32/2061_2.png) [@Vitalie\_Svet](https://community.n8n.io/u/Vitalie_Svet)\
**Post date:** [October 8, 2020, 8:26pm UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/8 "2020-10-08T20:26:07Z")

</div>

Thank you for your response @jan , do you think this functionality could be added in the future releases?

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [October 8, 2020, 9:22pm UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/9 "2020-10-08T21:22:54Z")

</div>

Yes that for sure. Can see how that can be helpful for multiple use-cases. Please up-vote that we can prioritize it accordingly.

---

<div class="post-metadata">

**Author:** ![Vitalie\_Svet](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/vitalie_svet/32/2061_2.png) [@Vitalie\_Svet](https://community.n8n.io/u/Vitalie_Svet)\
**Post date:** [October 9, 2020, 7:15am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/10 "2020-10-09T07:15:53Z")

</div>

Ok great @jan .  
As a workaround I think to split this functionality in 2 workflows  
1st - takes input data and based on this creates workflow in DB (credential, worklfow and webhook tables) and send request to it  
2nd - will be the the workflow that will do main functionality

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [January 24, 2021, 12:46pm UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/11 "2021-01-24T12:46:35Z")

</div>

Did just add full expression support to credentials:

> <https://github.com/n8n-io/n8n/commit/1dedb3f4b87750aeea4e7b00ea2d5bf6b8258cc5>

That allows now to use any kind of flow data in credentials. The only limitation is that it uses always the data of the first item. So if there are two items the first one having `name: frank1`, the second `name: tom2` and credentials using the following expression `{{$json.name}}` it would use in the credentials only the value `frank1`.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [January 26, 2021, 11:54am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/12 "2021-01-26T11:54:52Z")

</div>

Got released with n8n@0.104.0

---

<div class="post-metadata">

**Author:** ![maxbaluev](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/maxbaluev/32/3258_2.png) [@maxbaluev](https://community.n8n.io/u/maxbaluev)\
**Post date:** [January 29, 2021, 8:29am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/13 "2021-01-29T08:29:52Z")

</div>

Is there any way to get credentials programmatically?

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [January 29, 2021, 8:34am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/14 "2021-01-29T08:34:06Z")

</div>

Can you please explain what you mean with that exactly and where.

---

<div class="post-metadata">

**Author:** ![dfatt](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/dfatt/32/3963_2.png) [@dfatt](https://community.n8n.io/u/dfatt)\
**Post date:** [March 23, 2021, 8:37am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/15 "2021-03-23T08:37:47Z")

</div>

@jan hi!  
i love your project, its amazing!

i want get data from credential for HTTP request node, i can do that? if you give short example, ive be very happy.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [March 23, 2021, 11:32am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/16 "2021-03-23T11:32:44Z")

</div>

Welcome to the community @dfatt!

Great to hear that you enjoy n8n!

Can you please explain what you want to do exactly.

---

<div class="post-metadata">

**Author:** ![dfatt](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/dfatt/32/3963_2.png) [@dfatt](https://community.n8n.io/u/dfatt)\
**Post date:** [March 23, 2021, 3:36pm UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/17 "2021-03-23T15:36:32Z")

</div>

@jan  
ok, for example i have trello node, but i cant get board members. so, i create http request and i have send request to Trello Rest Api. but, i need data from credentials.

now, i use node Set, and create some fields like key, token etc.

---

<div class="post-metadata">

**Author:** ![dfatt](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/dfatt/32/3963_2.png) [@dfatt](https://community.n8n.io/u/dfatt)\
**Post date:** [March 26, 2021, 8:16am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/18 "2021-03-26T08:16:05Z")

</div>

if you know - im very happy hear it.

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [March 26, 2021, 8:21am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/19 "2021-03-26T08:21:33Z")

</div>

Hey @dfatt!

If you have the values of your credentials in the Set node you can refer to these values while creating the credentials in the HTTP Request. Below is an example

I am using Header Auth here, but based on the API you’re using you can select the Authentication Method. I am referencing the value of the API key from the Set node.

 ![Screenshot 2021-03-26 at 9.20.52 AM](https://europe1.discourse-cdn.com/n8n/original/2X/3/31bceac98d8e40cf2740a4b4d745a74984a3f945.png)

---

<div class="post-metadata">

**Author:** ![thex3family](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/thex3family/32/4768_2.png) [@thex3family](https://community.n8n.io/u/thex3family)\
**Post date:** [June 10, 2021, 10:38am UTC](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748/20 "2021-06-10T10:38:20Z")

</div>

Hey Jan. I’m wondering if there is any update on this functionality because I have an use case where I will be passing on multiple credentials to pull data from the same node, but different workspaces.

So essentially,

Pull Credentials From Database (multiple) \> Enter credentials into node \> Get back multiple sets of data, each tagged to its own credentials \> …

Is this possible with the current N8N?

[Next page](https://community.n8n.io/t/set-credentials-programmatically-got-created/1748.md?page=2)
