Skip to content

Call n8n Workflow Tool node#

Call n8n Workflow Tool 节点#

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

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

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

在此页面上,您将找到 Call n8n Workflow Tool 节点的节点参数以及更多资源的链接。

子节点中的参数解析

子节点在使用表达式处理多个项目时的行为与其他节点不同。

大多数节点,包括根节点,接受任意数量的项目作为输入,处理这些项目,并输出结果。您可以使用表达式引用输入项目,节点会依次为每个项目解析表达式。例如,给定五个 name 值的输入,表达式 {{ $json.name }} 会依次解析为每个名称。

在子节点中,表达式始终解析为第一个项目。例如,给定五个 name 值的输入,表达式 {{ $json.name }} 始终解析为第一个名称。

Node parameters#

节点参数#

Description#

描述#

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

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

Call this tool to get a random color. The input should be a string with comma separated names of colors to exclude.

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

Source#

#

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

告诉 n8n 要调用哪个工作流程。您可以选择:

  • Database to select the workflow from a list or enter a workflow ID.
  • Database:从列表中选择工作流程或输入工作流程 ID。
  • Define Below and copy in a complete workflow JSON.
  • Define Below:复制完整的 工作流程 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.

当使用 Database 作为工作流程源时,一旦您选择了子工作流程(并在子工作流程中定义了 Workflow Input Schema),您就可以定义 Workflow Inputs

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

选择 Refresh 按钮从子工作流程中拉取输入字段。

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

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

  • providing fixed values
  • 提供固定值
  • using expressions to reference data from the current workflow
  • 使用表达式引用当前工作流程中的数据
  • letting the AI model specify the parameter by selecting the button AI button on the right side of the field
  • 让 AI 模型指定参数,通过选择字段右侧的 AI 按钮
  • using the $fromAI() function in expressions to control the way the model fills in data and to mix AI generated input with other custom input
  • 在表达式中使用 $fromAI() 函数 来控制模型填充数据的方式,并将 AI 生成的输入与其他自定义输入混合

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

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

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.

要开始使用 $fromAI() 函数,请选择字段右侧的"让模型定义此参数"按钮,然后使用框上的 X 恢复到用户定义的值。字段将更改为预填充了 $fromAI() 表达式的表达式字段。从这里,您可以自定义表达式以添加其他静态或动态内容,或调整 $fromAI() 函数参数。

Templates and examples#

模板和示例#

Browse 调用 n8n 工作流工具 integration templates, or search all templates

相关资源#

有关 LangChain 中工具的更多信息,请参阅 LangChain 关于工具的文档

查看 n8n 的高级 AI文档。

AI 术语表#

  • completion(完成/补全): 完成是由 GPT 等模型生成的响应。
  • hallucinations(幻觉): AI 中的幻觉是指大语言模型(LLM)错误地感知到不存在的模式或对象。
  • vector database(向量数据库): 向量数据库存储信息的数学表示。与嵌入和检索器一起使用,创建 AI 在回答问题时可以访问的数据库。
  • vector store(向量存储): 向量存储或向量数据库,存储信息的数学表示。与嵌入和检索器一起使用,创建 AI 在回答问题时可以访问的数据库。