According to the docs, n8n has a meta variable $env that should output all ENVs that have been configured on the instance. But it is empty in both Edit Fields Node or Code node.
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
n8n version: 1.27.3, 1.34.2
Database (default: SQLite): Postgres
n8n EXECUTIONS_PROCESS setting (default: own, main): main
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
The $env variable does not return all set environment variables via an object, rather it allows you to access specific ones. So if you for example want to access the environment variable “MY_VAR” you can do that via:
That is correct. It returns only data that is actually set as an environment variable. Under the hood, all it does is access the data from process.env.