Documentation Index
Fetch the complete documentation index at: https://crewai-lorenze-imp-docs-improvements.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
When to Use Each Process
- Use
sequentialwhen task order is fixed and outputs feed directly into the next task. - Use
hierarchicalwhen you need a manager to delegate and validate work dynamically.
When Not to Use Hierarchical
- You do not need dynamic delegation.
- You cannot provide a reliable
manager_llmormanager_agent.
Process Implementations
- Sequential: Executes tasks sequentially, ensuring tasks are completed in an orderly progression.
- Hierarchical: Organizes tasks in a managerial hierarchy, where tasks are delegated and executed based on a structured chain of command. A manager language model (
manager_llm) or a custom manager agent (manager_agent) must be specified in the crew to enable the hierarchical process, facilitating the creation and management of tasks by the manager.
The Role of Processes in Teamwork
Processes enable individual agents to operate as a cohesive unit, streamlining their efforts to achieve common objectives with efficiency and coherence.Assigning Processes to a Crew
To assign a process to a crew, specify the process type upon crew creation to set the execution strategy. For a hierarchical process, ensure to definemanager_llm or manager_agent for the manager agent.
my_agents and my_tasks are defined prior to creating a Crew object, and for the hierarchical process, either manager_llm or manager_agent is also required.
Sequential Process
This method mirrors dynamic team workflows, progressing through tasks in a thoughtful and systematic manner. Task execution follows the predefined order in the task list, with the output of one task serving as context for the next. To customize task context, utilize thecontext parameter in the Task class to specify outputs that should be used as context for subsequent tasks.
Hierarchical Process
Emulates a corporate hierarchy, CrewAI allows specifying a custom manager agent or automatically creates one, requiring the specification of a manager language model (manager_llm). This agent oversees task execution, including planning, delegation, and validation. Tasks are not pre-assigned; the manager allocates tasks to agents based on their capabilities, reviews outputs, and assesses task completion.
Process Class: Detailed Overview
TheProcess class is implemented as an enumeration (Enum), ensuring type safety and restricting process values to the defined types (sequential, hierarchical).
Conclusion
The structured collaboration facilitated by processes within CrewAI is crucial for enabling systematic teamwork among agents.Common Failure Modes
Hierarchical process fails at startup
- Cause: missing
manager_llmormanager_agent. - Fix: provide one of them explicitly in crew configuration.
Sequential process produces weak outputs
- Cause: task boundaries/context are underspecified.
- Fix: improve task descriptions, expected outputs, and task context chaining.
