Skip to content

调用 n8n 工作流工具节点(Call n8n Workflow Tool node)#

Call n8n 工作流工具节点是一个工具,允许代理运行另一个 n8n 工作流并获取其输出数据。

🌐 The Call n8n Workflow Tool node is a tool that allows an agent to run another n8n workflow and fetch its output data.

本页提供“调用 n8n 工作流工具”节点的节点参数以及更多资源的链接。

🌐 On this page, you'll find the node parameters for the Call n8n Workflow Tool node, and links to more resources.

Parameter resolution in sub-nodes

Sub-nodes behave differently to other nodes when processing multiple items using an expression.

Most nodes, including root nodes, take any number of items as input, process these items, and output the results. You can use expressions to refer to input items, and the node resolves the expression for each item in turn. For example, given an input of five name values, the expression {{ $json.name }} resolves to each name in turn.

In sub-nodes, the expression always resolves to the first item. For example, given an input of five name values, the expression {{ $json.name }} always resolves to the first name.

节点参数(Node parameters)#

描述(Description)#

输入自定义代码和描述。这会告诉代理何时使用此工具。例如:

🌐 Enter a custom code a description. This tells the agent when to use this tool. For example:

调用此工具以获取随机颜色。输入应为以逗号分隔的要排除的颜色名称字符串。

源(Source)#

告诉 n8n 调用哪个工作流。你可以选择以下任意一种:

🌐 Tell n8n which workflow to call. You can choose either:

  • 数据库 用于从列表中选择工作流或输入工作流ID。
  • 在下面定义 并复制完整的 workflow JSON

工作流输入(Workflow Inputs)#

在使用 数据库 作为工作流来源时,一旦选择了子工作流(并在子工作流中定义了 工作流输入模式),即可定义 工作流输入

🌐 When using Database as workflow source, once you choose a sub-workflow (and define the Workflow Input Schema in the sub-workflow), you can define the Workflow Inputs.

选择 刷新 按钮以从子工作流中获取输入字段。

🌐 Select the Refresh button to pull in the input fields from the sub-workflow.

你可以使用以下选项的任意组合定义工作流输入值:

🌐 You can define the workflow input values using any combination of the following options:

要引用当前工作流中的数据,请将字段从输入面板拖到已选中“表达式”模式的字段中。

🌐 To reference data from the current workflow, drag fields from the input panel to the field with the Expressions mode selected.

要开始使用 $fromAI() 功能,请在字段右侧选择“让模型定义此参数”按钮,然后使用框上的 X 恢复为用户定义的值。该字段将变为一个表达式字段,预填充 $fromAI() 表达式。从这里,你可以自定义表达式以添加其他静态或动态内容,或调整 $fromAI() 功能参数。

🌐 To get started with the $fromAI() function, select the "Let the model define this parameter" button on the right side of the field and then use the X on the box to revert to user-defined values. The field will change to an expression field pre-populated with the $fromAI() expression. From here, you can customize the expression to add other static or dynamic content, or tweak the $fromAI() function parameters.

模板和示例(Templates and examples)#

Template widget placeholder.

Refer to LangChain's documentation on tools for more information about tools in LangChain.

View n8n's Advanced AI documentation.