Creating custom credentials for Code nodes?

Hi! While I see n8n has great credential support for base/installed nodes, I’m trying to figure out if I can create custom credentials for use in Code nodes.

Specifically, I need to securely store and access authentication details (username/pass/API keys) for PowerShell scripts running in Code nodes. Rather than hardcoding these, can I leverage n8n’s credential manager?

Is this possible? If so, how do I:

  1. Create generic credentials in n8n?
  2. Access them in Code nodes?

Thanks!

n8n version: latest
db: default
running n8n via docker, self hosted on ubuntu 24

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @typera,

Welcome to the community :cake:

Oddly we have not had any requests like this before that I am aware of, At the moment this isn’t possible. How are you currently running powershell in your code node we only support javascript and python? Are you maybe using the execute command node instead?

1 Like

Hi @Jon , for powershell I am using the powershell node (GitHub - StarfallProjects/n8n-nodes-powershell: This is a custom node for n8n. It allows you to execute PowerShell commands within an n8n workflow.) however being able to pass credentials (securely) to javascript or python would also be handy.

1 Like

If you would like an example where it would be useful. I have one posted that adds a caldav entry to Next cloud here

https://community.n8n.io/t/adding-a-meeting-to-a-nextcloud-calendar-caldav/60524

1 Like

I am having this issue where when I search in credential to add api key of Eleven Labs it dont show any option so how can i add it or create a new custom authentication entry