Files
wehub-resource-sync d4408ff6c0
CI / detect-changes (push) Has been cancelled
Publish docs via GitHub Pages / Deploy docs (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / build (push) Has been cancelled
CI / test-harness (push) Has been cancelled
CI / generate-e2e-matrix (push) Has been cancelled
CI / build-ui (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / e2e (push) Has been cancelled
docs: make Chinese README the default
2026-07-13 10:29:17 +00:00

402 lines
20 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/conductor-oss/conductor) · [上游 README](https://github.com/conductor-oss/conductor/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
<picture>
<!-- Dark mode logo -->
<source srcset="https://github.com/user-attachments/assets/104b3a67-6013-4622-8075-a45da3a9e726" media="(prefers-color-scheme: dark)">
<!-- Light mode logo -->
<img src="https://assets.conductor-oss.org/logo.png" alt="Logo">
</picture>
<h1 align="center" style="border-bottom: none">
Conductor - 互联网规模的智能体工作流引擎
</h1>
[![GitHub stars](https://img.shields.io/github/stars/conductor-oss/conductor?style=social)](https://github.com/conductor-oss/conductor/stargazers)
[![Github release](https://img.shields.io/github/v/release/conductor-oss/conductor.svg)](https://github.com/conductor-oss/conductor/releases)
[![License](https://img.shields.io/github/license/conductor-oss/conductor.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Conductor Slack](https://img.shields.io/badge/Slack-Join%20the%20Community-blueviolet?logo=slack)](https://join.slack.com/t/orkes-conductor/shared_invite/zt-3dpcskdyd-W895bJDm8psAV7viYG3jFA)
[![Conductor OSS](https://img.shields.io/badge/Conductor%20OSS-Visit%20Site-blue)](https://conductor-oss.org)
#### 编排分布式系统意味着要应对故障、重试和状态恢复。Conductor 会替你处理这一切。
Conductor 是在 [Netflix](https://netflixtechblog.com/netflix-conductor-a-microservices-orchestrator-2e8d4771bf40) 构建的开源持久化(durable)工作流引擎,用于在互联网规模上编排微服务、AI 智能体(agent)和持久化工作流。Netflix、Tesla、LinkedIn 和 J.P. Morgan 均已在生产环境中信赖并使用。由 [Orkes](https://orkes.io) 和不断壮大的 [community](https://join.slack.com/t/orkes-conductor/shared_invite/zt-3dpcskdyd-W895bJDm8psAV7viYG3jFA). 积极维护。
[![conductor_oss_getting_started](https://github.com/user-attachments/assets/6153aa58-8ad1-4ec5-93d1-38ba1b83e3f4)](https://youtu.be/4azDdDlx27M)
---
# 60 秒快速启动
**前置条件:** 必须安装 [Node.js](https://nodejs.org/) v16+ 和 Java 21+。
```shell
npm install -g @conductor-oss/conductor-cli
conductor server start
```
打开 [http://localhost:8080](http://localhost:8080) — 你的服务器已运行,并带有内置的 ui-next UI。
> **从旧版本升级?** CLI 会在 `~/.conductor-cli/` 缓存服务器 JAR。如果缓存了旧版本,请强制重新下载:
> ```shell
> conductor server start latest
> # or delete the cache manually
> rm ~/.conductor-cli/conductor-server-latest.jar && conductor server start
> ```
**运行你的第一个工作流:**
```shell
# Create a workflow that calls an API and parses the response — no workers needed
curl -s https://raw.githubusercontent.com/conductor-oss/conductor/main/docs/quickstart/workflow.json -o workflow.json
conductor workflow create workflow.json
```
> **注意:** 连续运行两次该命令会在第二次调用时返回错误——工作流已存在。这是预期行为。使用 `conductor workflow update` 修改现有工作流。
```shell
conductor workflow start -w hello_workflow --sync
```
查看 [Quickstart guide](https://docs.conductor-oss.org/quickstart/) 了解完整演练,包括编写 worker 和重放工作流。
**Conductor 的 Docker 镜像**(包含 ui-next UI):
```shell
# UI at http://localhost:5000 | API at http://localhost:8080
docker run -p 5000:5000 -p 8080:8080 conductoross/conductor:next
```
所有 CLI 命令都有等效的 cURL/API 调用。详见 [Quickstart](https://docs.conductor-oss.org/quickstart/)。
---
# 为什么 Conductor 是开发者首选的工作流引擎
| | |
|---|---|
| **持久化执行(Durable execution** | 每一步都会持久化。可承受崩溃、重启和网络故障,并支持可配置的重试和超时。 |
| **设计即确定性(Deterministic by design** | 编排与业务逻辑分离——确定性是架构层面的,而非靠开发者自律。Worker 可运行任意代码;工作流图在构建上保持确定性。 |
| **AI 智能体编排** | 14+ 原生 LLM 提供商、MCP 工具调用、函数调用、人在回路(human-in-the-loop)审批,以及用于 RAG 的向量数据库。 |
| **运行时动态化** | 动态分叉、任务和子工作流在运行时解析。LLM 生成 JSON 工作流定义,Conductor 立即执行。 |
| **完全可重放** | 可从开头重启、从任意任务重新运行,或仅重试失败步骤——适用于任何工作流,任何时候都可以。 |
| **互联网规模** | 在 Netflix、Tesla、LinkedIn 和 J.P. Morgan 久经考验。可水平扩展至数十亿次工作流执行。 |
| **多语言 Worker** | 支持 Java、Python、Go、JavaScript、C#、Ruby 或 Rust 编写的 Worker。Worker 轮询、执行并上报——可在任意位置运行。 |
| **自托管,无厂商锁定** | Apache 2.0。5 种持久化后端、6 种消息代理。可在任何能运行 Docker 或 JVM 的环境中运行。 |
# 交付智能体,而非框架代码
Conductor 的 worker 就是普通代码——任意语言、任意库、任意 I/O。没有确定性约束,没有 SDK 仪式。编排层是声明式且机器可读的,因此 LLM 可以原生生成和组合工作流。如果智能体在第 12 次迭代时崩溃,它会从第 12 次迭代恢复。
**Conductor 中的自主思考-行动(think-act)智能体:** 通过 MCP 发现工具,用 LLM 推理,调用所选工具,重复直至完成。
```json
{
"name": "autonomous_agent",
"description": "Agent that loops until the task is complete",
"version": 1,
"tasks": [
{
"name": "discover_tools",
"taskReferenceName": "discover",
"type": "LIST_MCP_TOOLS",
"inputParameters": {
"mcpServer": "${workflow.input.mcpServerUrl}"
}
},
{
"name": "agent_loop",
"taskReferenceName": "loop",
"type": "DO_WHILE",
"loopCondition": "if ($.loop['think'].output.result.done == true) { false; } else { true; }",
"loopOver": [
{
"name": "think",
"taskReferenceName": "think",
"type": "LLM_CHAT_COMPLETE",
"inputParameters": {
"llmProvider": "openai",
"model": "gpt-4o-mini",
"messages": [
{
"role": "system",
"message": "You are an autonomous agent. Available tools: ${discover.output.tools}. Previous results: ${loop.output.results}. Respond with JSON: {\"action\": \"tool_name\", \"arguments\": {}, \"done\": false} or {\"answer\": \"final answer\", \"done\": true}."
},
{ "role": "user", "message": "${workflow.input.task}" }
]
}
},
{
"name": "act",
"taskReferenceName": "act",
"type": "SWITCH",
"expression": "$.think.output.result.done ? 'done' : 'call_tool'",
"decisionCases": {
"call_tool": [
{
"name": "execute_tool",
"taskReferenceName": "tool_call",
"type": "CALL_MCP_TOOL",
"inputParameters": {
"mcpServer": "${workflow.input.mcpServerUrl}",
"method": "${think.output.result.action}",
"arguments": "${think.output.result.arguments}"
}
}
]
}
}
]
}
]
}
```
每一步都持久化保存——无框架、无 SDK 锁定。代码优先(code-first)引擎要求你的代码具有确定性,以便框架可以重放。Conductor 让引擎具有确定性——因此你的代码不必如此。
查看 [Build Your First AI Agent](https://docs.conductor-oss.org/devguide/ai/first-ai-agent.html) 指南了解完整演练。
---
## 面向 AI 编程助手的 Conductor Skills
**[Conductor Skills](https://github.com/conductor-oss/conductor-skills)** 让 AI 编程助手(Claude Code、Gemini CLI 等)可直接从你的终端创建、管理和部署 Conductor 工作流。
### Claude
```shell
# Install Skills for Claude Code
/plugin marketplace add conductor-oss/conductor-skills
/plugin install conductor@conductor-skills
```
### 为所有检测到的 agent 安装
一条命令即可自动检测系统上所有受支持的 agent,并在可能的情况下进行全局安装。可随时重新运行——仅会为新检测到的 agent 安装。
**macOS / Linux**
```bash
curl -sSL https://conductor-oss.github.io/conductor-skills/install.sh | bash -s -- --all
```
**Windows (PowerShell) / (cmd)**
```powershell
# powershell
irm https://conductor-oss.github.io/conductor-skills/install.ps1 -OutFile install.ps1; .\install.ps1 -All
# cmd
powershell -c "irm https://conductor-oss.github.io/conductor-skills/install.ps1 -OutFile install.ps1; .\install.ps1 -All"
```
---
# SDKs
| 语言 | 仓库 | 安装 |
|----------|------------|---------|
| ☕ Java | [conductor-oss/java-sdk](https://github.com/conductor-oss/java-sdk) | [Maven Central](https://mvnrepository.com/artifact/org.conductoross/conductor-client) |
| 🐍 Python | [conductor-oss/python-sdk](https://github.com/conductor-oss/python-sdk) | `pip install conductor-python` |
| 🟨 JavaScript | [conductor-oss/javascript-sdk](https://github.com/conductor-oss/javascript-sdk) | `npm install @io-orkes/conductor-javascript` |
| 🐹 Go | [conductor-oss/go-sdk](https://github.com/conductor-oss/go-sdk) | `go get github.com/conductor-sdk/conductor-go` |
| 🟣 C# | [conductor-oss/csharp-sdk](https://github.com/conductor-oss/csharp-sdk) | `dotnet add package conductor-csharp` |
| 💎 Ruby | [conductor-oss/ruby-sdk](https://github.com/conductor-oss/ruby-sdk) | *(incubating)* |
| 🦀 Rust | [conductor-oss/rust-sdk](https://github.com/conductor-oss/rust-sdk) | *(incubating)* |
---
# 文档与社区
- **[文档](https://conductor-oss.org)** — 架构、指南、API 参考和 cookbook 示例。
- **[Slack](https://join.slack.com/t/orkes-conductor/shared_invite/zt-3dpcskdyd-W895bJDm8psAV7viYG3jFA)** — 社区讨论与支持。
- **[社区论坛](https://community.orkes.io/)** — 提问并分享模式。
---
<details>
<summary><strong>后端配置</strong></summary>
| 后端 | 配置 |
|---------|---------------|
| Redis + ES7(默认) | [config-redis.properties](docker/server/config/config-redis.properties) |
| Redis + ES8 | [config-redis-es8.properties](docker/server/config/config-redis-es8.properties) |
| Redis + OpenSearch | [config-redis-os.properties](docker/server/config/config-redis-os.properties) |
| Postgres | [config-postgres.properties](docker/server/config/config-postgres.properties) |
| Postgres + ES7 | [config-postgres-es7.properties](docker/server/config/config-postgres-es7.properties) |
| MySQL + ES7 | [config-mysql.properties](docker/server/config/config-mysql.properties) |
</details>
---
# 从源码构建
<details>
<summary><strong>要求与说明</strong></summary>
**要求:** Docker Desktop、Java (JDK) 21+、Node.js 18+ 以及 pnpm(用于 UI
```shell
git clone https://github.com/conductor-oss/conductor
cd conductor
./gradlew build
# (optional) Build UI (ui-next) and embed it in the server
# ./build_ui_next.sh
# Start local server
cd server
../gradlew bootRun
```
**以开发模式运行 UI(在 http://localhost:1234):** 热重载**
需要在 `http://localhost:8080` 上运行 Conductor 服务器。如果尚未启用,请先启用 `corepack`
```shell
corepack enable
```
然后启动开发服务器:
```shell
cd ui-next
pnpm install
pnpm dev
```
打开 [http://localhost:1234](http://localhost:1234) — 文件变更时 UI 会自动重载。
详见[完整构建指南](docs/devguide/running/source.md)。
</details>
---
# FAQ
<details>
<summary><strong>这与 Netflix Conductor 相同吗?</strong></summary>
是的。Conductor OSS 是原版 [Netflix Conductor](https://github.com/Netflix/conductor) 仓库的延续,Netflix 将该项目贡献给开源基金会之后由社区继续维护。
</details>
<details>
<summary><strong>Conductor 是开源的吗?</strong></summary>
是的。Conductor 是完全开源的工作流引擎,采用 Apache 2.0 许可证。你可以在自己的基础设施上自托管,支持 5 种持久化后端和 6 种消息代理(message broker)。
</details>
<details>
<summary><strong>该项目是否在积极维护?</strong></summary>
是的。[Orkes](https://orkes.io) 是主要维护方,并在所有主流云服务商上提供 Conductor 的企业级 SaaS 平台。
</details>
<details>
<summary><strong>Conductor 能否扩展以应对我的工作负载?</strong></summary>
可以。Conductor 诞生于 Netflix,在互联网规模下经过实战检验。它可跨多个服务器实例水平扩展,处理数十亿次工作流执行。
</details>
<details>
<summary><strong>Conductor 是否支持持久化执行(durable execution)?</strong></summary>
是的。Conductor 开创了持久化执行模式,确保工作流和持久化 agent 在基础设施故障或崩溃时仍能可靠完成。每一步都会持久化并可恢复。
</details>
<details>
<summary><strong>工作流完成或失败后,我可以重放吗?</strong></summary>
可以。Conductor 会无限期保留完整执行历史。你可以从头重新开始、从特定任务重新运行,或仅重试失败步骤——通过 API 或 UI 均可。
</details>
<details>
<summary><strong>Conductor 能否编排 AI agent 和 LLM</strong></summary>
是的。Conductor 原生集成 14+ 家 LLM 提供商(Anthropic、OpenAI、Gemini、Bedrock 等),支持 MCP 工具调用、函数调用(function calling)、人在回路(human-in-the-loop)审批,以及用于 RAG 的向量数据库集成。
</details>
<details>
<summary><strong>为什么 Conductor 将编排与代码分离?</strong></summary>
将编排逻辑与业务逻辑耦合,会迫使开发者在工作流定义中手动维持确定性约束——不能直接 I/O、不能使用系统时间、不能引入随机性。Conductor 通过让编排层在结构上保持确定性,消除了整类此类 bug。Worker 是普通代码,零框架约束——可用任意语言编写,使用任意库,调用任意 API。
</details>
<details>
<summary><strong>用代码编写工作流不是比 JSON 更强大吗?</strong></summary>
这取决于你对「强大」的定义。在代码优先(code-first)引擎中,工作流定义与业务逻辑运行在同一运行时中——这意味着引擎必须重放你的代码才能恢复状态。这会迫使业务逻辑满足确定性约束:不能直接 I/O、不能使用系统时间、不能使用线程、不能引入随机性。Conductor 将这些关注点分离。编排图是声明式的(JSON),因此在结构上就是确定性的。你的 Worker 是普通代码,零约束——可使用任意语言、任意库,调用任意 API。你在真正需要的地方(业务逻辑)获得代码的全部能力,而在不需要的地方(编排)避免框架负担。
</details>
<details>
<summary><strong>JSON 工作流能否处理分支、循环和错误处理等复杂逻辑?</strong></summary>
可以。Conductor 支持 `SWITCH`(条件分支)、`DO_WHILE`(可配置迭代清理的循环)、`FORK_JOIN`(动态扇出的并行执行)、`SUB_WORKFLOW`(组合),以及运行时解析的 `DYNAMIC` 任务。这些能力可组合——你可以在 fork 内的分支中嵌套循环。对于错误处理,每个任务都支持可配置的重试、超时,以及可选/补偿任务。声明式模型不会限制复杂度——它让复杂度可见且可调试。
</details>
<details>
<summary><strong>Conductor 如何处理工作流版本控制?</strong></summary>
工作流定义按编号进行版本管理。正在运行的执行会继续使用启动时的版本——部署新版本永远不会破坏进行中的工作流。不存在重放兼容性问题,因为 Conductor 不会重放你的代码。编排图是唯一真相来源,每次执行都固定在其定义版本上。更新编排逻辑时无需重新部署 worker,也无需担心破坏正在运行的工作流。
</details>
<details>
<summary><strong>开发者体验如何——IDE 支持、类型检查、调试?</strong></summary>
Conductor 提供内置可视化 UI,用于设计、运行和调试工作流。每次执行都可完全观测:你可以检查每个任务的输入、输出、时序和重试历史。为实现类型安全(type safety),Conductor 会根据 JSON Schema 验证工作流输入和任务 I/O。Worker 是你所选语言中的普通代码——你的业务逻辑可获得完整的 IDE 支持、类型检查和调试能力。编排层在 UI 中可见,而非隐藏在框架内部。
</details>
<details>
<summary><strong>Conductor 能处理长时间运行的工作流(数天、数周、数月)吗?</strong></summary>
可以。Conductor 专为长时间运行的工作流而设计。执行状态会完整持久化——工作流可以暂停数月,等待人工审批、外部信号或定时器,并在中断处精确恢复。不存在会丢失的内存状态。这正是让 AI agent 循环具备持久性的机制:如果第 12 次迭代等待人工审核三周,第 13 次迭代会从中断处继续。
</details>
<details>
<summary><strong>不把编排写在代码里,会不会失去灵活性?</strong></summary>
你会获得更大的灵活性。由于工作流是 JSON 格式,LLM 可以在运行时生成和修改它们——无需编译/部署周期。动态分叉(dynamic forks)可让你扇出(fan out)到运行时确定的可变数量的并行任务。动态子工作流(dynamic sub-workflows)允许一个工作流按名称组合其他工作流。由于 worker 与编排解耦,你可以独立更新工作流图或替换 worker 实现。代码优先(code-first)引擎将两者耦合在一起,因此更改编排意味着重新部署和重新版本化你的代码。
</details>
<details>
<summary><strong>Conductor 与其他工作流引擎相比如何?</strong></summary>
Conductor 是开源工作流引擎,原生支持 14+ 提供商的 LLM 任务类型,内置 MCP 集成、持久化执行、完整可重放性,以及 7 种语言的 SDK。与代码优先引擎不同,Conductor 将编排与业务逻辑分离——确定性是架构层面的保证,而非开发者的约束。你的 worker 是普通代码,零框架规则。编排层是声明式的,因此可被 LLM 观测、版本化和组合。已在 Netflix、Tesla、LinkedIn 和 J.P. Morgan 经实战检验。
</details>
<details>
<summary><strong>Orkes Conductor 与 Conductor OSS 兼容吗?</strong></summary>
100% 兼容。Orkes Conductor 构建于 Conductor OSS 之上,具备完整的 API 和工作流兼容性。
</details>
---
# 贡献
我们欢迎所有人贡献!
- **报告问题:** 在 GitHub 上提交 [issue](https://github.com/conductor-oss/conductor/issues).
- **贡献代码:** 查看我们的[贡献指南](CONTRIBUTING.md)和[适合新手的 issue](https://github.com/conductor-oss/conductor/labels/good%20first%20issue).
- **改进文档:** 帮助维护我们的[文档](https://github.com/conductor-oss/conductor/tree/main/docs)。
## 贡献者
<a href="https://github.com/conductor-oss/conductor/graphs/contributors">
<img src="https://contrib.rocks/image?repo=conductor-oss/conductor" />
</a>
---
# 路线图
[查看 Conductor OSS 路线图](ROADMAP.md)。想参与?[联系我们](https://forms.gle/P2i1xHrxPQLrjzTB7).
# 许可证
Conductor 采用 [Apache 2.0 License](LICENSE) 许可证。