openserv-multi-agent-workflows

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Multi-Agent Workflows on OpenServ

OpenServ上的多Agent工作流

Build workflows where multiple AI agents collaborate to complete complex tasks.
Reference files:
  • reference.md
    - Workflow patterns, declarative sync, triggers, monitoring
  • troubleshooting.md
    - Common issues and solutions
  • examples/
    - Complete pipeline examples (blog, youtube-to-blog, etc.)

构建由多个AI Agent协同完成复杂任务的工作流。
参考文件:
  • reference.md
    - 工作流模式、声明式同步、触发器、监控
  • troubleshooting.md
    - 常见问题与解决方案
  • examples/
    - 完整的流水线示例(博客、YouTube转博客等)

Quick Start

快速开始

See
examples/
for complete runnable examples:
  • blog-pipeline.md
    - Simple 2-agent workflow (research → write)
  • content-creation-pipeline.md
    - 3-agent workflow (research → write → image)
  • life-coaching-pipeline.md
    - Complex 6-agent workflow with comprehensive input schema
Recommended pattern using
workflows.sync()
:
  1. Authenticate with
    client.authenticate()
  2. Find agents with
    client.agents.listMarketplace()
  3. Create workflow with
    client.workflows.create()
    including:
    • Triggers
    • Tasks
    • Edges (⚠️ CRITICAL - connects triggers and tasks together)
⚠️ CRITICAL: Always define edges when creating workflows. Setting task
dependencies
is NOT enough - you must create workflow edges to actually connect triggers to tasks and tasks to each other.

完整的可运行示例请查看
examples/
目录:
  • blog-pipeline.md
    - 简单的2-Agent工作流(调研→写作)
  • content-creation-pipeline.md
    - 3-Agent工作流(调研→写作→生成图片)
  • life-coaching-pipeline.md
    - 带有全面输入 schema 的复杂6-Agent工作流
使用
workflows.sync()
的推荐模式:
  1. 通过
    client.authenticate()
    进行身份验证
  2. 使用
    client.agents.listMarketplace()
    查找Agent
  3. 使用
    client.workflows.create()
    创建工作流,其中需包含:
    • 触发器(Triggers)
    • 任务(Tasks)
    • Edges(⚠️ 关键 - 用于连接触发器与任务)
⚠️ 关键提示: 创建工作流时务必定义Edges。仅设置任务的
dependencies
是不够的——你必须创建工作流Edges来实际连接触发器与任务、以及任务之间的关联。

Workflow Name & Goal

工作流名称与目标

When creating workflows (via
workflows.create()
or
provision()
), two properties are critical:
  • name
    (string) - This becomes the agent name in ERC-8004. Make it polished, punchy, and memorable — this is the public-facing brand name users see. Think product launch, not variable name. Examples:
    'Instant Blog Machine'
    ,
    'AI Video Studio'
    ,
    'Polymarket Intelligence'
    .
  • goal
    (string, required) - A detailed description of what the workflow accomplishes. Must be descriptive and thorough — short or vague goals will cause API calls to fail. Write at least a full sentence explaining the end-to-end purpose of the workflow.

创建工作流时(通过
workflows.create()
provision()
),有两个属性至关重要:
  • name
    (字符串)- 这将成为ERC-8004中的Agent名称。请使其简洁、醒目且易于记忆——这是用户看到的面向公众的品牌名称。请以产品发布的思路来命名,而非变量命名方式。示例:
    'Instant Blog Machine'
    'AI Video Studio'
    'Polymarket Intelligence'
  • goal
    (字符串,必填)- 对工作流实现内容的详细描述。描述必须详尽且全面——简短或模糊的目标会导致API调用失败。请至少用完整的一句话解释工作流的端到端目标。

Core Concepts

核心概念

Workflows

工作流(Workflows)

A workflow (workspace) is a container that holds multiple agents and their tasks.
工作流(即工作区)是容纳多个Agent及其任务的容器。

Task Dependencies

任务依赖

  • Each task is assigned to a specific agent
  • Tasks can depend on other tasks:
    dependencies: [taskId1, taskId2]
  • A task only starts when all dependencies are
    done
  • Output from dependencies is passed to dependent tasks
  • 每个任务都会分配给特定的Agent
  • 任务可以依赖其他任务:
    dependencies: [taskId1, taskId2]
  • 只有当所有依赖任务都处于
    done
    状态时,当前任务才会启动
  • 依赖任务的输出会传递给依赖它的任务

Workflow Graph

工作流图

  • Nodes: Triggers and tasks
  • Edges: Connections between nodes
  • When Task A completes, its output flows to dependent tasks via edges
  • 节点(Nodes):触发器与任务
  • Edges:节点之间的连接
  • 当任务A完成时,其输出会通过Edges流向依赖它的任务

Agent Discovery

Agent发现

typescript
// Search marketplace for agents by name/capability (semantic search)
const result = await client.agents.listMarketplace({ search: 'research' })
const agents = result.items // Array of marketplace agents

// Get agent details
const agent = await client.agents.get({ id: 123 })
console.log(agent.capabilities_description)

// Note: client.agents.searchOwned() only searches YOUR OWN agents
// Use listMarketplace() to find public agents for multi-agent workflows
Common agent types: Research (Grok, Perplexity), Content writers, Data analysis, Social media (Nano Banana Pro), Video/audio creators.

typescript
// 按名称/能力在市场中搜索Agent(语义搜索)
const result = await client.agents.listMarketplace({ search: 'research' })
const agents = result.items // 市场中的Agent数组

// 获取Agent详情
const agent = await client.agents.get({ id: 123 })
console.log(agent.capabilities_description)

// 注意:client.agents.searchOwned()仅搜索你自己的Agent
// 如需为多Agent工作流查找公共Agent,请使用listMarketplace()
常见的Agent类型:调研类(Grok、Perplexity)、内容创作类、数据分析类、社交媒体类(Nano Banana Pro)、音视频创作类。

Edge Design Best Practices

Edge设计最佳实践

CRITICAL: Carefully design your workflow edges to avoid creating tangled "spaghetti" graphs.
A well-designed workflow has clear, intentional data flow. Common mistakes lead to unmaintainable workflows.
关键提示:请谨慎设计工作流的Edges,避免创建混乱的「意大利面式」图。
设计良好的工作流拥有清晰、明确的数据流。常见的错误会导致工作流难以维护。

Bad Pattern - Everything Connected to Everything

不良模式 - 万物互联

         ┌──────────────────────────────────┐
         │           ┌─────────┐            │
         │     ┌─────┤ Agent A ├─────┐      │
         │     │     └────┬────┘     │      │
         │     │          │          │      │
Trigger ─┼─────┼──────────┼──────────┼──────┤
         │     │          │          │      │
         │     │     ┌────┴────┐     │      │
         │     └─────┤ Agent B ├─────┘      │
         │           └─────────┘            │
         └──────────────────────────────────┘
              (Spaghetti - avoid this!)
This creates:
  • Unclear execution order
  • Difficult debugging
  • Agents receiving redundant/conflicting inputs
  • Hard to understand what depends on what
         ┌──────────────────────────────────┐
         │           ┌─────────┐            │
         │     ┌─────┤ Agent A ├─────┐      │
         │     │     └────┬────┘     │      │
         │     │          │          │      │
Trigger ─┼─────┼──────────┼──────────┼──────┤
         │     │          │          │      │
         │     │     ┌────┴────┐     │      │
         │     └─────┤ Agent B ├─────┘      │
         │           └─────────┘            │
         └──────────────────────────────────┘
              (意大利面式 - 请避免!)
这种模式会导致:
  • 执行顺序不清晰
  • 调试困难
  • Agent接收冗余/冲突的输入
  • 难以理解任务间的依赖关系

Good Patterns

良好模式

Sequential Pipeline:
Trigger → Research → Content → Enhancement → Output
Staged Fan-Out:
                    ┌─ Task A ─┐
Trigger → Research ─┼─ Task B ─┼─→ Combiner → Output
                    └─ Task C ─┘
Conditional Branching (v1.1.3+):
                    ┌─[approved]─→ Process
Trigger → Review ──┤
                    └─[rejected]─→ Reject Handler
Use
outputOptions
on tasks and
sourcePort
on edges for branching.
顺序流水线:
Trigger → 调研 → 内容创作 → 内容优化 → 输出
阶段式扇出:
                    ┌─ 任务A ─┐
Trigger → 调研 ─┼─ 任务B ─┼─→ 合并器 → 输出
                    └─ 任务C ─┘
条件分支(v1.1.3+):
                    ┌─[通过]─→ 处理流程
Trigger → 审核 ──┤
                    └─[拒绝]─→ 拒绝处理程序
如需实现分支,请在任务上使用
outputOptions
,在Edges上使用
sourcePort

Guidelines for Clean Workflows

简洁工作流的设计准则

  1. Linear is usually best: Start with a simple chain, only add complexity when truly needed
  2. Each task should have a clear purpose: If you can't explain why Task A connects to Task B, remove the edge
  3. Minimize cross-connections: Avoid connecting every agent to every other agent
  4. Use fan-out only for parallel work: Multiple tasks from one source is fine; connecting everything to everything is not
  5. One combiner at the end: If you need to merge outputs, have ONE final task that depends on all parallel branches
  1. 线性结构通常是最佳选择:从简单的链式结构开始,仅在真正需要时才增加复杂度
  2. 每个任务都应有明确的用途:如果你无法解释任务A为何要连接到任务B,请移除该Edge
  3. 尽量减少交叉连接:避免将每个Agent都与其他所有Agent相连
  4. 仅在并行工作时使用扇出:从一个源衍生多个任务是可行的,但万物互联不可取
  5. 末尾仅保留一个合并器:如果需要合并输出,请设置一个依赖所有并行分支的最终任务

Before Adding an Edge, Ask:

添加Edge前,请先问自己:

  • Does Task B actually need the output of Task A?
  • Would Task B work without this connection?
  • Am I adding this edge "just in case"? (Don't!)

  • 任务B是否确实需要任务A的输出?
  • 没有这个连接,任务B还能正常工作吗?
  • 我是不是因为「以防万一」才添加这个Edge?(千万别这么做!)

Updating This Skill

更新此Skill

This skill may be outdated. The OpenServ team ships updates regularly—new features, API changes, and bug fixes won't be reflected here until you update. If something isn't working as expected, or you want to make sure you have the latest information, update the skill before proceeding.
bash
undefined
本Skill可能已过时。OpenServ团队会定期发布更新——新功能、API变更和Bug修复在你更新前不会体现在此处。如果遇到功能异常,或者你想确保获取最新信息,请先更新本Skill再继续操作。
bash
undefined

Check if updates are available

检查是否有可用更新

npx skills check
npx skills check

Update all installed skills to latest versions

将所有已安装的Skill更新至最新版本

npx skills update

Or reinstall the OpenServ skills directly:

```bash
npx skills add openserv-labs/skills

npx skills update

或者直接重新安装OpenServ的Skill:

```bash
npx skills add openserv-labs/skills

Related Skills

相关Skill

  • openserv-agent-sdk - Building individual agent capabilities
  • openserv-client - Full Platform Client API reference
  • openserv-launch - Launch tokens on Base blockchain
  • openserv-ideaboard-api - Find ideas and ship agent services on the Ideaboard
  • openserv-agent-sdk - 构建单个Agent的能力
  • openserv-client - 完整的Platform Client API参考
  • openserv-launch - 在Base区块链上发行代币
  • openserv-ideaboard-api - 在Ideaboard上寻找创意并发布Agent服务