Hi everyone,
I’m running self‑hosted n8n v2.19.5 on a VPS using Docker Compose. I’m trying to build a production‑ready lead‑gen workflow and ran into something confusing regarding environment variables inside node parameters.
Issue
When I try to reference an environment variable inside the Airtable node (Base → By ID), like this:
Code
{{$env.AIRTABLE_BASE_ID}}
…I get this error directly in the UI:
Code
[ERROR: access to env vars denied]
If I remove the expression brackets and just type plain text, the error disappears.
If I hardcode the Base ID, no error.
If I use $env.AIRTABLE_BASE_ID inside a Function node, it works fine.
So it seems like env vars are available to the runtime, but blocked in UI expressions.
Context
-
Self‑hosted n8n 2.19.5
-
Docker Compose deployment
-
Environment variables defined in
docker-compose.yml -
Airtable Personal Access Token credential works
-
“From List” dropdown throws 403 (expected due to Airtable scopes)
-
The only blocker is env var access inside node parameters
Questions
-
Is this expected behavior for the free self‑hosted version of n8n 2.x?
-
Are environment variables intentionally blocked in UI expressions unless using n8n Pro?
-
What is the recommended workaround for self‑hosted users who want reusable workflows (e.g., storing Base ID in credentials)?
-
Is there any official documentation explaining this restriction?
Goal
I want to build reusable workflows without hardcoding Base IDs, but I’m trying to understand whether this limitation is by design or if I misconfigured something.
Thanks in advance to anyone who can clarify how env vars are supposed to work in node parameters on self‑hosted 2.x
Information on your n8n setup
- n8n version: v2.19.5
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Compose
- Operating system: Ubuntu