
Your First Workflow
Here’s a simple workflow that takes a topic, researches it, and writes an article:- Passes your input to the researcher
- Takes the research results and feeds them to the writer
- Returns the final article
Why should you use Workflows?
Workflows provide deterministic control over your agentic systems, enabling you to build reliable automation that executes consistently every time. They’re essential when you need: Deterministic Execution- Predictable step-by-step processing with defined inputs and outputs
- Consistent results across multiple runs
- Clear audit trails for production systems
- Multi-agent coordination with controlled handoffs
- Parallel processing and conditional branching
- Loop structures for iterative tasks
What Can Be a Step?
Each step in your workflow can be:- An Agent - Individual AI executors with specific capabilities and instructions
- A Team - Coordinated groups of agents working together on complex problems
- A Function - Custom Python functions for specialized processing logic
Your agents and teams retain their individual characteristics and capabilities, but now operate within a structured framework that ensures:
- Predictable execution: Steps run in defined order with controlled inputs/outputs
- Repeatable results: Same inputs produce consistent outputs across runs
- Clear data flow: Output from each step explicitly becomes input for the next
- Controlled state: Session management and state persistence between steps
- Reliable error handling: Built-in retry mechanisms and error recovery
Controlling Workflows
Once comfortable with basic workflows, you can add:- Conditional Logic - Different paths based on results
- Parallel Execution - Run multiple steps at the same time
- Loops - Repeat steps until a condition is met
- Conversational Workflows - When users interact directly with your workflow (rather than calling it programmatically), you can make it conversational by adding a
WorkflowAgent. This enables natural chat-like interactions where the workflow intelligently decides whether to answer from previous results or execute new workflow runs. Learn more in the Conversational Workflows guide.
