n8n-node-configuration-official
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesen8n Node Configuration
n8n 节点配置
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 tool.
get_node_types每个n8n节点都有自己的参数结构,通常包含条件字段(即参数X仅在参数Y的值为Z时生效)。参数结构会随版本更新而变化。凭猜测配置会导致难以理解的验证错误。
不要凭猜测,使用工具。
get_node_typesNon-negotiable
必须遵循的规则
Call 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.
get_node_typesThe live 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 returns, trust the tool. Markdown drifts; the type def is generated from the live source.
get_node_typesget_node_typesNever guess resource-locator or load-options values. When shows a param with or (Slack channels, Sheets tabs/docs, DB tables/columns, model lists, labels), resolve the real value with (pass a from ) and use a returned . 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: has no search method, resolve it via and use .
get_node_types@searchListMethod@loadOptionsMethodexplore_node_resourcescredentialIdlist_credentialsvaluetoolWorkflow.workflowIdsearch_workflowsmode: 'id'在配置节点前,务必传入鉴别器(resource、operation、mode)调用工具。 如果不传鉴别器,你将得到通用结构,会缺失操作专属参数和必填字段。要基于精确的参数结构进行配置,不要凭记忆猜测。
get_node_typesget_node_typesget_node_types切勿猜测资源定位器或加载选项的值。 当显示某个参数带有或(如Slack频道、表格标签/文档、数据库表/列、模型列表、标签等)时,需通过工具(传入返回的)获取真实值,并使用返回的。如果你已经知道确切的ID,可以直接使用;如果有多个匹配项且意图不明确,请询问用户。自行编造的ID可能通过验证,但实际指向空资源。例外情况:没有搜索方法,需通过工具解析,并使用。
get_node_types@searchListMethod@loadOptionsMethodexplore_node_resourceslist_credentialscredentialIdvaluetoolWorkflow.workflowIdsearch_workflowsmode: 'id'Strong defaults
推荐默认做法
- Configure operation-first. Set and
resourcefirst, and conditional parameters become visible. Most "field doesn't exist" errors are really "you haven't set the parent operation yet."operation - Don't carry parameters across operations. When changing , re-derive from the new shape. Stale parameters from the previous operation trip validation.
operation
- 优先配置操作项。 先设置和
resource,条件参数就会显示出来。大多数“字段不存在”的错误实际上是“你尚未设置父级操作”。operation - 不要跨操作复用参数。 当更改时,要基于新的参数结构重新配置。之前操作的过时参数会触发验证错误。
operation
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."
1. search_nodes(['<能力关键词>'])
→ 返回匹配的节点ID + 鉴别器
2. 为任务选择合适的(resource, operation)组合。
3. get_node_types([{ name: '...', resource: '...', operation: '...' }])
→ 返回包含条件字段的精确参数结构
4. 对于该结构中任何资源定位器/加载选项类型的参数,获取真实值:
explore_node_resources({ nodeType, version, methodName, methodType, credentialType, credentialId, currentNodeParameters? })
→ 使用返回的`value`,切勿编造ID。
5. 基于该结构构建节点配置。
6. validate_workflow → 修复错误。
7. get_workflow_details → 检查保存后的配置;确认参数已正确设置。
8. 使用固定数据运行test_workflow → 确认运行时行为符合预期。跳过任何步骤都会加剧后续步骤的问题。最常被跳过的是步骤3,这会导致“无法读取属性X”的错误,而实际原因是“你未传入鉴别器”。
validate_node_config
as a side-channel
validate_node_config将validate_node_config
作为辅助手段
validate_node_configvalidate_node_config([{ type, typeVersion, parameters, isToolNode? }])validate_workflowvalidate_workflow- Iterating on a single node mid-build. Faster than re-running per tweak.
validate_workflow - 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 ), set so the correct branch evaluates.
ai_toolisToolNode: truedisplayOptionsvalidate_node_config([{ type, typeVersion, parameters, isToolNode? }])validate_workflowvalidate_workflow- 构建过程中迭代单个节点。 比每次调整后重新运行更快。
validate_workflow - 对现有工作流进行小幅修改。 连线未改动?只需检查你修改的那个节点;发布前再进行完整校验。
- 调试配置错误的节点。 提供逐参数的错误信息,无多余的图结构干扰。
对于通过连接的工具子节点,需设置,以便正确评估对应的分支。
ai_toolisToolNode: truedisplayOptionsOperation-aware configuration
感知操作的配置方式
Most nodes have a top-level shape like:
ts
{
resource: '<thing being operated on>', // 'message', 'spreadsheet', 'user', etc.
operation: '<verb>', // 'send', 'append', 'lookup', etc.
// ...operation-specific parameters
}The pair determines what other parameters exist (e.g., Slack differs from ).
(resource, operation)(message, send)(user, info)Pattern:
- Set and
resourcefirst.operation - Re-fetch with those discriminators if you didn't initially.
get_node_types - Configure the rest from the operation-specific shape.
大多数节点的顶层结构如下:
ts
{
resource: '<操作对象>', // 'message'、'spreadsheet'、'user'等
operation: '<操作动作>', // 'send'、'append'、'lookup'等
// ...操作专属参数
}(resource, operation)(message, send)(user, info)配置模式:
- 先设置和
resource。operation - 如果初始调用时没有传入这些鉴别器,需重新调用并传入它们。
get_node_types - 基于操作专属的参数结构配置其余内容。
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 requires
authentication: 'genericCredentialType'andgenericAuthType, butcredentialsrequires a different shape.'predefinedCredentialType' - Postgres requires
operation: 'executeQuery', whilequeryrequiresoperation: 'select'andtable.columns - Slack enables block-builder fields absent from
messageType: 'block'.messageType: 'text'
Always inspect via for the specific operation. Don't reuse a config from a different operation and expect it to validate.
get_node_typesOptions-from-another-field is a : resolve the live options with (), passing prior selections via when the method depends on them (e.g. listing a spreadsheet's tabs needs ).
@loadOptionsMethodexplore_node_resourcesmethodType: 'loadOptions'currentNodeParametersdocumentId有些参数之间存在不明显的依赖关系:
- 某个字段仅在另一个字段为特定值时才是必填项。
- 某个字段接受的类型取决于模式设置。
- 某个字段的选项来自另一个字段的值。
示例:
- HTTP请求节点中,需要
authentication: 'genericCredentialType'和genericAuthType参数,但credentials需要不同的参数结构。'predefinedCredentialType' - Postgres节点中,需要
operation: 'executeQuery'参数,而query需要operation: 'select'和table参数。columns - Slack节点中,会启用
messageType: 'block'模式下没有的块构建字段。messageType: 'text'
务必通过查看特定操作的参数结构。不要复用其他操作的配置并期望它能通过验证。
get_node_types“选项来自其他字段”属于类型:需通过工具()获取实时选项,当方法依赖于之前的选择时,需通过传入已选值(例如列出表格标签需要)。
@loadOptionsMethodexplore_node_resourcesmethodType: 'loadOptions'currentNodeParametersdocumentIdReference files
参考文档
Per-category gotchas. Read the file for the node type you're configuring:
| File | When to read |
|---|---|
| Configuring HTTP Request: auth, pagination, query/body parameters, retries |
| Configuring Webhook trigger or Respond to Webhook: body parsing, response shape, async patterns |
| Slack, Gmail, Discord, email: credential types, message shapes, attachments |
| Postgres, MySQL, Mongo, Supabase: query vs operation, parameter binding, error handling |
| AI Agent node config knobs: streaming, vision, |
| Webhook, Schedule, Manual, Execute Workflow Trigger: input schemas, polling vs realtime |
| Configuring a Switch node: unnamed outputs / missing fallback silently drop unmatched items |
| Configuring a Merge node, or you see |
按分类整理的常见问题。配置对应类型的节点时,请阅读相关文档:
| 文档 | 阅读场景 |
|---|---|
| 配置HTTP请求节点:认证、分页、查询/请求体参数、重试 |
| 配置Webhook触发器或响应Webhook节点:请求体解析、响应结构、异步模式 |
| Slack、Gmail、Discord、邮件类节点:凭证类型、消息结构、附件 |
| Postgres、MySQL、Mongo、Supabase类节点:查询vs操作、参数绑定、错误处理 |
| AI Agent节点配置项:流式传输、视觉功能、 |
| Webhook、定时、手动、执行工作流触发器:输入Schema、轮询vs实时 |
| 配置Switch节点:未命名输出/缺失回退会静默丢弃不匹配的项 |
| 配置Merge节点,或遇到 |
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 |
Skipping discriminators in | Get generic shape, miss operation-specific required fields | Always pass |
| 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 | Always credentials |
Not testing the node with | Runtime errors only surface on real data | Always test with pinned data before publish |
| 反模式 | 问题 | 修复方案 |
|---|---|---|
| 凭去年对节点的记忆构建配置 | 参数结构已更新,验证失败并抛出难以理解的错误 | 每次会话配置每个节点时都要调用 |
在 | 获取到通用结构,缺失操作专属的必填字段 | 务必传入 |
| 复制一个操作的节点配置并微调后用于另一个操作 | 过时参数触发验证错误,条件字段不生效 | 基于新操作的参数结构重新配置 |
| 在节点文本字段中硬编码令牌/凭证 | 导出时会泄露敏感信息。请参考 | 始终使用凭证管理 |
配置完成后不使用 | 运行时错误仅在真实数据场景下才会暴露 | 发布前务必使用固定数据测试 |