mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-11-01 05:15:22 +08:00
git-subtree-dir: docs git-subtree-mainline:0582d1b3d4git-subtree-split:51dddcb3f8
59 lines
2.2 KiB
Plaintext
59 lines
2.2 KiB
Plaintext
---
|
|
title: "在 LangBot 上使用 n8n"
|
|
description: "将 n8n 与 LangBot 集成,驱动跨消息平台的 AI 机器人工作流与自动化。"
|
|
---
|
|
|
|
[n8n](https://n8n.io/) 是一款开源的自动化工作流平台,可以创建、调度、执行各种自动化任务。
|
|
|
|
LangBot 目前支持通过 n8n 工作流的 `Webhook` 节点,来触发工作流并获取回复。
|
|
|
|
## 选用 n8n 作为运行器
|
|
|
|
请打开已有的流水线配置页面,或新建流水线(推荐)并打开配置页面,到 `AI 能力`中选择 `n8n 工作流 API` 作为运行器。
|
|
|
|

|
|
|
|
|
|
并根据下方内容设置并填写其他配置。
|
|
|
|
## 配置 n8n 工作流连接
|
|
|
|

|
|
or
|
|

|
|
|
|
需要选择`Webhook`或者`On chat message`触发,并参考下图配置:
|
|
* webhook
|
|

|
|
* on chat message
|
|

|
|
|
|
<Info title="">
|
|
如果要需要流式,其中的`Response Mode`都需要选择为`Streaming`。
|
|
|
|

|
|
</Info>
|
|
|
|
|
|
<Info title="">
|
|
|
|
Authentication 对应 LangBot 流水线配置中的几种鉴权方式,可自行更改。
|
|
|
|

|
|
</Info>
|
|
|
|
|
|
调用ai模型的节点可配置为`AI Agent`,并参考下图配置:
|
|
> 需要流式则将图片中红框内容添加,不需要则不管
|
|
|
|

|
|
|
|
|
|
n8n 的工作流响应内容请使用`Respond to Webhook`节点,并参考下图配置(如果你选择的是流式响应和`AI Agent`节点,则不需要操作此步骤):
|
|
|
|

|
|
|
|
`Response Body`中的响应内容键名需要与 LangBot 流水线配置中的`输出键名`一致。
|
|
|
|
在完成 n8n 工作流的配置之后,请在其顶部点击`Active`以启用工作流。
|