OpenServ Multi Agent Workflows — OpenServ 多代理工作流程
v1.1.3在OpenServ Platform上合作的多代理人工作流程示例。涵盖代理人发现、多代理人工作空间、任务依赖和使用Platform Client的工作流程编排。阅读reference.md以获取完整的API参考。阅读openserv-agent-sdk和openserv-client以构建和运行代理人。
运行时依赖
安装命令
点击复制技能文档
Multi-代理 工作流s on OpenServ
Build 工作流s where multiple AI 代理s collaborate to complete complex tasks.
Reference files:
reference.md - 工作流 patterns, declarative 同步, triggers, 监控ing troubleshooting.md - Common issues and solutions examples/ - Complete 流水线 examples (b记录, youtube-to-b记录, etc.) Quick 启动
See examples/ for complete 运行nable examples:
b记录-流水线.md - Simple 2-代理 工作流 (re搜索 → write) content-creation-流水线.md - 3-代理 工作流 (re搜索 → write → image) life-coaching-流水线.md - Complex 6-代理 工作流 with comprehensive 输入 模式
Recommended pattern using 工作流s.同步():
认证 with 命令行工具ent.认证() Find 代理s with 命令行工具ent.代理s.列出Marketplace() 创建 工作流 with 命令行工具ent.工作流s.创建() including: Triggers Tasks Edges (⚠️ CRITICAL - connects triggers and tasks to获取her)
⚠️ CRITICAL: Always define edges when creating 工作流s. 设置ting task dependencies is NOT enough - you must 创建 工作流 edges to actually connect triggers to tasks and tasks to each other.
工作流 Name & Goal
When creating 工作流s (via 工作流s.创建() or provision()), two properties are critical:
name (string) - This becomes the 代理 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 B记录 Machine', 'AI Video Studio', 'Polymarket Intelligence'. goal (string, required) - A detAIled description of what the 工作流 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 工作流. Core Concepts 工作流s
A 工作流 (workspace) is a contAIner that holds multiple 代理s and their tasks.
Task Dependencies Each task is as签名ed to a specific 代理 Tasks can depend on other tasks: dependencies: [taskId1, taskId2] A task only 启动s when all dependencies are done 输出 from dependencies is passed to dependent tasks 工作流 Graph Nodes: Triggers and tasks Edges: Connections between nodes When Task A completes, its 输出 flows to dependent tasks via edges 代理 Discovery // 搜索 marketplace for 代理s by name/capability (semantic 搜索) const 结果 = awAIt 命令行工具ent.代理s.列出Marketplace({ 搜索: 're搜索' }) const 代理s = 结果.items // Array of marketplace 代理s
// 获取 代理 detAIls const 代理 = awAIt 命令行工具ent.代理s.获取({ id: 123 }) console.记录(代理.capabilities_description)
// Note: 命令行工具ent.代理s.搜索Owned() only 搜索es YOUR OWN 代理s // Use 列出Marketplace() to find public 代理s for multi-代理 工作流s
Common 代理 types: Re搜索 (Grok, Perplexity), Content writers, Data analysis, Social media (Nano Banana Pro), Video/audio 创建器s.
Edge De签名 Best Practices
CRITICAL: Carefully de签名 your 工作流 edges to avoid creating tangled "spaghetti" graphs.
A well-de签名ed 工作流 has clear, intentional data flow. Common mistakes lead to unmAIntAInable 工作流s.
Bad Pattern - Everything Connected to Everything ┌──────────────────────────────────┐ │ ┌─────────┐ │ │ ┌─────┤ 代理 A ├─────┐ │ │ │ └────┬────┘ │ │ │ │ │ │ │ Trigger ─┼─────┼──────────┼──────────┼──────┤ │ │ │ │ │ │ │ ┌────┴────┐ │ │ │ └─────┤ 代理 B ├─────┘ │ │ └─────────┘ │ └──────────────────────────────────┘ (Spaghetti - avoid this!)
This 创建s:
Unclear execution order Difficult 调试ging 代理s receiving redundant/conflicting 输入s Hard to understand what depends on what Good Patterns
Sequential 流水线:
Trigger → Re搜索 → Content → Enhancement → 输出
Staged Fan-Out:
┌─ Task A ─┐ Trigger → Re搜索 ─┼─ Task B ─┼─→ Combiner → 输出 └─ Task C ─┘
Conditional Branching (v1.1.3+):
┌─[应用roved]─→ Process Trigger → Review ──┤ └─[rejected]─→ Reject 处理器
Use 输出Options on tasks and sourcePort on edges for branching.
图形界面delines for 清理 工作流s Linear is usually best: 启动 with a simple chAIn, only 添加 complexity when truly needed Each task should have a clear purpose: If you can't explAIn why Task A connects to Task B, 移除 the edge Minimize cross-connections: Avoid connecting every 代理 to every other 代理 Use fan-out only for parallel work: Multiple tasks from one source is fine; connecting everything to everything is not One combiner at the end: If you need to merge 输出s, have ONE final task that depends on all parallel branches Before 添加ing an Edge, Ask: Does Task B actually need the 输出 of Task A? Would Task B work without this connection? Am I 添加ing this edge "just in case"? (Don't!) Updating This 技能
This 技能 may be outdated. The OpenServ team ships