Hi community,![]()
I am new in CrewAI. I have a question about the interplay between task-level async_execution=True and the crew kickoff method in CrewAI.
In my workflow, I define a Crew with multiple Task objects. Some tasks are marked with async_execution=True, meaning they can execute asynchronously relative to other tasks. My question is:
If one or more tasks are marked
async_execution=True, does that require me to usecrew.kickoff_async()(instead ofcrew.kickoff()) to correctly execute the Crew asynchronously (or in parallel)?
Or can I still callcrew.kickoff(), and the tasks withasync_execution=Truewill automatically run asynchronously within that call?
The code is like this:
...
task_one = Task(
description="List of 5 interesting ideas to explore for an article about AI.",
expected_output="Bullet point list of 5 ideas for an article.",
agent=researcher,
async_execution=True # Will be executed asynchronously
)
task_two = Task(
description="Research the history of AI and give me the 5 most important events.",
expected_output="Bullet point list of 5 important events.",
agent=researcher,
async_execution=True # Will be executed asynchronously
)
# I expect Agent1 is assigned to task1 and agent2 to task2 asynchronously.
my_crew = Crew(
agents=[self.agent_one(), self.agent_two()],
tasks=[self.task_one(), self.task_two()],
process=Process.sequential,
verbose=True
)
# should I use ?
my_crew.kickoff()
# or ?
my_crew.kickoff_async()
I want to understand whether the async flag at the task level is sufficient for parallelism, or whether kickoff_async (or another async-specific kickoff method) is required for non-blocking / concurrent execution of the full crew.
Thank you for any clarification or examples of how this works in practice.
Best regards.