n8n

Workflow automation for technical teams.

Architecture rules name the lint checks that enforce them, including a baseline that can only shrink.

Documents

├── 
├──  · imports AGENTS.md
├── .agents
│   └── skills
│       └── 
├── .claude
│   └── plugins
│       └── n8n
│           └── 
├── .devcontainer
│   └── codespaces
│       └── 
├── .github
│   ├──  · imports ../AGENTS.md
│   ├── 
│   ├── 
│   └── 
├── packages
│   ├── @n8n
│   │   ├── agents
│   │   │   └── 
│   │   ├── ai-utilities
│   │   │   └── 
│   │   ├── ai-workflow-builder.ee
│   │   │   ├── 
│   │   │   └──  · same content as CLAUDE.md · imports AGENTS.md
│   │   ├── db
│   │   │   └── 
│   │   ├── engine
│   │   │   └── 
│   │   ├── instance-ai
│   │   │   └── 
│   │   ├── module-cli
│   │   │   └── 
│   │   └── node-cli
│   │       └── src
│   │           └── template
│   │               └── templates
│   │                   └── shared
│   │                       └── default
│   │                           ├── 
│   │                           └──  · same content as CLAUDE.md · imports AGENTS.md
│   ├── cli
│   │   ├── src
│   │   │   └── modules
│   │   │       └── n8n-packages
│   │   │           └── 
│   │   └── 
│   ├── frontend
│   │   ├── @n8n
│   │   │   └── design-system
│   │   │       └── 
│   │   ├── editor-ui
│   │   │   └── src
│   │   │       └── app
│   │   │           └── stores
│   │   │               └── workflowDocument
│   │   │                   └── 
│   │   ├── 
│   │   └──  · same content as CLAUDE.md · imports AGENTS.md
│   ├── nodes-base
│   │   ├── 
│   │   └──  · same content as CLAUDE.md · imports AGENTS.md
│   └── testing
│       ├── janitor
│       │   ├──  · imports README.md
│       │   └── 
│       └── playwright
│           ├── 
│           ├──  · same content as CLAUDE.md · imports AGENTS.md
│           └── 
└── scripts
    ├── backend-module
    │   └── 
    └── instance-seeding
        └── 

The file, explained

What makes it useful

n8n's root guide covers setup, package architecture, testing, and public contribution practices. Its architecture sections describe boundaries around persistence, encryption, and lint configuration. They name prohibited workarounds as well as the intended API, while command guidance accounts for memory limits, large logs, package-local checks, and shared runtime state in tests.

Techniques in this file

Quoted passages are verbatim. Open one to see it in the source.

01 / Architecture as narrative

Keep persistence behind domain methods

The TypeORM boundary requires use-case-named repository methods with plain inputs and domain-shaped results. Renaming imports or hiding query builders in services does not satisfy the boundary.

Source excerpt starting at line 244.
- **Pattern:** when a query needs operators (`In`, `IsNull`, `LessThan`,  `FindOptionsWhere`, …), put it behind a **use-case-named repository method**  that takes plain parameters and returns domain-shaped values — not a generic  `find(options)` passthrough.

02 / Ratchets

Prevent quiet downgrades of lint policy

Because lint runs with --quiet, a package-wide downgrade to warning would look configured while enforcing nothing. The file connects this to a shared rule and a shrinking debt baseline.

Source excerpt starting at line 283.
raises rules to `error`, and blocks scoped to `files`. It must not turn a ruledown for the whole package: every lint script runs with `--quiet`, so a `warn`enforces nothing and reads as if it did. The code-health rule`lint-config-layering` enforces this, with existing debt in`.code-health-baseline.json`, which only shrinks.

03 / Hard prohibitions

Explain irreversible key loss

The encryption section gives both the data consequence and the enforcement points for its no-deletion rule. Deactivation is the intended operation.

Source excerpt starting at line 307.
- **Deployment keys are never deleted** — data encrypted with a key becomes  unreadable without it. Deactivate keys instead; the repository's delete  surface throws at runtime and the lint rule rejects call sites.

04 / Good and bad pairs

Show the direction of graph connections

A parent-node lookup needs an inverted connection map; a child lookup uses the original map. The worked code ties the shared helper to the data structure's indexing direction.

Source excerpt starting at line 201.
**Key concept:** `workflow.connections` is indexed by **source node**.To find parent nodes, use `mapConnectionsByDestination()` to invert it first.

05 / Context budgeting

Design setup output for constrained agents

The setup command caps memory and concurrency, writes logs, and always produces a machine-readable summary. The file explains how to inspect a run without loading all its output.

Source excerpt starting at line 71.
hand. It chains them in one process, caps per-process memory and turboconcurrency so a 6GB box doesn't OOM, streams all output to`.agent-setup/<step>.log` (gitignored), and surfaces only a one-line summaryper step plus the tail of the failing log. A machine-readable`.agent-setup/summary.json` is always written so a backgrounded run isreadable in a single shot — no polling, no scrolling logs.

Put it to work

Borrow this for your repo

  1. Name enforcement mechanisms alongside architectural rules.
  2. Call out workarounds that conceal a forbidden dependency.
  3. Make technical-debt baselines decrease-only.
  4. Pair shared utility names with an example of the data they expect.
  5. Give long-running setup a bounded summary and durable logs.

How the file is organized

  1. 01Project Overview
  2. 02General Guidelines
  3. 03Agent Skills and Claude Code Plugin
  4. 04Essential Commands
  5. 05Architecture Overview
  6. 06Technology Stack
  7. 07Key Development Patterns
  8. 08Design Principles
  9. 09Github Guidelines
Read this revision on GitHub ↗

Context your instructions cannot carry

n8n's file tells an agent how the codebase works. It cannot tell it which bug three customers hit this week. Modem keeps that context current and attaches it to the work.

Try Modem