This page covers
AgentFlow(process="hierarchical") — where a manager validates each step’s output before the next step runs. If you want a manager that delegates tasks to agents by name (the classic PraisonAIAgents(agents=[...], tasks=[...], process="hierarchical") flow), see Hierarchical Process.Steps inside hierarchical mode inherit the same
max_retries, guardrails, and output_file policies as top-level steps. See Nested workflows → Retry, guardrails, and output_file.How It Works
Sequential (Default)
Steps run one after another without validation
Hierarchical
Manager validates each step before proceeding
Quick Start
1
Simple Usage
- Python
- YAML
2
With Configuration
Define the same workflow in YAML with process: hierarchical and a manager_llm — see the YAML tab.
Parameters
string
default:"sequential"
Workflow execution mode:
sequential- Steps run without validation (default)hierarchical- Manager validates each step
string
default:"null"
LLM model for the manager agent. If not specified, uses the workflow’s
default_llm.Manager Validation
The manager agent evaluates each step’s output based on:1
Task Completion
Does the output address the task?
2
Quality Check
Is the output meaningful (not an error)?
3
Expected Output
Does it meet the step’s expected output criteria?
Handling Failures
Result Structure
When to Use
Quality-Critical Workflows
Quality-Critical Workflows
When each step must meet quality standards before proceeding.
Multi-Agent Pipelines
Multi-Agent Pipelines
When agents depend on validated output from previous agents.
Production Workflows
Production Workflows
When you need graceful failure handling with clear reasons.
Forcing Tool Usage
- YAML
- Python
string
default:"auto"
Controls when the LLM calls tools:
auto- LLM decides whether to call tools (default)required- LLM must call a tool before respondingnone- LLM cannot call tools
Comparison
Real-World Examples
Research & Writing Pipeline
Research & Writing Pipeline
Data Analysis Pipeline
Data Analysis Pipeline
Code Review Pipeline
Code Review Pipeline
Best Practices
Use a cheaper model for the manager
Use a cheaper model for the manager
The manager only validates output, so a smaller
manager_llm like gpt-4o-mini keeps cost low without hurting quality.Force tool usage in tool-heavy steps
Force tool usage in tool-heavy steps
Set
tool_choice="required" so the manager can confirm tools actually ran before approving a step.Always check result status
Always check result status
Inspect
result["status"] and result["failure_reason"] before using the output — hierarchical workflows fail gracefully rather than raising.Keep steps single-purpose
Keep steps single-purpose
Narrow, well-scoped steps make manager validation more reliable than broad, multi-goal steps.
Related
AgentFlow
Deterministic multi-step pipelines
Conditional Execution
Branch workflows on runtime conditions
AgentTeam
Multi-agent task orchestration
Handoffs
Transfer control between agents

