n8n node configuration official
Use when configuring any n8n node: HTTP, webhooks, database, comms (Slack/Gmail/Discord), AI, triggers, Merge, anything. Triggers on any node-builder call (`node(...)`, `trigger(...)`, `tool(...)`, `memory(...)`, `languageModel(...)`, `ifElse(...)`, `merge(...)`, etc.), configuring a parameter, `useDataOfInput`, `numberOfInputs`, fan-in convergence, or any node-specific debugging.
By- name:
- n8n-node-configuration-official
- description:
- Use when configuring any n8n node: HTTP, webhooks, database, comms (Slack/Gmail/Discord), AI, triggers, Merge, anything. Triggers on any node-builder call (`node(...)`, `trigger(...)`, `tool(...)`, `memory(...)`, `languageModel(...)`, `ifElse(...)`, `merge(...)`, etc.), configuring a parameter, `useDataOfInput`, `numberOfInputs`, fan-in convergence, or any node-specific debugging.
n8n Node Configuration
Each n8n node has its own parameter shape, often with conditional fields (parameter X only matters when parameter Y has value Z). Shapes evolve between versions. Guessing produces cryptic validation errors.
Don't guess, use the get_node_types tool.
Non-negotiable
Call get_node_types with discriminators (resource, operation, mode) before configuring a node. Without discriminators you get the generic shape, missing operation-specific parameters and required fields. Build against the exact shape. Don't guess from memory.
The live get_node_types output is the canonical parameter shape. The references in this skill cover patterns, gotchas, security rules, and decision-making (when to use which operation, why credentials over text fields, engine retry caps, etc.) not parameter names or field structures. If a reference example conflicts with what get_node_types returns, trust the tool. Markdown drifts; the type def is generated from the live source.
Never guess resource-locator or load-options values. When get_node_types shows a param with @searchListMethod or @loadOptionsMethod (Slack channels, Sheets tabs/docs, DB tables/columns, model lists, labels), resolve the real value with explore_node_resources (pass a credentialId from list_credentials) and use a returned value. If you already know the exact ID, use it; if several match and intent is ambiguous, ask the user. An invented ID validates but points at nothing. Exception: toolWorkflow.workflowId has no search method, resolve it via search_workflows and use mode: 'id'.
Strong defaults
- Configure operation-first. Set
resourceandoperationfirst, and conditional parameters become visible. Most "field doesn't exist" errors are really "you haven't set the parent operation yet." - Don't carry parameters across operations. When changing
operation, re-derive from the new shape. Stale parameters from the previous operation trip validation.
The flow for any new node
1. search_nodes(['<capability keyword>'])
→ returns matching node IDs + discriminators
2. Pick the right (resource, operation) for the task.
3. get_node_types([{ name: '...', resource: '...', operation: '...' }])
→ returns exact parameter shape including conditional fields
4. For any RLC / load-options param in that shape, ground the real value:
explore_node_resources({ nodeType, version, methodName, methodType, credentialType, credentialId, currentNodeParameters? })
→ use a returned `value`. Don't invent IDs.
5. Build the node config from that shape.
6. validate_workflow → fix errors.
7. get_workflow_details → inspect the saved config; confirm parameters landed.
8. test_workflow with pinned data → confirm runtime behavior.
Skipping any step compounds the next. The most common skip is step 3, leading to "Cannot read property X" errors that are really "you didn't pass the discriminators."
validate_node_config as a side-channel
validate_node_config([{ type, typeVersion, parameters, isToolNode? }]) runs the same Zod schema as validate_workflow on isolated node configs. Schema-level only; doesn't replace validate_workflow (still the publish gate). Cleaner signal for:
- Iterating on a single node mid-build. Faster than re-running
validate_workflowper tweak. - Small edits to an existing workflow. Wiring unchanged? Check the one node you touched; full validate before publish.
- Debugging a misconfigured node. Per-parameter errors with no graph noise.
For tool subnodes (wired via ai_tool), set isToolNode: true so the correct displayOptions branch evaluates.
Operation-aware configuration
Most nodes have a top-level shape like:
{
resource: '<thing being operated on>', // 'message', 'spreadsheet', 'user', etc.
operation: '<verb>', // 'send', 'append', 'lookup', etc.
// ...operation-specific parameters
}
The (resource, operation) pair determines what other parameters exist (e.g., Slack (message, send) differs from (user, info)).
Pattern:
- Set
resourceandoperationfirst. - Re-fetch
get_node_typeswith those discriminators if you didn't initially. - Configure the rest from the operation-specific shape.
Property dependencies: the subtle trap
Some parameters depend on others in non-obvious ways:
- A field is required only when another field has a specific value.
- A field accepts different types depending on a mode.
- A field's options come from another field's value.
Examples:
- HTTP Request
authentication: 'genericCredentialType'requiresgenericAuthTypeandcredentials, but'predefinedCredentialType'requires a different shape. - Postgres
operation: 'executeQuery'requiresquery, whileoperation: 'select'requirestableandcolumns. - Slack
messageType: 'block'enables block-builder fields absent frommessageType: 'text'.
Always inspect via get_node_types for the specific operation. Don't reuse a config from a different operation and expect it to validate.
Options-from-another-field is a @loadOptionsMethod: resolve the live options with explore_node_resources (methodType: 'loadOptions'), passing prior selections via currentNodeParameters when the method depends on them (e.g. listing a spreadsheet's tabs needs documentId).
Reference files
Per-category gotchas. Read the file for the node type you're configuring:
| File | When to read |
|---|---|
references/HTTP_NODES.md |
Configuring HTTP Request: auth, pagination, query/body parameters, retries |
references/WEBHOOK_NODES.md |
Configuring Webhook trigger or Respond to Webhook: body parsing, response shape, async patterns |
references/COMMS_NODES.md |
Slack, Gmail, Discord, email: credential types, message shapes, attachments |
references/DATABASE_NODES.md |
Postgres, MySQL, Mongo, Supabase: query vs operation, parameter binding, error handling |
references/AI_NODES.md |
AI Agent node config knobs: streaming, vision, maxIterations, retries on the model sub-node. Defers design (prompts, tools, memory, structured output) to n8n-ai-nodes-official |
references/TRIGGER_NODES.md |
Webhook, Schedule, Manual, Execute Workflow Trigger: input schemas, polling vs realtime |
references/SWITCH_FALLBACK.md |
Configuring a Switch node: unnamed outputs / missing fallback silently drop unmatched items |
references/MERGE_NODE.md |
Configuring a Merge node, or you see useDataOfInput, numberOfInputs, or branches converging |
Anti-patterns
| Anti-pattern | What goes wrong | Fix |
|---|---|---|
| Building node config from memory of how the node looked last year | Parameter shape has drifted, validation fails with cryptic errors | Always get_node_types per session per node |
Skipping discriminators in get_node_types |
Get generic shape, miss operation-specific required fields | Always pass resource + operation (and mode where present) |
| Copying a node config from one operation to another and tweaking | Stale parameters trip validation, and conditional fields don't apply | Re-derive from the new operation's shape |
| Hardcoding tokens / credentials in node text fields | Leaks on export. See n8n-credentials-and-security-official |
Always credentials |
Not testing the node with test_workflow after configuring |
Runtime errors only surface on real data | Always test with pinned data before publish |
Open this reference as its own page
AI Agent node: configuration gotchas
The AI Agent node (@n8n/n8n-nodes-langchain.agent) is the load-bearing node for AI features in n8n. For design depth, read the n8n-ai-nodes-official skill first. This file only covers Agent-node-configuration knobs and runtime gotchas not in that skill.
| For | Read |
|---|---|
| When to use Agent vs other AI nodes | n8n-ai-nodes-official SKILL.md |
| Sub-node pattern (model, memory, tools, outputParser) | n8n-ai-nodes-official SKILL.md |
| System prompt design | n8n-ai-nodes-official SYSTEM_PROMPT.md |
| Tool design and the four tool types | n8n-ai-nodes-official TOOLS.md |
| Sub-workflow as tool | n8n-ai-nodes-official SUBWORKFLOW_AS_TOOL.md |
| Memory backend choice and sessionId | n8n-ai-nodes-official MEMORY.md |
| Structured output: parser + autoFix | n8n-ai-nodes-official STRUCTURED_OUTPUT.md |
| Human review on tools | n8n-ai-nodes-official HUMAN_REVIEW.md |
| Slack / Discord / Teams / Telegram surfaces | n8n-ai-nodes-official CHAT_SURFACE_PATTERNS.md |
| RAG primitives | n8n-ai-nodes-official RAG.md |
| Binary in agent tools | n8n-binary-and-data-official AGENT_TOOL_BINARY.md |
Always inspect the node first
get_node_types([{ nodeId: '@n8n/n8n-nodes-langchain.agent' }]). The Agent's parameter shape evolves often (new sub-node slots, new option fields, new built-in tools). Build against the live shape.
Streaming
n8n streams Agent responses end-to-end when the trigger and responder both support it:
- Trigger: Chat Trigger with
options.responseMode: 'streaming'(default whenavailableInChat: true), or Webhook withresponseMode: 'streaming'. - Agent:
options.enableStreaming: true(default). - Responder (when needed): Respond to Webhook with
options.enableStreaming: true(default).
When all three are aligned, tokens flow to the caller as the agent generates them.
Vision / multimodal
options.passthroughBinaryImages: true (default) lets the model see uploaded images as image-type messages. Pair with a vision-capable model.
Only the model can see binary. Tools cannot receive it. For tools that need uploaded files, see n8n-binary-and-data-official AGENT_TOOL_BINARY.md.
Iteration cap
options.maxIterations defaults to 10, which is low for modern agents with flexible tool sets. Raise it (30-50+) for any non-trivial multi-tool agent. Hitting the cap throws a workflow error (Max iterations (N) reached).
Deterministic tasks
Set temperature: 0 on the model sub-node for extraction, classification, or any deterministic task. Defaults introduce variability that's annoying in production. Leave higher for creative or open-ended generation.
Cost control
For high-volume workflows:
- Don't always pick the biggest frontier model. Small models for classification or routing, larger for reasoning, reserve frontier for genuinely complex multi-tool agents. The chat-model sub-node's
modelparam is a load-options list: resolve the exact model identifier viaexplore_node_resourcesrather than guessing a model-ID string. options.batchingon the Agent:batchSize(parallel items, default 1) anddelayBetweenBatches(ms, default 0) for rate-limited or expensive flows.
Open this reference as its own page
Comms nodes: Slack, Gmail, Discord, email
Communication nodes share patterns. The exact field shapes (param names, fixedCollection structures, value enums) shift across versions; get_node_types is canonical. This file covers security rules, decisions, and gotchas not in the type def.
Always credentials, never tokens
Per n8n-credentials-and-security-official: comms tokens go in credentials, never in node text fields.
If a user pastes a bot token in chat, follow the credential-creation flow in n8n-credentials-and-security-official. Don't put it in a node.
Append n8n Attribution
Most comm nodes have append n8n attribution enabled by default. Users typically want to remove it, so remove attribution by default.
Slack
Operation values can surprise you
The display name and the internal value don't always match. "Send a message" → operation: 'post' (not 'send'). Always inspect via get_node_types([{ name: 'slack', resource: 'message', operation: '...' }]).
select: channel vs DM
select determines whether the next field is channelId or user. Don't mix; only one applies per select value. Both are @searchListMethod lookups (getChannels / getUsers): after get_node_types, resolve the real ID via explore_node_resources.
Block Kit messages
For rich messages, set messageType: 'block'. The block content is a JSON string (the JSON output from Slack's Block Kit Builder), not a nested n8n object. The text field becomes the fallback notification text.
blocksUi must be wrapped as { "blocks": [...] }, not the bare array. The Slack node accepts the bare array silently: the request goes through, but the rich content drops and the message posts as plain text (or empty if text isn't set). No node error, no validation warning. The wrap matches Slack's chat.postMessage payload shape; the node forwards it directly.
Build the envelope as a single expression that returns a real object with the array as a live array value, not a stringified one. Reference the upstream by name (per n8n-expressions-official non-negotiable #1), not $json:
={{ { "blocks": $('Agent').item.json.output.blocks } }}
Don't reach for string-interpolation hybrids like ={ "blocks": {{ $('Agent').item.json.output.blocks.toJsonString() }} }. They work in some n8n versions, but stringifying-then-reparsing is fragile (double-escaping, unicode, large payloads) where the object form just hands the node the structure directly.
Threading: thread_ts is required for in-thread replies
Without thread_ts, the "reply" posts as a top-level channel message. Inspect via get_node_types for where the field sits, it's not under otherOptions like older docs suggest.
thread_ts is the timestamp of the message you're replying to. reply_broadcast: true makes the reply visible in the main channel.
Gmail
Operation values: "Get Many" → 'getAll'
Not 'getMany'. Display name vs internal value mismatch. Common operations: 'send' (default), 'reply', 'getAll', 'addLabels', 'removeLabels', 'get', 'delete', 'markAsRead', 'markAsUnread'. addLabels/removeLabels take a labelIds load-options field: resolve real label IDs via explore_node_resources (loadOptions).
What lives at top level vs under options
Top-level: sendTo, subject, emailType ('text' | 'html'), message. Under options: bccList, ccList, replyTo, senderName, attachmentsUi. Easy to misplace.
Build HTML directly in message via expression. Don't construct it in an upstream Set node (per n8n-expressions-official non-negotiable).
Multi-recipient
sendTo accepts comma-separated recipients. BCC and CC use the same comma-separated convention via options.bccList / options.ccList.
Attachments
Attachments reference binary properties on the input item (under options.attachmentsUi). See n8n-binary-and-data-official for the upstream binary handling.
Discord
Webhook vs OAuth
authentication is the discriminator: 'webhook' (simpler, posts to one channel via Discord webhook URL) or 'oAuth2' (full bot capabilities: DMs, multi-channel).
For "post to a channel," use webhook. Use OAuth only for bot-level features.
Embeds
Discord rich embeds use a fixedCollection under embeds.values[]. Each embed supports inputMethod: 'fields' (structured) or 'json' (raw JSON). Color is an n8n type: 'color' field; pass a hex string and the node converts to the decimal Discord's API expects.
emailFormat is the discriminator
'text', 'html', or 'both'. Determines whether text, html, or both fields appear. Top-level: fromEmail, toEmail, subject, emailFormat, text, html. Under options: replyTo, ccEmail, bccEmail, attachments. Different from Gmail's bccList/ccList naming.
Email as a fallback
When a service-specific node has issues (rate limit, quota, regional outage), SMTP is a good fallback. Configure both, and pick at runtime via flag or status check.
Telegram
Bot tokens via telegramApi. Each bot can only send to chats it's been added to.
parse_mode is snake_case
Not parseMode. Lives under additionalFields. Options: 'Markdown' (legacy), 'MarkdownV2', 'HTML' (default).
MarkdownV2 has stricter escaping than V1: _, *, [, ] and others need escaping or the message fails. Switch to HTML mode if escape rules become painful.
Common patterns across comms nodes
Idempotency
For workflows that can re-fire (retries, re-runs), include an idempotency check. Track sent messages in a Data Table (see n8n-binary-and-data-official's DATA_TABLES.md). Check before sending, skip if already sent recently.
Rate limits
Comms providers (Gmail, Slack, Discord, Teams) have rate limits. Configure node-level retry on any production node so a transient 429 self-heals: retryOnFail: true plus a waitBetweenTries per the provider's tolerance. For high-volume, use Loop Over Items with Wait between batches (see n8n-loops-official LOOP_OVER_ITEMS.md).
Personalization via expressions
Build the message body directly in the comms node's body field, not in an upstream Set node. Same n8n-expressions-official non-negotiable.
Open this reference as its own page
Database nodes: Postgres, MySQL, MongoDB, Supabase
DB nodes share patterns around query construction, parameter binding, and error handling. Exact field shapes vary; get_node_types is canonical. This file covers security, decisions, and gotchas not in the type def.
Always parameterize, never concatenate
Critical. Never interpolate user input into the query string. n8n substitutes {{ ... }} expressions into the query text before parameter binding, so anything in {{ }} becomes part of the SQL itself, not a bound value.
// ❌ DON'T: n8n substitutes the expression into the SQL string before binding.
// $json.email = "x'; DROP TABLE users; --" → game over.
{
operation: 'executeQuery',
query: "=SELECT * FROM users WHERE email = '{{ $json.email }}'",
}
// ✅ DO: use $1, $2, ... placeholders + options.queryReplacement.
// Values go through pg_promise's parameter binding, never touch the SQL text.
{
operation: 'executeQuery',
query: 'SELECT * FROM users WHERE email = $1',
options: {
queryReplacement: '={{ $json.email }}',
},
}
options.queryReplacement accepts a comma-separated list (value1,value2,value3) or expressions that resolve to values (={{ $json.email }},={{ $json.id }}). Each comma-separated piece becomes one parameter, referenced as $1, $2, ... in the query. The = prefix on queryReplacement is just n8n's expression-mode marker. What matters is that the values flow via the option, not interpolated into the query.
Postgres and the n8n MySQL node both use $1, $2, ... via options.queryReplacement. Mongo uses object filters. Treat any pattern that puts user input into the query string as a critical injection vulnerability.
Postgres
executeQuery vs structured operations
executeQuery: raw SQL with parameters. Most flexible. Use for joins, CTEs, window functions.select/insert/update/upsert/deleteTable: n8n builds the SQL. Less flexible but less footgun-prone for simple cases. Theirtable(andschema) are@searchListMethodlookups: resolve real names viaexplore_node_resources.
Note: "Delete" maps to operation: 'deleteTable' (display vs internal-value mismatch).
Returning rows
executeQuery returns rows as items. Zero rows produces no items, downstream nodes may treat as "skip." Set alwaysOutputData: true to flow through a single empty item, or branch on the count.
MySQL
Despite MySQL's native ? placeholder syntax, the n8n MySQL node uses $1, $2, ... and options.queryReplacement, same as Postgres. The node normalizes to the driver. Same parameter-binding rules from "Always parameterize" at the top apply unchanged.
Beyond that, differences from Postgres are general MySQL behavior (operator availability, AUTO_INCREMENT semantics) and not n8n-specific. Inspect get_node_types for the operation set, which differs slightly.
MongoDB
Filters are JSON objects, not SQL. The n8n MongoDB node has the usual operations (find, insert, update, delete, aggregate, plus findOneAndUpdate / findOneAndReplace) and most n8n-specific surface lives in get_node_types. For complex queries (aggregation pipelines, $lookup joins) use aggregate. For document writes, the node splits items into separate writes by default; bulk-write via the relevant batch option.
Supabase
Wraps PostgREST. Uses Supabase's REST API, not direct DB connections.
Power-user tip: prefer the Postgres node for non-trivial work
For anything beyond per-row CRUD (joins, CTEs, window functions, aggregations, RPC calls), the Postgres node connecting directly to your Supabase database is strictly more powerful than the Supabase REST node, full SQL surface against the same data. The tradeoff is auth: the Postgres node needs the direct DB connection details (host, port, database, user, password) from your Supabase project's database connection settings, not the project URL + anon key. One-time setup, then it's a normal Postgres workflow.
Same security rules apply: never interpolate user input into the query string, always use $1, $2, ... + options.queryReplacement (see "Always parameterize" at top). RLS doesn't apply to direct DB connections, so the service_role vs anon distinction goes away too. Your queries see all rows.
Operation values: "Get Many" → 'getAll'
Display vs internal-value mismatch (not 'getMany').
Missing filter conditions
If you expect isTrue / isFalse / isNull / in as separate conditions, they don't exist. Use condition: 'is' with keyValue: 'null' | 'true' | 'false' | 'unknown'. Inspect get_node_types for the supported set.
Default-value pattern for missing input
When a filter value comes from optional input, default it to a known-empty value:
keyValue: `={{ $json.id || "305f7106-6988-4651-b26a-18979641b7b5" }}`,
Avoids "filter on undefined" errors that produce empty result sets or 400s.
RLS gotcha
Supabase uses Row-Level Security by default. Empty results when you expect data is usually:
- Wrong credential role:
anonrespects RLS,service_rolebypasses it. - Backend workflows usually want
service_role. Public-facing APIs wantanonwith proper RLS.
Common patterns across DB nodes
Handle the "no rows" case
After select / find, zero matches yields zero items and downstream nodes silently skip. Either set alwaysOutputData: true to flow through an empty item, or branch on the lookup with an IF and feed defaults via Set on the no-match path.
Upsert when you don't know if the row exists
Postgres' INSERT ... ON CONFLICT DO UPDATE (or n8n's upsert operation) is cleaner than:
SELECT → IF exists → UPDATE
└─→ INSERT
Two queries become one, race conditions disappear.
Transactions
Postgres and MySQL support transactions natively via options.queryBatching: 'transaction' (default 'single', also 'independently') on executeQuery. All queries the node executes in that run go through one BEGIN/COMMIT; any failure rolls everything back. The canonical use is multiple input items each driving one query, executed atomically by a single Postgres / MySQL node.
{
operation: 'executeQuery',
query: 'INSERT INTO orders (customer_id, total) VALUES ($1, $2)',
options: {
queryBatching: 'transaction',
queryReplacement: '={{ $json.customerId }},={{ $json.total }}',
},
}
Supabase wraps PostgREST and has no transaction support at the REST layer. For atomic multi-step writes against Supabase, drop to the Postgres node connecting to the same database (see the "Power-user tip" above) and use queryBatching: 'transaction'.
MongoDB is a different story (see its own docs for session-based transactions); the n8n MongoDB node doesn't expose them directly.
Across multiple n8n nodes, there's still no transaction. Atomicity is bounded to one executeQuery invocation. If you find yourself wanting cross-node atomicity, redesign the workflow so the writes that must succeed or fail together live in a single executeQuery node with queryBatching: 'transaction'. Pre-compute everything you need upstream (lookups, validations, derived values) so the transactional node receives ready-to-write data, then express the multi-step write as multiple SQL statements (semicolon-separated, or one per input item) all going through the same node. The non-transactional work stays outside; the transactional work collapses inward.
Open this reference as its own page
HTTP Request: gotchas and patterns
The exact parameter shape evolves across versions. Always get_node_types for the canonical shape. This file covers what's not in the type definition: security rules, decision-making, engine caps, runtime gotchas.
Always inspect first
get_node_types([{ name: 'httpRequest' }]). Build against the live shape, not memory.
Auth: the #1 source of HTTP Request bugs
Three modes, each with different required follow-ups (get_node_types shows them):
'none': unauthenticated.'predefinedCredentialType': n8n has a built-in credential type for this service (Slack, Notion, etc.). Use this when the service is already supported.'genericCredentialType': pick from the long tail of generic auth types (header, basic, OAuth2, query, custom). Use this for services without a native node.
Common mistakes:
- Setting
credentialsbut leavingauthentication: 'none': credentials silently ignored. - Putting tokens in
headerParameters/queryParameters/bodyParametersinstead of credentials: this puts them in plain text in the workflow. Seen8n-credentials-and-security-official. - Using
genericCredentialTypewhen apredefinedCredentialTypeexists for the service. Predefined types are usually easier to set up (the OAuth flow, refresh handling, etc. is wired for you).
For the full auth pattern, see n8n-credentials-and-security-official's HTTP_REQUEST_WITH_AUTH.md.
Body and query: discriminators matter
Both body and query have a 2-level discriminator pattern:
sendBody: true+contentType(json / form-urlencoded / multipart-form-data / raw / binaryData) +specifyBody(keypair / json / string for some content types).sendQuery: true+specifyQuery(keypair / json).
Setting one path's fields with the other path's discriminator silently does nothing. Always inspect via get_node_types for the operation you're configuring.
Pagination
Built-in. See n8n-loops-official HTTP_PAGINATION.md for the full matrix. Don't reinvent with Loop Over Items + $pageCount unless the API does something the modes can't express.
Retry on fail
retryOnFail: true enables it. The engine retries on all errors.
maxTries: Default to 3.waitBetweenTries: Default to 5000.
Timeouts
Runtime default is 5 minutes when options.timeout is unset. The UI default if you toggle the option on is 10 seconds. Set explicitly for untrusted/external APIs (e.g., 10000ms = 10s) so a hung request doesn't stall the workflow.
Response handling
Three options under options.response.response:
fullResponse: true: include headers + status code, not just body. Useful forX-Rate-Limit-Remainingand similar.neverError: true: don't throw on non-2xx. The error body flows through and you check status manually. Useful when handling errors in workflow logic instead of via the error output.responseFormat:'autodetect'(default) /'json'/'text'/'file'.'text'and'file'requireoutputPropertyName.
Open this reference as its own page
Merge node
Merge nodes have two configuration traps. Both fail silently:
- Wrong input count. Merge defaults to 2 inputs. If 3+ sources need to converge, you must explicitly set the input count on the node.
- Off-by-one between
useDataOfInputand.input(n)when porting from existing config.useDataOfInputis 1-indexed (matches UI labels);.input(n)is 0-indexed (matches every other array in code).
Set the input count when you have 3+ sources
The Merge node's numberOfInputs parameter defaults to 2. If you're converging from 3 IF branches, or 4 parallel HTTP calls, or any source-count beyond 2, set it explicitly:
const mergeNode = merge({
config: {
parameters: {
mode: 'append', // or 'combine', etc.
numberOfInputs: 3, // <-- explicit count
},
},
})
Then wire all 3 sources via .input(0), .input(1), .input(2). Verify the parameter name on the user's n8n version via get_node_types for merge — the field name has shifted between versions.
Symptom of forgetting: the workflow validates and runs, but only the first 2 sources' items appear downstream. The third silently drops. Hard to spot in the canvas: the connection line is drawn, the node visually has 3 wires going in, but only 2 inputs exist on the node.
After wiring a Merge with 3+ sources, pull the workflow via get_workflow_details and confirm the parameters.numberOfInputs (or equivalent) matches your wire count.
The translation rule
When porting a workflow or reading useDataOfInput from existing config:
If the source has
useDataOfInput: "N", the wire feeding that slot uses.input(N - 1).
Examples:
| Merge config | Wire to use |
|---|---|
useDataOfInput: "1" |
.input(0) |
useDataOfInput: "2" |
.input(1) |
useDataOfInput: "3" |
.input(2) |
Failure mode
Getting this backward (e.g., .input(2) for useDataOfInput: "2") wires to input index 2 (the third input) instead of index 1 (the second). At runtime:
- The Merge passes through whatever sits at the 1-indexed
useDataOfInputslot, now the wrong source. - Downstream receives data from an unintended upstream branch.
- No error: both inputs are valid, but the contents are just wrong.
Looks identical to a "missing fan-out" because the shape is right but the contents are wrong. Symptoms: downstream conditional logic acts on stale data, and outputs reference real fields with values from a different code path.
Worked example
A Merge with three inputs, configured to pass through Input 2:
Config:
{ "useDataOfInput": "2" }
Correct wiring (using the translation rule, N=2 → .input(1)):
.add(start).to(srcA).to(merge.input(0)) // Input 1: ignored at runtime per useDataOfInput
.add(start).to(srcB).to(merge.input(1)) // Input 2: passed through
.add(start).to(srcC).to(merge.input(2)) // Input 3: ignored
Wrong wiring (matching the numbers):
.add(start).to(srcA).to(merge.input(1)) // ← wrong, srcA on Input 2
.add(start).to(srcB).to(merge.input(2)) // ← wrong, srcB on Input 3
.add(start).to(srcC).to(merge.input(3)) // ← wrong, srcC on (nonexistent) Input 4
At runtime, the wrong wiring passes through srcA's data (because useDataOfInput: "2" selects index 1 = .input(1), now occupied by srcA), not srcB's. The user gets the wrong upstream branch with no clear signal why.
Composite handler shorthand for IF/Switch into Merge
.add(checkType.onTrue(merge.input(0)).onFalse(merge.input(1)))
Pre-2.21.4 this threw MERGE_SINGLE_INPUT: the branch handler hardcoded input index 0 and ignored the .input(n) selector. Since 2.21.4 (n8n#29716) the handler respects the selector and wires the branch to the named input. The universal pattern .add(checkType.output(0).to(merge.input(0))) still works; the shorthand is just shorter for IF/Switch-into-Merge.
Why this exists
The Merge UI predates the SDK. 1-indexed labels match the user's mental model in the editor, and 0-indexed SDK matches every other array in code. Aligning would break one group.
On n8n's roadmap. Until then, use the translation rule.
Open this reference as its own page
Switch node: name your outputs and handle the fallback
The Switch node's mode: 'rules' exposes a per-rule renameOutput: true + outputKey: '<name>' pattern, plus an options.fallbackOutput: 'extra' + options.renameFallbackOutput pair for the default branch.
get_node_types shows these fields exist. It doesn't tell you the consequence of leaving them off:
- No fallback output = items that match no rule are silently dropped. No error, no warning, the workflow just loses data on the unmatched path. Always configure
options.fallbackOutput: 'extra'with a meaningfulrenameFallbackOutput(Unexpected,Default case,Other). - Unnamed outputs = the workflow is unreadable a month later. You see "0 / 1 / 2" without knowing which branch goes where. Set
renameOutput: true+outputKey: '<name>'per rule.
Don't ship a Switch node with unnamed outputs and no fallback.
Open this reference as its own page
Trigger nodes: gotchas
Param shapes are version-dependent; get_node_types is canonical. This file covers what's not in the type def.
For the Webhook trigger, see WEBHOOK_NODES.md.
Schedule Trigger
Timezone is workflow-level, not per-rule
The Schedule Trigger uses the workflow's timezone setting (Workflow Settings → Timezone). There is no timezone field inside rule. For workflows that must run at a specific local time regardless of host, set the workflow timezone explicitly. Without it, DST transitions and instance moves cause timing shifts.
Cron: 5 fields or 6
n8n's cron supports both 5-field (Minute Hour DoM Month DoW) and 6-field (Second Minute Hour DoM Month DoW) formats. The UI hint shows 6, the placeholder shows 5. Both work.
For "run weekly Monday 9am"-style cases, the simple time-based modes (field: 'weeks') are clearer than cron.
Instance restarts can miss runs
Schedules use the instance's clock. A restart during a scheduled time can miss that run. For business-critical schedules:
- Idempotent design (multiple runs = same result).
- Missed-run detection at workflow start (compare last successful run to expected, catch up if needed).
Execute Workflow Trigger
For sub-workflows called by other workflows. The trigger's inputSource discriminator picks one of three input contracts:
- Schema-defined (preferred): list each input's name and type. Strongest contract, self-documenting.
- JSON example: paste an example object, n8n infers the schema.
- Passthrough: accept all data from the parent.
Pick schema-defined unless the input shape is genuinely free-form or requires binary passthrough. The schema is the API. Document inputs/outputs in the workflow description per n8n-subworkflows-official.
Open this reference as its own page
Webhook trigger and Respond to Webhook
Entry and exit of webhook-shaped API workflows. Param shapes are version-dependent; get_node_types is canonical. This file covers what's not in the type def: runtime behavior, gotchas, and patterns.
Webhook trigger
Path: globally unique
Webhook paths are global within the n8n instance, not per-workflow. Two webhooks on the same path conflict and n8n typically rejects activation. Use UUIDs or descriptive paths (/customer-events, /payment-webhook).
Authentication: use the trigger's built-in auth, not hand-rolled checks
Use parameters.authentication ('basicAuth' or 'headerAuth') with the matching credential type. n8n rejects mismatched callers with 401 before the workflow runs.
Anti-pattern: authentication: 'none' plus an IF node comparing the Authorization header to a $vars.token or hardcoded string. Not encrypted, leaks in exports, no rotation. See n8n-credentials-and-security-official.
responseMode: behavioral differences
| Mode | Behavior |
|---|---|
'onReceived' (default) |
Returns 200 immediately. Workflow continues asynchronously. Caller doesn't see workflow output. |
'lastNode' |
Returns the last node's output. Synchronous. |
'responseNode' |
Use Respond to Webhook nodes to control the response. Most flexible. |
'streaming' |
Stream data in real time from streaming-enabled nodes. |
For request/response API workflows, use responseNode paired with explicit Respond to Webhook nodes.
Output structure (runtime)
The webhook trigger emits { headers, params, query, body, webhookUrl, executionMode }, plus binary if options.rawBody is set, plus jwtPayload if JWT auth was used. executionMode is 'test' or 'production'.
Respond to Webhook
responseBody for respondWith: 'json': pass the object, not a string
The type def accepts both IDataObject and string. If you pass JSON.stringify(obj), n8n then JSON-serializes the string, producing an escaped, double-encoded body. Pass the object directly.
responseCode defaults to 200, including on error paths
The most common Respond-to-Webhook bug: forgetting to change the response code on an error branch. Returning 200 with an error body is worst-of-both-worlds: the caller's HTTP client sees success while the body says failure.
Set the response code explicitly on every Respond branch. See n8n-error-handling-official's RESPONSE_SHAPES.md for the success/4xx/5xx mapping.
Multiple Respond nodes per workflow
A workflow can have multiple Respond nodes, one per response shape. n8n returns whichever fires first.
[Webhook] ─→ [Validate] ─→ [Process] ─→ [Respond 200 success]
├─→ [Respond 400 validation_error]
├─→ [Respond 401 unauthorized]
└─→ (error outputs from process) ─→ [Respond 5xx]
For 202-Accepted-plus-callback and other async API patterns, see n8n-error-handling-official's API_WORKFLOWS.md.
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.


