-
Notifications
You must be signed in to change notification settings - Fork 0
Environment Variables
Logan McDuffie edited this page Dec 19, 2025
·
1 revision
n8n-cli can be configured using environment variables. These take precedence over saved configuration.
| Variable | Description | Default |
|---|---|---|
N8N_API_URL |
n8n instance URL | (from config file) |
N8N_API_KEY |
API authentication key | (from config file) |
N8N_CLI_FORMAT |
Default output format | json |
N8N_CLI_DEBUG |
Enable debug mode (show stack traces) | false |
N8N_API_URL=http://staging:5678 n8n-cli workflowsexport N8N_CLI_FORMAT=table
n8n-cli workflows # Uses table formatN8N_CLI_DEBUG=true n8n-cli workflowsFor CI/CD pipelines, set environment variables instead of using the config file:
# GitHub Actions example
env:
N8N_API_URL: ${{ secrets.N8N_API_URL }}
N8N_API_KEY: ${{ secrets.N8N_API_KEY }}
steps:
- run: n8n-cli workflows --activedocker run --rm \
-e N8N_API_URL=http://host.docker.internal:5678 \
-e N8N_API_KEY=your-api-key \
your-image n8n-cli workflowsConfiguration is loaded in this order (later values override earlier ones):
- Config file (
~/.config/n8n-cli/.env) - Environment variables
- Command-line flags