You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+100Lines changed: 100 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,106 @@ Steps can declare dependencies using `after`:
295
295
296
296
Steps at the same dependency level run in parallel.
297
297
298
+
## Agent Orchestration
299
+
300
+
One of the most powerful use cases is orchestrating multiple AI agents in a deterministic pipeline. This lets you build reliable, repeatable AI workflows where specialized agents collaborate on complex tasks.
301
+
302
+
### Multi-Agent Code Review
303
+
304
+
This example chains multiple specialized agents to review code from different perspectives, then synthesizes their findings:
305
+
306
+
```json
307
+
{
308
+
"id": "code-review",
309
+
"name": "Multi-Agent Code Review",
310
+
"description": "Parallel expert review with synthesis",
311
+
"inputs": {
312
+
"file": {
313
+
"type": "string",
314
+
"description": "File path to review",
315
+
"required": true
316
+
}
317
+
},
318
+
"steps": [
319
+
{
320
+
"id": "read_file",
321
+
"type": "tool",
322
+
"tool": "read",
323
+
"args": { "filePath": "{{inputs.file}}" }
324
+
},
325
+
{
326
+
"id": "security_review",
327
+
"type": "agent",
328
+
"system": "You are a security expert. Identify vulnerabilities, injection risks, and auth issues. Be concise.",
329
+
"prompt": "Review this code for security issues:\n\n{{steps.read_file.result}}",
330
+
"model": "anthropic:claude-sonnet-4-20250514",
331
+
"after": ["read_file"]
332
+
},
333
+
{
334
+
"id": "perf_review",
335
+
"type": "agent",
336
+
"system": "You are a performance engineer. Identify bottlenecks, memory leaks, and optimization opportunities. Be concise.",
337
+
"prompt": "Review this code for performance issues:\n\n{{steps.read_file.result}}",
338
+
"model": "anthropic:claude-sonnet-4-20250514",
339
+
"after": ["read_file"]
340
+
},
341
+
{
342
+
"id": "quality_review",
343
+
"type": "agent",
344
+
"system": "You are a senior developer. Review for readability, maintainability, and best practices. Be concise.",
345
+
"prompt": "Review this code for quality issues:\n\n{{steps.read_file.result}}",
346
+
"model": "anthropic:claude-sonnet-4-20250514",
347
+
"after": ["read_file"]
348
+
},
349
+
{
350
+
"id": "synthesize",
351
+
"type": "agent",
352
+
"system": "You are a tech lead. Synthesize code reviews into a prioritized action list grouped by severity.",
353
+
"prompt": "Combine these reviews into a single report:\n\n## Security\n{{steps.security_review.response}}\n\n## Performance\n{{steps.perf_review.response}}\n\n## Quality\n{{steps.quality_review.response}}",
"description": "Parallel expert code review with synthesis and optional auto-fix",
5
+
"version": "1.0.0",
6
+
"tags": ["review", "agents", "quality"],
7
+
"inputs": {
8
+
"file": {
9
+
"type": "string",
10
+
"description": "File path to review",
11
+
"required": true
12
+
}
13
+
},
14
+
"steps": [
15
+
{
16
+
"id": "read_file",
17
+
"type": "tool",
18
+
"description": "Read the source file",
19
+
"tool": "read",
20
+
"args": {
21
+
"filePath": "{{inputs.file}}"
22
+
}
23
+
},
24
+
{
25
+
"id": "security_review",
26
+
"type": "agent",
27
+
"description": "Security vulnerability analysis",
28
+
"system": "You are a security expert. Identify vulnerabilities, injection risks, authentication issues, and data exposure. Be concise and specific.",
29
+
"prompt": "Review this code for security issues:\n\n{{steps.read_file.result}}",
30
+
"model": "anthropic:claude-sonnet-4-20250514",
31
+
"maxTokens": 1000,
32
+
"after": ["read_file"]
33
+
},
34
+
{
35
+
"id": "perf_review",
36
+
"type": "agent",
37
+
"description": "Performance analysis",
38
+
"system": "You are a performance engineer. Identify bottlenecks, memory leaks, N+1 queries, and optimization opportunities. Be concise and specific.",
39
+
"prompt": "Review this code for performance issues:\n\n{{steps.read_file.result}}",
40
+
"model": "anthropic:claude-sonnet-4-20250514",
41
+
"maxTokens": 1000,
42
+
"after": ["read_file"]
43
+
},
44
+
{
45
+
"id": "quality_review",
46
+
"type": "agent",
47
+
"description": "Code quality analysis",
48
+
"system": "You are a senior developer. Review for readability, maintainability, error handling, and best practices. Be concise and specific.",
49
+
"prompt": "Review this code for quality issues:\n\n{{steps.read_file.result}}",
50
+
"model": "anthropic:claude-sonnet-4-20250514",
51
+
"maxTokens": 1000,
52
+
"after": ["read_file"]
53
+
},
54
+
{
55
+
"id": "synthesize",
56
+
"type": "agent",
57
+
"description": "Synthesize reviews into prioritized action items",
58
+
"system": "You are a tech lead. Synthesize multiple code reviews into a single prioritized action list. Group issues by severity: critical, high, medium, low. Be actionable.",
59
+
"prompt": "Combine these code reviews into a prioritized report:\n\n## Security Review\n{{steps.security_review.response}}\n\n## Performance Review\n{{steps.perf_review.response}}\n\n## Quality Review\n{{steps.quality_review.response}}",
"description": "Human approval gate before generating fixes",
68
+
"message": "Code review complete for {{inputs.file}}:\n\n{{steps.synthesize.response}}\n\nResume to generate auto-fix suggestions.",
69
+
"after": ["synthesize"]
70
+
},
71
+
{
72
+
"id": "generate_fixes",
73
+
"type": "agent",
74
+
"description": "Generate fixed code",
75
+
"system": "You are a code fixer. Apply the requested fixes to the code. Output ONLY the complete corrected code with no explanations or markdown.",
76
+
"prompt": "Fix the critical and high severity issues in this code:\n\nOriginal code:\n{{steps.read_file.result}}\n\nIssues to fix:\n{{steps.synthesize.response}}",
0 commit comments