Process
Understanding Process Types in PraisonAI
Understanding Process Types
Process types in PraisonAI define how tasks are executed and how agents collaborate. Each process type offers different patterns for task execution and agent coordination.
Process Types Overview
Three types of processes are implemented in PraisonAI:
Sequential Process
Linear task execution in a predefined order
Hierarchical Process
Manager-coordinated task execution with dynamic assignment
Workflow Process
Complex task flows with conditional execution and state management
Sequential Process
The simplest form of task execution where tasks are performed one after another.
Characteristics
- Linear execution flow
- Predictable order
- Simple dependency management
- Direct task progression
Usage
Hierarchical Process
Uses a manager agent to coordinate task execution and agent assignments.
Characteristics
- Manager-driven coordination
- Dynamic task assignment
- Flexible execution order
- Intelligent resource allocation
Configuration
Workflow Process
Advanced process type supporting complex task relationships and conditional execution.
Features
- Task dependencies
- Conditional branching
- Loop handling
- Context sharing
- State management
Implementation
Advanced Features
State Management
- Task state tracking
- Context preservation
- Data flow control
Error Handling
- Graceful failure recovery
- Alternative path execution
- Error reporting
Monitoring
- Progress tracking
- Performance metrics
- Resource utilization
Integration
- External system coordination
- API synchronization
- Event handling
Async Process Execution
All process types (sequential, workflow, hierarchical) support async execution through async generators. This enables efficient handling of async tasks and parallel processing.
Async Process Methods
asequential
: Async version of sequential processaworkflow
: Async version of workflow processahierarchical
: Async version of hierarchical process
Example Usage:
Async Process Features:
- Parallel task execution in workflow
- Async task delegation in hierarchical process
- Non-blocking task execution
- Efficient resource utilization
- Mixed sync/async task support
Process-Specific Async Behavior:
-
Sequential Process:
- Tasks are executed in order
- Async tasks don’t block other tasks
- Maintains sequential order while allowing async execution
-
Workflow Process:
- Parallel execution of independent tasks
- Async branching and merging
- Dynamic task scheduling
-
Hierarchical Process:
- Async manager delegation
- Parallel subtask execution
- Dynamic task assignment