# Adding Credentials through Workflow

**URL:** <https://community.n8n.io/t/adding-credentials-through-workflow/2239>\
**Category:** Questions\
**Created:** [September 3, 2020, 8:58am UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239 "2020-09-03T08:58:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asit\_Joshi](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/asit_joshi/32/1485_2.png) [@Asit\_Joshi](https://community.n8n.io/u/Asit_Joshi)\
**Post date:** [September 3, 2020, 8:58am UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239/1 "2020-09-03T08:58:19Z")

</div>

Hi there,

Just wanted to ask is there any way we can add credentials using a workflow having a webhook to receive the credentials?

Thanks

---

<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:** [September 3, 2020, 10:30am UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239/2 "2020-09-03T10:30:30Z")

</div>

No something like that is sadly currently not possible.

---

<div class="post-metadata">

**Author:** ![Asit\_Joshi](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/asit_joshi/32/1485_2.png) [@Asit\_Joshi](https://community.n8n.io/u/Asit_Joshi)\
**Post date:** [September 7, 2020, 5:37pm UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239/3 "2020-09-07T17:37:43Z")

</div>

Hi @jan

I was thinking of importing them via the **Execute Command Node**.  
Can we do something with the following command ?

```auto
echo "Creds Data Here" >> /home/node/.n8n/database.sqlite

```

Thanks

---

<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:** [September 7, 2020, 5:56pm UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239/4 "2020-09-07T17:56:25Z")

</div>

I guess something like that would destroy the file and the whole database would not work afterward anymore. So strongly advise against it.

The only thing you could do is to use the REST-API the Editor-UI uses. You can find it here:  
[n8n/Server.ts at master · n8n-io/n8n · GitHub](https://github.com/n8n-io/n8n/blob/master/packages/cli/src/Server.ts#L747) (line 747)  
If you send a POST request in the correct format there, it will create the credentials. You have to be however aware that it can theoretically change at any point as it is not an official API.

---

<div class="post-metadata">

**Author:** ![Asit\_Joshi](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/asit_joshi/32/1485_2.png) [@Asit\_Joshi](https://community.n8n.io/u/Asit_Joshi)\
**Post date:** [September 8, 2020, 4:55am UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239/5 "2020-09-08T04:55:13Z")

</div>

Thanks @jan for this. Will try this asap

---

<div class="post-metadata">

**Author:** ![EnCz](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/encz/32/1057_2.png) [@EnCz](https://community.n8n.io/u/EnCz)\
**Post date:** [September 8, 2020, 6:48am UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239/6 "2020-09-08T06:48:30Z")

</div>

I already asked something like that here: [Outsource Credentials](http://community.n8n.io/t/outsource-credentials/1298)

Sadly for us (because I would really **love** to use n8n in production) there is no official way to store credentials outside of the n8n application itself or pull them via a special node.

That’s, alone from a security-standpoint, not feasible in production. Credentials should be stored in a central storage and not be distributed wildly in different applications. I think every reasonably big company will agree.

Another obvious problem would be the missing User/Role-Management (only basic auth is a little bit too little) but we could live with that temporarily.

---

<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:** [September 8, 2020, 9:49am UTC](https://community.n8n.io/t/adding-credentials-through-workflow/2239/7 "2020-09-08T09:49:03Z")

</div>

Yes agree @EnCz. That it is currently for sure not perfect for large organizations. I hope we will find time soon to find a good solution for that.
