FETCHING_N8N_SOURCE
Part of n8n debugging official. Install the skill and your agent reads this page when it needs the depth.
Fetching n8n source from GitHub
When a node's behavior contradicts docs or intuition, read the source. The code is truth, and n8n is source-available, so the repo is public.
The repo
https://github.com/n8n-io/n8n
n8n monorepo:
packages/cli/: CLI and runtime.packages/core/: workflow engine.packages/nodes-base/: built-in nodes.packages/@n8n/nodes-langchain/: AI nodes.packages/editor-ui/: web editor.packages/workflow/: data structures.
For node behavior, packages/nodes-base/nodes/<NodeName>.
How to find the relevant code
For a built-in node
packages/nodes-base/nodes/<Capitalized name>/
Examples:
packages/nodes-base/nodes/HttpRequest/packages/nodes-base/nodes/Postgres/packages/nodes-base/nodes/Slack/
Inside, you'll find:
<Name>.node.ts: main definition (parameters, operations, execute logic).descriptions/: parameter shape definitions, often by resource/operation.methods/: helper methods for resource lookups, etc.actions/: for some nodes, the actual operation implementations.
For execution / workflow logic
When the bug is about how n8n executes (timing, item handling, error propagation):
packages/core/src/WorkflowExecute.ts: core execution loop.packages/core/src/Workflow.ts: data structure and routing.packages/cli/src/commands/: CLI issues.
Denser. Start with node-level code unless the bug is clearly engine-level.
For the SDK
packages/@n8n/workflow-sdk/: SDK definition and types.
For "SDK function does X but seems to actually do Y."
Reading efficiently
Start at the entry point
For a node, <Name>.node.ts has the execute function or executeRouter map.
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
// ...node-specific logic
}
Most behavior lives in operation-specific files.
Search for the parameter
To figure out what a parameter does, find this.getNodeParameter('<name>', ...) in the node's source.
Watch for version branches
if (nodeVersion >= 2) {
// new behavior
} else {
// old behavior
}
Different version, different behavior. Check typeVersion in workflow JSON.
Useful patterns
Find when a feature was added
git log -p packages/nodes-base/nodes/<Name>/ | grep -A 5 -B 5 '<keyword>'
GitHub's "Blame" view shows which commit introduced each line. Click through for the PR description.
Cross-reference with the changelog
https://github.com/n8n-io/n8n/releases: per-version release notes.
Search for the exact error message
github.com/n8n-io/n8n: <error message>
The throw site shows the triggering condition. Often more specific than the message implies.
Reading the node's parameter description
Each node has properties defined as:
description: INodeTypeDescription = {
displayName: 'HTTP Request',
name: 'httpRequest',
properties: [
{
displayName: 'Method',
name: 'method',
type: 'options',
options: [...],
default: 'GET',
},
],
}
Each property has name, type, displayOptions (conditional visibility), default, required.
Read when:
- A parameter "isn't being recognized": check
displayOptions. - Unsure what values an option accepts: read
options. - Conditional requirement questions: read
displayOptions.show/hide.
When to fetch vs ask
Reading source is high-effort. The order:
- Check parameters via
get_node_typesandget_workflow_details. - Test with
prepare_workflow_pin_data, inspect viaget_workflow_execution. - Re-read user docs at
docs.n8n.io. - Search GitHub issues for similar reports.
- Then source.
~95% of weird behavior resolves before step 5.
Citing the source
When you find the cause:
- Cite file and line number.
- Quote the relevant snippet.
- Explain what the code does.
Example:
"HTTP Request strips the
Authorizationheader whenauthentication: 'none', even if added viaheaderParameters. Seepackages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:1247: headers are filtered after the auth check. Fix: use a Header Auth credential instead of inline headers."
Much more useful than "there might be an issue with headers." User can verify and learns to investigate similarly.
Reporting bugs upstream
For a confirmed bug:
- Search existing issues at
github.com/n8n-io/n8n/issuesfor the same symptom. - If none match, file a new issue at
github.com/n8n-io/n8n/issues/new. Include: clear repro, n8n version, expected vs actual, relevant source citation, and importantly, a disclaimer about using AI to create the issue. - Note the issue number (existing or newly filed) in workflow notes or
CLAUDE.mdso future readers know why a workaround exists. - Mark workarounds
<!-- TEMPORARY: ..., fixed in n8n X.Y.Z -->so maintainers can find and remove them after the fix ships.