Environmental variables are showing up as access denied only in all workflows in one project folder

Describe the problem/error/question

Environmental variables are showing up as access denied but only in all workflows in one specific project folder. They are working in all other workflows in my other projects as expected. What’s weird is if I take the environmental variable that is fully operational in another project’s workflow and put it into any of the problematic project’s workflows, it then shows as access denied.

I also tried copying one of the troubled workflows from that project, creating a brand new workflow not in any project, and pasting it into that one and I still get the same error.

I found some information about incorporating these new environmental variables due to updated security measures implemented within N8N and the 2 Series version, but it still did not help with allowing access to the environmental variables.
N8N_BLOCK_ENV_ACCESS_IN_NODE=false
N8N_ENV_ALLOWLIST=...APIFY_API_KEY,...SHOPWARE_STORE_URL

I’ve tried various versions, but from my research, 2.1.2 was supposed to be the most reliable for environmental variable access within the version 2 series.

What is the error message (if any)?

”access to env vars denied” ex. below

Please share your workflow

{
“nodes”: [
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “c173eaf7-beda-47c4-8807-d509a2b10f98”,
“name”: “”,
“value”: “={{$env.APIFY_API_KEY}}”,
“type”: “string”
},
{
“id”: “452e4a42-6b41-4fac-8e87-1488724b6758”,
“name”: “”,
“value”: “={{ $env.SHOPWARE_API_KEY }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
2960,
-912
],
“id”: “31ce5ab8-0d58-47d6-9297-dfd977d61dfb”,
“name”: “Edit Fields1”
}
],
“connections”: {},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “30d02977055b9630e4f53a28e6ebd7b698c0c069296044305733d0ce012781da”
}
}

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

Any help would be greatly appreciated. Thank you in advance for your time and assistance.

1 Like

Hey @BigLexLost,

This is a tricky one — the fact that env vars work in other projects but fail in one specific project folder suggests it’s likely a project-level permissions issue rather than a global config problem.

A few things to check:

1. Project ownership/permissions

In n8n 2.x with projects, each project can have different permission levels. Check if the problematic project has different owner/member settings that might be restricting env var access. Go to Project Settings → check the permissions.

2. Try recreating the project

Since you mentioned copying workflows into a brand new workflow (not in any project) still fails — this suggests the workflow itself might have cached metadata pointing to the old project context. Try:

  • Create a completely new project
    • Create a new workflow from scratch in that project
      • Manually add the nodes (don’t copy/paste the JSON)
        • Test env var access
      • 3. Check for project-specific env var overrides
      • Some n8n setups allow project-level environment configurations. Verify there’s no project-specific .env or config that’s overriding your global settings.
    • 4. Database cleanup (if comfortable)
    • Since you’re on Postgres, there might be stale project metadata. You could check if the project has any unusual flags in the database, though this is more advanced.
  • 5. Version consideration
  • You mentioned 2.1.2 — there were some env var permission bugs in early 2.x releases. Consider trying 2.2.x or later if the above doesn’t work.

Let me know what you find — happy to dig deeper once we narrow it down.