- Symptom
- [ERROR: access to env vars denied]$env.MY_VAR worked in 1.x and fails after upgradingSetting the variable on the main container has no effect with external task runners
- Cause
- n8n 2.0 flipped N8N_BLOCK_ENV_ACCESS_IN_NODE to true. With external task runners, Code node code runs in the runner container, so the setting and the variables must exist there too.
- Fix
- Prefer credentials or Variables over env access. If you need it, set N8N_BLOCK_ENV_ACCESS_IN_NODE=false on main and on the runner, and pass the variables to the runner container.
- Apply
services: n8n: environment: [N8N_BLOCK_ENV_ACCESS_IN_NODE=false] n8n-runners: environment: [N8N_BLOCK_ENV_ACCESS_IN_NODE=false, MY_VAR=value]- Affected
- n8n 2.0 and later; a UI false positive persisted until 2.29.0
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders