diff --git a/docs/assets/image/zh/deploy/pipelines/n8n/config_call_ai.png b/docs/assets/image/zh/deploy/pipelines/n8n/config_call_ai.png new file mode 100644 index 000000000..d6f7a0173 Binary files /dev/null and b/docs/assets/image/zh/deploy/pipelines/n8n/config_call_ai.png differ diff --git a/docs/assets/image/zh/deploy/pipelines/n8n/config_n8n_onchatmessage.png b/docs/assets/image/zh/deploy/pipelines/n8n/config_n8n_onchatmessage.png new file mode 100644 index 000000000..1732a0437 Binary files /dev/null and b/docs/assets/image/zh/deploy/pipelines/n8n/config_n8n_onchatmessage.png differ diff --git a/docs/assets/image/zh/deploy/pipelines/n8n/config_response_model.png b/docs/assets/image/zh/deploy/pipelines/n8n/config_response_model.png new file mode 100644 index 000000000..4acea29fd Binary files /dev/null and b/docs/assets/image/zh/deploy/pipelines/n8n/config_response_model.png differ diff --git a/docs/assets/image/zh/deploy/pipelines/n8n/create_wf01.png b/docs/assets/image/zh/deploy/pipelines/n8n/create_wf01.png new file mode 100644 index 000000000..ec77017b2 Binary files /dev/null and b/docs/assets/image/zh/deploy/pipelines/n8n/create_wf01.png differ diff --git a/docs/en/deploy/pipelines/n8n.md b/docs/en/deploy/pipelines/n8n.md index 4a9dea5d7..373051e2b 100644 --- a/docs/en/deploy/pipelines/n8n.md +++ b/docs/en/deploy/pipelines/n8n.md @@ -15,10 +15,19 @@ Then configure and fill in the other settings according to the content below. ## Configuring n8n Workflow Connection ![n8n Workflow](/assets/image/zh/deploy/pipelines/n8n/create_wf.png) +or +![n8n Workflow](/assets/image/zh/deploy/pipelines/n8n/create_wf01.png) -You need to select `Webhook` as the trigger and configure it according to the image below: +Select `Webhook` or `On chat message` as the trigger and configure as follows: +- Webhook: + ![n8n webhook configuration](/assets/image/zh/deploy/pipelines/n8n/config_webhook.png) +- On chat message: + ![n8n on chat message configuration](/assets/image/zh/deploy/pipelines/n8n/config_n8n_onchatmessage.png) -![n8n webhook configuration](/assets/image/zh/deploy/pipelines/n8n/config_webhook.png) +:::info +If you need streaming responses, set `Response Mode` to `Streaming`. +![n8n streaming configuration](/assets/image/zh/deploy/pipelines/n8n/config_response_model.png) +::: :::info Authentication corresponds to the authentication methods in LangBot's pipeline configuration, which you can modify as needed. @@ -26,7 +35,12 @@ Authentication corresponds to the authentication methods in LangBot's pipeline c ![n8n workflow configuration](/assets/image/zh/deploy/pipelines/n8n/config_auth.png) ::: -For the workflow response content in n8n, please use the `Respond to Webhook` node and configure it according to the image below: +Configure the node that calls the AI model as `AI Agent`, following the setup below: +> For streaming responses, add the items highlighted in the red box. If you don't need streaming, you can skip this. + +![n8n AI model call configuration](/assets/image/zh/deploy/pipelines/n8n/config_call_ai.png) + +For the workflow response content in n8n, please use the `Respond to Webhook` node and configure it according to the image below (if you choose streaming responses with the `AI Agent` node, you do not need this step): ![n8n workflow response configuration](/assets/image/zh/deploy/pipelines/n8n/config_respond.png) diff --git a/docs/zh/deploy/pipelines/n8n.md b/docs/zh/deploy/pipelines/n8n.md index 0ada0958f..f496a90bb 100644 --- a/docs/zh/deploy/pipelines/n8n.md +++ b/docs/zh/deploy/pipelines/n8n.md @@ -10,15 +10,26 @@ LangBot 目前支持通过 n8n 工作流的 `Webhook` 节点,来触发工作 ![n8n 作为运行器](/assets/image/zh/deploy/pipelines/n8n/config_runner.png) + 并根据下方内容设置并填写其他配置。 ## 配置 n8n 工作流连接 ![n8n 工作流](/assets/image/zh/deploy/pipelines/n8n/create_wf.png) +or +![n8n 工作流](/assets/image/zh/deploy/pipelines/n8n/create_wf01.png) -需要选择`Webhook`触发,并参考下图配置: +需要选择`Webhook`或者`On chat message`触发,并参考下图配置: +* webhook + ![n8n webhook 配置](/assets/image/zh/deploy/pipelines/n8n/config_webhook.png) +* on chat message + ![n8n on chat message 配置](/assets/image/zh/deploy/pipelines/n8n/config_n8n_onchatmessage.png) + +:::info +如果要需要流式,其中的`Response Mode`都需要选择为`Streaming`。 +![n8n 流式配置](/assets/image/zh/deploy/pipelines/n8n/config_response_model.png) +::: -![n8n webhook 配置](/assets/image/zh/deploy/pipelines/n8n/config_webhook.png) :::info Authentication 对应 LangBot 流水线配置中的几种鉴权方式,可自行更改。 @@ -26,7 +37,14 @@ Authentication 对应 LangBot 流水线配置中的几种鉴权方式,可自 ![n8n 工作流配置](/assets/image/zh/deploy/pipelines/n8n/config_auth.png) ::: -n8n 的工作流响应内容请使用`Respond to Webhook`节点,并参考下图配置: + +调用ai模型的节点可配置为`AI Agent`,并参考下图配置: +> 需要流式则将图片中红框内容添加,不需要则不管 + +![n8n 调用ai模型配置](/assets/image/zh/deploy/pipelines/n8n/config_call_ai.png) + + +n8n 的工作流响应内容请使用`Respond to Webhook`节点,并参考下图配置(如果你选择的是流式响应和`AI Agent`节点,则不需要操作此步骤): ![n8n 工作流响应配置](/assets/image/zh/deploy/pipelines/n8n/config_respond.png)