Files
9ff492ac41 feat(space-share): prompt library and sharing prompts/skills/remote MCPs/local plugins to Space (LANG-439) (#3027)
* feat(space-share): share prompts, skills, remote MCPs and local plugins to LangBot Space (LANG-439)

- Prompt library dialog on Pipeline (messaging) and Agent (agent) prompt
  fields: search, preview, replace/append, favorites tied to the bound
  LangBot Account; share the current prompt for review
- Share to Space for Skills (file list + credential scan) and remote MCP
  servers (credentials become ${VAR} placeholders before anything leaves
  Core; stdio stays private)
- Community MCP installs with required inputs are created disabled and the
  detail page lists the placeholders to fill (unfilled_inputs)
- Locally / GitHub-installed plugins share their exact installed .lbpkg via
  the existing space-upload flow
- docs (zh/en/ja) and dev-docs contract note

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(web): use a star for prompt favorites (LANG-439)

The heart is the anonymous extension like; favorites need a LangBot Account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(i18n): call messaging prompts "Messaging" in English (LANG-439)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): marketplace type tiles matching Space, shadcn prompt list (LANG-439)

- the in-app marketplace shows All / Plugins / MCP / Skills as tiles with a
  description and count, plugin components and Runner usage as ToggleGroup
  chips; the Filters popover is gone (same layout as space.langbot.app)
- prompt library rows use the shadcn Item component

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* style(market): soften extension type tiles; type-tinted selected state

Drop the dark outline/ring on the selected tile. Idle tiles use a muted
fill; the selected tile gets a soft type-tinted fill with an inset ring
and a solid icon badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* style(market): use a fixed blue for the selected All tile

The theme primary is near-black in Core, which brought back the dark
selected border on the All tile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): switch market type on press and keep results while loading

Type tiles switch on mouse press (keyboard/touch still use click).
Filter changes keep the current cards dimmed until the new page arrives,
and stale responses are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): apply library prompts in the WebUI language; one-language share note

- Prompt library applies the version matching the WebUI language (exact
  -> same family -> en_US -> original), with a language switcher.
- Share dialogs say one language is enough; other languages are
  translated automatically after upload.
- extractI18nObject falls back across Chinese scripts and to any
  available language instead of rendering an empty label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): one-click LangBot Account binding from share and library

- Share dialogs: the 'bind a LangBot Account' state now has a button that
  starts the bind flow and returns to the same page; the creator-profile
  state gets a button too, with clearer copy.
- Prompt library: when no account is bound, the preview shows a
  'bind to favorite' button instead of only a disabled tab tooltip.
- Shared useSpaceBind hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): friendly empty state for templates; contributors no longer tag

- Empty template list: short, playful 'on their way, be the first to
  share' state (Space /templates, Core prompt library).
- Share dialogs drop the tags field; Space assigns tags during review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(space-share): update an existing item; clearer identifier field

- Share dialogs list the bound account's published items of the same type
  (prompts: same kind) and offer 'Update existing': pick an identifier,
  metadata is prefilled, a changelog is asked for and the submission
  becomes the next version. Sharing something with the same identifier
  preselects update mode.
- The identifier field now looks like a normal input with the fixed
  '@creator/' prefix and a format hint.
- GET /api/v1/space-share/items proxies the Space owner item list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-14 21:20:18 +08:00
..

---
title: "对话流水线 (Pipelines)"
description: "LangBot 管线将 AI 编排平台(Dify、Coze、n8n、Langflow)连接到你的消息机器人,了解其工作原理。"
---

流水线控制了收到消息之后的处理流程,以及与大模型之间的信息交互。每个机器人可以绑定到一条流水线上,同一条流水线能被多个机器人绑定。

LangBot 首次启动时会自动创建一个默认的流水线。创建机器人时,会自动绑定到默认流水线。创建第一个模型时,会自动将其设置为默认流水线的模型。

![arch](/images/zh/deploy/pipelines/arch.png)

您可以创建多条流水线,用于不同的机器人,适应不同的场景。



当前流水线可以配置以下功能

## AI 能力

可以选择使用:`内置 Agent`、[`Dify`](https://dify.ai/)、[`阿里云百炼`](https://www.aliyun.com/product/bailian?source=5176.29345612&userCode=ys4ad8gs)、[`n8n`](https://n8n.io/)、[`TBox(蚂蚁百宝箱)`](https://tbox.cn/)

AI 能力主要分为两个部分,选择运行器和配置运行器参数。  

运行器定义了如何调度大模型处理消息,默认为`内置 Agent`,这是 LangBot 实现的一个多回合 Agent 策略,当且仅当选择此运行器时,才会使用 LangBot 内部配置的模型和工具。

{/* ![edit_pipeline](/images/zh/deploy/pipelines/edit_pipeline_ai.png) */}

<img width="400px" src="/images/zh/deploy/pipelines/edit_pipeline_ai.png" alt="edit_pipeline" />

您也可以选择使用 `Dify`、 [`n8n`](https://n8n.io/) 等外部 Agent 平台,这种情况下所使用的模型和提示词、工具等资源将由 Agent 平台提供。

<img width="400px" src="/images/zh/deploy/pipelines/more_runner.png" alt="more_runner" />

- 接入 Dify 的详细步骤可以[参考教程](/zh/usage/pipelines/dify.html)。
- 接入 n8n 的详细步骤可以[参考教程](/zh/usage/pipelines/n8n.html)。

### 请求变量

当使用外部 Agent 平台时,LangBot 会显式传入以下参数,您可以自行在 Agent 平台的开始节点中添加(下图以 Dify 为例):

- `launcher_type`:发起对象类型,私聊为 `person`,群聊为 `group`
- `launcher_id`:发起对象ID,私聊为用户ID,群聊为群ID
- `sender_id`:发送者ID
- `user_message_text`:用户消息的纯文本
- `session_id`:用户会话id,私聊为 `person_<id>`,群聊为 `group_<id>`
- `conversation_id`:字符串,用户会话id,由 LangBot 生成。用户重置会话后,会重新生成
- `msg_create_time`:数字类型,收到此消息的时间戳(秒)
- `group_name`:群聊名称,仅在群消息事件时设置
- `sender_name`:发送者名称

您可以[通过插件自定义任何变量](/zh/plugin/dev/apis/common.html#%E8%AE%BE%E7%BD%AE%E8%AF%B7%E6%B1%82%E5%8F%98%E9%87%8F)。

![Dify 工作流开始节点配置](/images/zh/workshop/dify-service-api/dify_workflow_var.png)

### 提示词库

使用内置 Agent 时,「提示词」字段右上角有两个按钮:

- **提示词库**:在弹窗中搜索 LangBot Space 上社区分享并通过审核的提示词。流水线默认显示「对话提示词」,Agent 默认显示「Agent 提示词」,也可以切换查看另一类。选中后可「替换当前提示词」或「追加到当前提示词」,应用后需要点击保存。
- **分享**:把当前提示词提交到 LangBot Space。提交前会检查内容:包含 API Key、令牌等凭据时无法提交;包含邮箱、手机号或内网地址时需要确认。审核通过后即公开。

绑定了 LangBot 账号后,可以收藏提示词,收藏与 LangBot 账号关联,在 LangBot Space 网页上登录同一账号也能看到和管理。

## 其他配置

如果流水线引用的运行器插件仍在启动,LangBot 会为已安装且启用的插件等待最多 30 秒,再报告不可用;不会自动安装插件或确认权限。找不到运行器时,请在同一工作区的**插件**页面检查安装、启用和权限确认状态。如果下载、依赖安装或初始化失败,请查看安装任务和插件运行时日志,解决原因后重试。如果插件正在运行但不提供所选运行器,请检查插件版本,并在流水线的 AI 设置中选择可用运行器。监控中的错误记录包含具体失败信息。

请参考配置表单中的描述信息。

## 删除流水线

如果仍有机器人的事件绑定指向某条流水线,则无法删除它,删除时会提示正在使用它的机器人。请先在这些机器人的事件绑定中改用其他流水线或 Agent,再删除。Agent 同理。