Use this when reusing values in n8n with instance variables.
Variables · n8n
Variables in n8n store reusable values such as base URLs at instance level, referenced as $vars.name, alongside workflow static data and expression variables.
1. Variables (instance variables, env vars) configure workflows across environments.
2. Use credentials for secrets.
3. Document variables.
4. Separate dev/prod instances.
5. Version workflows without hard-coded values.
variable → expressions/nodes
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Secrets stored as plain variables.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- $vars holds instance variables.
- Static data persists between runs.
- Expression variables exist per execution.
- $vars / environment variables usage — configuration
- Separation per environment — dev/prod
- No secrets in variables — use credentials
ReferenceWhy it matters1 section · depth on demand
What it is
n8n variables and environment settings hold shared values across workflows.
ReferenceImportant terms & boundaries1 section · depth on demand
How it works
Environment variables ($env.NAME) come from the n8n process; custom variables ($vars.NAME, paid plans) are set in the UI. Credentials should hold secrets, not variables.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in n8n > Variables. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.n8n.io/ · confidence 94%