Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

fix documentation for "Using Crews and Flows Together" (#2490)

theadityaraob0f9637662dd
diff --git a/README.md b/README.md
index b44ff6f4f..a1bf63645 100644
--- a/README.md
+++ b/README.md
@@ -401,11 +401,16 @@ You can test different real life examples of AI crews in the [CrewAI-examples re
### Using Crews and Flows Together
-CrewAI's power truly shines when combining Crews with Flows to create sophisticated automation pipelines. Here's how you can orchestrate multiple Crews within a Flow:
+CrewAI's power truly shines when combining Crews with Flows to create sophisticated automation pipelines.
+CrewAI flows support logical operators like `or_` and `and_` to combine multiple conditions. This can be used with `@start`, `@listen`, or `@router` decorators to create complex triggering conditions.
+- `or_`: Triggers when any of the specified conditions are met.
+- `and_`Triggers when all of the specified conditions are met.
+
+Here's how you can orchestrate multiple Crews within a Flow:
```python
-from crewai.flow.flow import Flow, listen, start, router
-from crewai import Crew, Agent, Task
+from crewai.flow.flow import Flow, listen, start, router, or_
+from crewai import Crew, Agent, Task, Process
from pydantic import BaseModel
# Define structured state for precise control
@@ -479,7 +484,7 @@ class AdvancedAnalysisFlow(Flow[MarketState]):
)
return strategy_crew.kickoff()
- @listen("medium_confidence", "low_confidence")
+ @listen(or_("medium_confidence", "low_confidence"))
def request_additional_analysis(self):
self.state.recommendations.append("Gather more data")
return "Additional analysis required"