项目链接错误#
¥Item linking errors
在 n8n 中,你可以引用任何先前节点的数据。这不一定是之前的节点:它可以是链中任何先前的节点。引用更早的节点时,请使用表达式语法 $(node_name).item。
¥In n8n you can reference data from any previous node. This doesn't have to be the node just before: it can be any previous node in the chain. When referencing nodes further back, you use the expression syntax $(node_name).item.
Diagram of threads for different items. Due to the item linking, you can get the actor for each movie using $('Get famous movie actors').item.
由于上一个节点可以包含多个项目,n8n 需要知道要使用哪个项目。使用 .item 时,n8n 会在后台自动处理这些错误。有关其工作原理的详细信息,请联系 项目链接概念。
¥Since the previous node can have multiple items in it, n8n needs to know which one to use. When using .item, n8n figures this out for you behind the scenes. Refer to Item linking concepts for detailed information on how this works.
如果缺少信息,.item 将失败。为了确定要使用哪个条目,n8n 会为每个条目维护一条追溯到工作流节点的线程。对于给定的项目,此线程会告知 n8n 之前节点中的哪些项目生成了该项目。要在给定的前一个节点中查找匹配的条目,n8n 会沿着此线程追溯,直到到达目标节点。
¥.item fails if information is missing. To figure out which item to use, n8n maintains a thread back through the workflow's nodes for each item. For a given item, this thread tells n8n which items in previous nodes generated it. To find the matching item in a given previous node, n8n follows this thread back until it reaches the node in question.
使用 .item 时,n8n 会在以下情况下显示错误:
¥When using .item, n8n displays an error when:
- 线程已断开
¥The thread is broken
- 线程指向前一个节点中的多个项目(因为不确定要使用哪个项目)。
¥The thread points to more than one item in the previous node (as it's unclear which one to use)
要解决这些错误,你可以避免使用 .item,或者修复根本原因。
¥To solve these errors, you can either avoid using .item, or fix the root cause.
你可以使用 .first()、.last() 或 .all()[index] 代替 .item。它们要求你知道目标项在目标节点输出项中的位置。请参阅 内置方法和变量 |其他节点的输出 获取有关这些方法的更多详细信息。
¥You can avoid .item by using .first(), .last() or .all()[index] instead. They require you to know the position of the item that you’re targeting within the target node's output items. Refer to Built in methods and variables | Output of other nodes for more detail on these methods.
根本原因的修复取决于具体的错误。
¥The fix for the root cause depends on the exact error.
修复 '上一个节点缺失表达式的信息'#
¥Fix for 'Info for expressions missing from previous node'
如果你看到以下错误信息:
¥If you see this error message:
ERROR:上一个节点中缺失的表达式信息
¥ERROR: Info for expression missing from previous node
链中有一个节点不返回配对信息。此处的解决方案取决于前一个节点的类型:
¥There's a node in the chain that doesn't return pairing information. The solution here depends on the type of the previous node:
- 代码节点:确保你返回节点用于生成每个输出项的输入项。有关更多信息,请参阅 代码节点中的项目链接。
¥Code nodes: make sure you return which input items the node used to produce each output item. Refer to Item linking in the code node for more information.
- 自定义或社区节点:节点创建者需要更新节点,以返回它用于生成每个输出项的输入项。有关更多信息,请参阅 节点创建者的项目链接。
¥Custom or community nodes: the node creator needs to update the node to return which input items it uses to produce each output item. Refer to Item linking for node creators for more information.
修复 '表达式的多个匹配项'#
¥Fix for 'Multiple matching items for expression'
这是错误消息:
¥This is the error message:
ERROR:表达式的多个匹配项
¥ERROR: Multiple matching items for expression
有时,n8n 会使用多个项目来创建一个项目。示例包括 Summarize、Aggregate 和 Merge 节点。这些节点可以合并来自多个项目的信息。
¥Sometimes n8n uses multiple items to create a single item. Examples include the Summarize, Aggregate, and Merge nodes. These nodes can combine information from multiple items.
当你使用 .item 且存在多个匹配项时,n8n 无法确定使用哪个匹配项。要解决此问题,你可以:
¥When you use .item and there are multiple possible matches, n8n doesn't know which one to use. To solve this you can either:
- 请改用
.first()、.last()或.all()[index]。请参阅 内置方法和变量 |其他节点的输出 获取有关这些方法的更多详细信息。
¥Use .first(), .last() or .all()[index] instead. Refer to Built in methods and variables | Output of other nodes for more detail on these methods.
- 引用包含相同信息但不包含多个匹配项的其他节点。
¥Reference a different node that contains the same information, but doesn't have multiple matching items.
