n8n debugging official
Use when an n8n workflow isn't working, errors appear, results don't match what was expected, or the user says "this isn't working." Triggers on errors, unexpected output, "it's not working", "why is this happening", "the workflow stopped", failure investigation, or any debugging context.
By- name:
- n8n-debugging-official
- description:
- Use when an n8n workflow isn't working, errors appear, results don't match what was expected, or the user says "this isn't working." Triggers on errors, unexpected output, "it's not working", "why is this happening", "the workflow stopped", failure investigation, or any debugging context.
n8n Debugging
When something breaks, the cause is almost always:
- Parameter misconfiguration (wrong value, wrong type, missing field).
- Stale assumptions (different version, different behavior than you remember).
- Paths misconfigured or misconnected (wrong output index, wrong merge input, missing wire, IF/Switch wired to the wrong branch).
- Upstream data stripped (an intermediate node replaced
$jsonwith its own output, so downstream$json.xresolves to null even though "it should be there"). Fix: reference the stable upstream node by name ($('Earlier Node').item.json.x). - Item context lost (after Aggregate, Execute Once, or Split Out flows, n8n can't pair
.itemreferences deterministically, error reads like "The expression is referencing... multiple matching items"). Fix: Merge node to re-establish context,$input.all().find(...)for explicit lookup, or redesign to keep item correspondence stable (e.g., split into stateless sub-workflows). - Logical errors (the wires are right and the parameters are right, but the workflow does the wrong thing, same as a logic bug in code).
- Genuine bug (rare but real).
Diagnose systematically: cheap checks first, deeper investigation only when those fail.
Non-negotiable
Believe the user. "This isn't working" means something isn't behaving as they expect, even if they describe the symptom imprecisely. Don't dismiss with "it should work" or "are you sure you're doing X?". Investigate first: the user is truth about what should happen, execution data and source are truth about what is happening. When you can't find the cause, "I don't know yet" beats a plausible-sounding fabrication.
Strong defaults (cause to cheap check)
Match cause to cheap check, in order of likelihood:
- Parameter misconfiguration → re-fetch via
get_node_types, compare againstget_workflow_details, look for type/value/missing-field mismatches.validate_node_configon the failing node alone returns per-parameter errors directly; faster than eyeballing the diff for nodes with deep / conditional shapes.<!-- TEMPORARY: when instance metadata tool is added, change asking user to just using the tool --> - Stale assumptions → ask the n8n version, ask when the user last updated the skills plugin, suspect drift if behavior contradicts the skill.
- Paths misconfigured or misconnected → inspect the
connectionsobject viaget_workflow_details. For Merge input mismatches, seen8n-node-configuration-officialreferences/MERGE_NODE.md. - Upstream data stripped → trace
$json.xreferences back through the chain, look for any node that replaces the json with its own output. Common offenders: Aggregate, HTTP-binary, Extract from File, Code in "Run for All Items" mode, branching Merge. Not exhaustive: any node can do this if its output shape doesn't include the upstream fields. - Item context lost → check downstream of any Aggregate / Execute Once / Split Out for
.itemreferences, switch to$input.all().find(...)or a Merge anchor. - Logical errors → trace data through
get_workflow_executionstep by step, compare each node's output vs. expected. - Genuine bug → fall through to reading the n8n source, then GitHub issues, then a workaround.
For external API problems, the upstream service's API docs (not n8n's wrapper) are the truth. Fetch API docs and n8n's source code to debug if required.
Step-by-step walkthrough
When the cheap checks above don't immediately pinpoint the cause, work through these in order.
Step 1: confirm the symptom
Ask:
- What did they expect?
- What actually happened?
- Error message text?
- When did it last work? What changed since?
Vague ("it's broken") becomes tractable when concrete ("email sends to wrong address" or "workflow returns 500 with empty body").
Step 2: check the execution
get_workflow_execution({ executionId: <execution_id>, workflowId: <workflow_id>, includeData: true })
Look at:
- Which node failed?
- What input did it have?
- What error message? Read carefully. Usually points at the cause.
No execution ID? Ask the user to re-run.
Step 3: re-fetch the workflow
get_workflow_details({ workflowId: <workflow_id> })
Confirm the actual current state. The user might be looking at a different workflow or remembering a stale version.
Compare:
- Nodes vs. the user's mental model.
- Connections vs. intent: pull via
get_workflow_detailsand compare theconnectionsobject to the SDK code. - Credentials vs. expected (per
n8n-credentials-and-security-official). - Upstream-strip risk: any node between a data source and a downstream
$json.xconsumer that replaces the json with its own output? Common offenders are HTTP-binary, Extract from File, Aggregate, Code in "Run for All Items" mode, and branching Merge, but any node can do this if its output shape doesn't include the upstream fields. The consumer should reference the source node by name ($('Source Node').item.json.x), not$json. Otherwise the field silently resolves to null. - Item-context risk: any Aggregate / Execute Once / Split Out followed by downstream
.itemreferences? n8n may not be able to pair items deterministically. Look for "The expression is referencing... multiple matching items" in past executions.
Step 4: re-fetch the node types
get_node_types([{ name: '<failed-node>', resource: '...', operation: '...' }])
Compare actual parameter shape vs. configured. Common mismatches:
- Missing required parameter.
- Wrong type (string vs. number, etc.).
objectandarrayare distinct in n8n's UI type dropdowns (Set, IF, Switch, Filter, anywhere the UI asks you to pick a type). Pickingobjectwon't accept an array value, and vice versa. Inside expressions themselves it's normal JS (arrays are objects), so the distinction only bites at those UI type-pick surfaces. Watch for this when a={{ ... }}expression returns the wrong container shape for a typed slot.- A dependent parameter set without its parent (e.g.,
credentialswithoutauthentication !== 'none', orquerywithoutoperation === 'executeQuery'). Re-fetch withget_node_typespassing the right discriminators.
If the manual shape-vs-config diff is tedious (deep params, AI tool subnodes, many conditional branches), run validate_node_config directly. Returns { path, message } per failure. For tool subnodes set isToolNode: true.
Step 5: test with pinned data
prepare_workflow_pin_data({ workflowId: '<id>' })
test_workflow({ workflowId: '<id>' })
Controlled input isolates "workflow broken?" from "input weird?". If pinned data works but real input fails, the issue is in real input handling.
If pinned data also produces wrong output, that's likely a logical error: trace each node's output against what you expected. get_workflow_execution on the test run gives you the actual emitted data per step, which is the source of truth for what each node did.
Step 6: read the n8n source
When everything checks out and behavior still seems wrong:
github.com/n8n-io/n8n
packages/nodes-base/nodes/<NodeName>for built-in nodes.packages/cli/src/...for execution logic.packages/core/src/...for workflow runtime.
The behavior of the code is truth.
See references/FETCHING_N8N_SOURCE.md.
Step 7: suspect drift on either side
If steps 1-6 all check out and behavior still doesn't match expectations, version drift is the most likely remaining cause. Two sides drift independently:
<!-- TEMPORARY: when instance metadata tool is added, change asking user to just using the tool -->- Their n8n instance version. Ask. (UI:
Settings → About, orGET /rest/settings.) On older instances, parameters and tools the skill assumes may be missing; on very new ones, parameter shapes or tool names may have moved. Suggest updating to the latest n8n release, or if a fix is rumored or the issue is recent, the latest beta. - This skill plugin's version. These skills drift relative to n8n over time. If the user installed the plugin a while ago, suggest
git pull(or the plugin manager's update command) on the skills repo. See the README's "Drift" section.
Drift surfaces as: parameter shape mismatches in get_node_types, MCP tools that don't exist or carry new parameters, tool descriptions that contradict what the skill teaches, behavior diverging from the skill's claims. When you spot any of those, surface drift explicitly to the user: "This may be drift between your n8n version and these skills. Can you tell me your n8n version, and when you last updated the skills?"
If after updating both sides the issue persists, proceed to Step 8.
Step 8: report or workaround
For confirmed bugs:
- Have the user post a question on https://community.n8n.io
- Surface a clear repro to the user.
- Check n8n GitHub issues. May already be filed.
- If blocking, work around (different node/approach) and note in workflow notes.
- If a fix is in progress, mark workarounds with
<!-- TEMPORARY: ... -->
Reference files
| File | Read when |
|---|---|
references/PARAMETER_VERIFICATION.md |
Parameters might be misconfigured, need a systematic re-check |
references/FETCHING_N8N_SOURCE.md |
n8n behavior contradicts docs, need to read the actual code |
Anti-patterns
| Anti-pattern | What goes wrong | Fix |
|---|---|---|
| "It should work, are you sure you're doing X?" | Dismisses the user's report, misses real issues | Believe the user. Investigate. |
| Re-running without checking the execution | Same failure twice, no new info | get_workflow_execution on the failed run, read the error |
| Assuming docs are accurate when behavior contradicts | Accepting the wrong mental model | Read the source. Behavior is truth |
| Re-implementing logic in a Code node when a configured node fails | Hides the bug, doesn't fix root cause | Diagnose first, only work around when the bug is confirmed |
| Bisecting by deleting nodes randomly | Wastes time | Step through get_workflow_execution to find the failed node directly |
| Asking the user to re-screenshot instead of inspecting via MCP | Slow, error-prone | Use get_workflow_details and get_workflow_execution |
| Calling it "fixed" when you've worked around the bug, not understood it | Bug recurs in slightly different form | Document the cause. If working around, mark with <!-- TEMPORARY: --> |
| Declaring a "bug" without asking the user's n8n version or when they last updated the skills | Real cause is often drift, and user updates and the "bug" disappears | Ask both versions before reporting. See Step 7. |
Open this reference as its own page
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.
Open this reference as its own page
Parameter verification
The most common cause of "this isn't working" is a misconfigured parameter.
The four checks
1. Is the parameter present?
get_workflow_details({ workflowId: <id> })
Look at the failing node's parameters. Is the field actually there?
Common mistake: a parameter set via UI then dropped when the workflow is regenerated from SDK code.
2. Is the value the right type?
Some nodes are strict:
- Numbers as numbers, not
"100". - Booleans as booleans, not
"true". - Arrays as arrays, even for single values.
Wrap expressions in {{ }} to force evaluation:
field: 100 # might be string
field: {{ 100 }} # definitely number
3. Is the parameter conditional on another?
Many parameters only apply when a parent has a specific value:
- HTTP Request
credentialsrequiresauthentication !== 'none'. - Postgres
queryrequiresoperation === 'executeQuery'. - Slack
channelIdrequiresselect === 'channel'.
If parent Y is wrong, X is ignored.
4. Does the shape match the current node version?
get_node_types([{ name: '<node>', resource: '<r>', operation: '<o>' }])
Compare returned shape vs. workflow parameters. Renames, restructuring, or major-version changes can leave the workflow on an old shape.
Operation-aware checks
Most nodes have (resource, operation) pairs that change parameter shape. Always pass discriminators to get_node_types. Otherwise the generic shape may miss operation-specific fields.
Shortcut: run all four checks at once
validate_node_config([{ type, typeVersion, parameters, isToolNode? }]) runs the same Zod schema as validate_workflow on a single node config. Returns { path, message } per failure: missing required fields, wrong types, dependent params without their parent. Useful when shape-vs-config diffing is slow (deep params, nested displayOptions, AI tool subnodes). For tool subnodes, set isToolNode: true.
Schema-level only: doesn't catch connection bugs, missing credentials, or runtime data issues.
Credential checks
For auth errors:
get_workflow_details → failing node's `credentials` reference
What MCP can see on the node:
idmatches an expected credential reference.- Credential type matches what the node expects (e.g., Slack expects
slackOAuth2Api, notslackApi).
What MCP can see (via list_credentials): id, name, type, scopes, project. Use it to confirm a referenced credential still exists.
What MCP can't see: credential contents and live OAuth token state. Credential creation is still UI-only (no MCP tool, no public API). Ask the user when those are needed.
OAuth note: n8n auto-refreshes OAuth tokens. The user does not need to re-authenticate periodically. Persistent token errors usually mean the auth setup is wrong (incorrect type, missing scopes, app revoked on the upstream) or the upstream is rejecting the token, not that n8n forgot to refresh.
Connection (wiring) checks
validate_workflow doesn't catch wiring traps. Manual checks via get_workflow_details:
- Is a Merge
numberOfInputsleft at the default 2 when 3+ sources converge? →n8n-node-configuration-officialreferences/MERGE_NODE.md - Is
useDataOfInputset to a value that doesn't match the wire feeding that input? →n8n-node-configuration-officialreferences/MERGE_NODE.md - Is
onError: 'continueErrorOutput'set on the node butmain[1]empty, or vice versa? →n8n-error-handling-officialreferences/NODE_ERROR_OUTPUTS.md
These don't surface as parameter errors. The node runs with bad input. Always inspect connections after a failed update.
Input data checks
get_workflow_execution({ executionId: <execution_id>, workflowId: <workflow_id>, includeData: true })
Inspect the failing node's input. If it's wrong:
- Trace upstream: which node produced it?
- Was upstream's expression correct? Did
$jsonresolve as expected? - Did a conditional branch send the wrong path?
"Node broken" often means "node given garbage."
Authentication-specific debugging
- 401: missing, expired, or wrong-type credential.
- 403: valid credential without permission. Check scopes on the upstream service.
- 400 with auth message: wrong header format or auth mode. Re-fetch HTTP Request shape, verify
authenticationandgenericAuthType. - No error, no data: silently authenticated as a different user (e.g.,
anoninstead ofservice_role).
Pagination check
If a query "doesn't return enough":
- Round-number result count (10, 50, 100): pagination.
- Look for
next_cursor/next_page/has_morein the response. - Is the node configured to follow pagination?
Type-specific gotchas
- Big integers: IDs above
Number.MAX_SAFE_INTEGERlose precision as numbers. Use strings. - Date strings: confirm format matches what the node expects.
- JSON-in-string: some APIs return JSON-encoded strings, so
JSON.parseto use. - Empty vs null vs missing: different things, and nodes treat them inconsistently. Check the actual value.
Worked example
User: "the Postgres query returns nothing but I know there are matching rows."
get_workflow_execution({ executionId, workflowId, includeData: true })→ Postgres ran successfully, returned 0 rows.get_workflow_details({ workflowId })→ querySELECT * FROM users WHERE email = $1, parameter$1 = '={{ $json.email }}'.- Execution input:
email = "User@Example.com"(capital U). - DB stores lowercase:
user@example.com. - Fix:
={{ $json.email.toLowerCase() }}.
Not workflow logic, but input not matching data. Without inspecting actual input, this would've taken much longer.
Don't skip the basics
The user's instinct is to look at the most-recently-changed thing. Often right, not always. The diagnostic order (execution, workflow details, node types, input) covers most-common to least-common systematically.
More in this playbook
Safe to turn on
Use this skill when an agent or person is about to create, change or enable an automation inside someone else's account or a shared environment: "create this workflow", "build it in the customer's account", "turn it on", "go live", "deploy this automation". Produces a proposal the human approves, an automation created in the off state, and a short list of what only the human can finish.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.


