Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# =============================================================================
# n8n local development — minimal environment variables
# =============================================================================
# This is a minimal example covering some local environment variables for development.
# Many more variables exist — search for @Env() decorators in the codebase.
# Most of them already have default values, so you only need to fill in the ones you need to change.
#
# Usage (run from the repo root):
# 1. Copy this file: cp .env.local.example .env.local
# 2. Fill in the values below
# 3. Prefix any dev command with dotenvx, for example:
# pnpm exec dotenvx run -f .env.local -- pnpm dev:be
#
# Note: dotenvx supports variable expansion (e.g. $HOME) but not shell
# tilde expansion. Use $HOME instead of ~ for paths.
# =============================================================================

# -----------------------------------------------------------------------------
# Local data folder
# Source: packages/@n8n/config/src/utils/utils.ts
# -----------------------------------------------------------------------------
N8N_USER_FOLDER=

# -----------------------------------------------------------------------------
# License
# Source: packages/@n8n/config/src/configs/license.config.ts
# -----------------------------------------------------------------------------
# Tenant identifier for the license SDK (for example, self-hosted, sandbox, embed, cloud).
N8N_LICENSE_TENANT_ID=
# Activation key used to activate or upgrade the instance license.
N8N_LICENSE_ACTIVATION_KEY=
# Ephemeral license certificate.
N8N_LICENSE_CERT=

# -----------------------------------------------------------------------------
# AI
# Source: packages/@n8n/config/src/configs/ai.config.ts
# packages/@n8n/config/src/configs/ai-assistant.config.ts
# packages/@n8n/config/src/configs/ai-builder.config.ts
# -----------------------------------------------------------------------------
# Whether AI features (such as AI nodes and AI assistant) are enabled globally.
N8N_AI_ENABLED=
# Base URL of the AI assistant service.
# When set, requests are sent to this URL instead of the default provider endpoint.
N8N_AI_ASSISTANT_BASE_URL=
# Whether to persist AI workflow builder sessions to the database.
N8N_AI_PERSIST_BUILDER_SESSIONS=
# API key for the Anthropic (Claude) provider used by the AI workflow builder.
# When set, enables AI-powered workflow and node building.
N8N_AI_ANTHROPIC_KEY=

# -----------------------------------------------------------------------------
# LangSmith tracing (optional)
# Not an n8n config var — read directly by the LangChain SDK.
# See: https://docs.smith.langchain.com/
# -----------------------------------------------------------------------------
LANGSMITH_ENDPOINT=
LANGSMITH_PROJECT=
LANGSMITH_TRACING=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ yarn.lock
google-generated-credentials.json
_START_PACKAGE
.env
.env.local
.vscode/*
!.claude
!.vscode/extensions.json
Expand Down
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,26 @@ To start n8n execute:
pnpm start
```

### Environment variables (optional)

Most environment variables have default values, but if you needed to modify any a template for local environment variables is provided at `.env.local.example`. Copy it and fill in any values you need.

```bash
cp .env.local.example .env.local
```

Then prefix any dev command with `dotenvx` to load it, for example:

```bash
cd packages/cli && pnpm exec dotenvx run -f ../../.env.local -- pnpm dev

pnpm exec dotenvx run -f .env.local -- pnpm dev:be
```

> **Note:** dotenvx supports variable expansion (e.g. `$HOME`) but not shell
> tilde expansion. Use `$HOME` instead of `~` for paths
> (e.g. `N8N_USER_FOLDER=$HOME/.n8n-dev`).

## Development cycle

While iterating on n8n modules code, you can run `pnpm dev`. It will then
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"jest-junit": "^16.0.0",
"jest-mock": "^29.6.2",
"jest-mock-extended": "^3.0.4",
"@dotenvx/dotenvx": "^1.40.0",
"lefthook": "^1.7.15",
"license-checker": "^25.0.1",
"nock": "^14.0.1",
Expand Down
Loading
Loading