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: examples/README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,24 @@ These are more advanced examples, most of them involve some sort of MCP server t
44
44
|[couchbase_agent.yaml](couchbase_agent.yaml)| Run Database commands using MCP tools |||||| docker,[couchbase](https://hub.docker.com/mcp/server/couchbase/overview)||
45
45
|[notion-expert.yaml](notion-expert.yaml)| Notion documentation expert using OAuth ||||||[notion](https://mcp.notion.com) (uses OAuth) ||
46
46
47
+
## **Workflow Configurations**
48
+
49
+
These examples demonstrate sequential workflow execution where multiple agents are chained together. Each agent processes the output from the previous agent, creating a pipeline of transformations. Workflows don't require a root agent - they execute agents in the order defined in the workflow section.
50
+
51
+
See [WORKFLOW_README.md](WORKFLOW_README.md) for detailed documentation.
52
+
53
+
| Name | Description/Purpose | Steps | Models Used |
- Agents execute sequentially in the order defined
61
+
- Output from each agent becomes input for the next
62
+
- No root agent required
63
+
- Run with: `./bin/cagent run examples/story_workflow.yaml`
64
+
47
65
## **Multi-Agent Configurations**
48
66
49
67
These examples are groups of agents working together. Each of them is specialized for a given task, and usually has some tools assigned to fulfill these tasks.
This directory contains examples of sequential workflow execution in cagent. Workflows allow you to chain multiple agents together, where each agent processes the output from the previous agent.
4
+
5
+
## Examples
6
+
7
+
### Story Generation Workflow
8
+
9
+
The `story_workflow.yaml` file demonstrates a creative writing workflow with three agents:
10
+
11
+
1.**story_starter** - Writes the opening paragraph of a story about a robot learning to cook
12
+
2.**add_dialogue** - Continues the story by adding dialogue between the robot and a chef
13
+
3.**add_ending** - Completes the story with a satisfying conclusion
14
+
15
+
```bash
16
+
./bin/cagent run examples/story_workflow.yaml
17
+
```
18
+
19
+
### Product Description Workflow
20
+
21
+
The `product_description_workflow.yaml` file shows a marketing content workflow:
22
+
23
+
1.**draft_writer** - Creates an initial product description for a smart water bottle
24
+
2.**make_exciting** - Rewrites the description with more engaging language
25
+
3.**add_cta** - Adds a compelling call-to-action
26
+
27
+
```bash
28
+
./bin/cagent run examples/product_description_workflow.yaml
29
+
```
30
+
31
+
### Joke Workflow
32
+
33
+
The `joke_workflow.yaml` demonstrates a simple two-step comedy workflow:
34
+
35
+
1.**joke_writer** - Creates an original joke
36
+
2.**joke_improver** - Enhances the joke with better timing or punchline
37
+
38
+
```bash
39
+
./bin/cagent run examples/joke_workflow.yaml
40
+
```
41
+
42
+
## How It Works
43
+
44
+
The `run` command automatically detects workflows by checking if the configuration file contains a `workflow` section. No special command is needed!
45
+
46
+
## Workflow Configuration
47
+
48
+
### Basic Structure
49
+
50
+
```yaml
51
+
version: "2"
52
+
53
+
agents:
54
+
agent_name:
55
+
model: openai/gpt-4o
56
+
instruction: |
57
+
Your agent instructions here
58
+
59
+
workflow:
60
+
- type: agent
61
+
name: agent_name
62
+
- type: agent
63
+
name: next_agent
64
+
```
65
+
66
+
### Key Features
67
+
68
+
1. **Sequential Execution**: Agents run in the order defined in the workflow
69
+
2. **Data Piping**: The output of each agent becomes the input for the next agent
70
+
3. **Automatic Context**: The first agent receives instructions to generate initial content, subsequent agents receive the previous output as input
71
+
4. **No Root Agent Required**: Workflows don't need a "root" agent - just define the agents used in your workflow steps
72
+
73
+
### Example Flow
74
+
75
+
```
76
+
Step 1: story_starter
77
+
→ Output: "RoboChef-42 had never encountered a kitchen before..."
78
+
79
+
Step 2: add_dialogue (receives previous output)
80
+
→ Output: "...Chef Lucia approached with curiosity..."
81
+
82
+
Step 3: add_ending (receives previous output)
83
+
→ Output: "...a bright future in the culinary world."
84
+
```
85
+
86
+
## Command Options
87
+
88
+
Workflows support the same runtime configuration flags as regular agent runs:
89
+
90
+
### Running without TUI (CLI mode)
91
+
92
+
```bash
93
+
./bin/cagent run examples/story_workflow.yaml --tui=false
0 commit comments