DS DevShelfHub Projects · AI tools
Tutorials / CrewAI / Reference / Methods / kickoff_for_each_async()
Method Crew

kickoff_for_each_async(): Reference Guide

By DevShelfHub

Async batch — runs all items concurrently with bounded concurrency.

See the CrewAI methods catalog, CrewAI introduction, kickoff() reference, and core concepts for surrounding context.

What is kickoff_for_each_async()?

kickoff_for_each_async mirrors kickoff_for_each but schedules independent kickoff_async workloads so IO-heavy agents can overlap waiting on LLMs and tools. CrewAI still honors max_rpm and per-agent limits you configured on the Crew, which is the primary guardrail against blasting OpenAI-style endpoints with hundreds of simultaneous completions.

Because concurrency is real, ordering of completion times is nondeterministic even if the returned list is normalized back to input order — log correlation ids inside each inputs dict when tracing. Pair the call with structured observability (trace ids propagated into hooks) so you can stitch parallel spans after the fact.

When items are not independent — for example, they share a SQLite memory file — consider lowering concurrency or externalizing the store to a server that handles concurrent writers. Otherwise you risk database lock contention that shows up as flaky timeouts rather than clean exceptions.

Use Cases

  • Async batch generation
  • Parallel enrichment

Key Features

  • Concurrent execution
  • Respects max_rpm

When NOT to Use

Synchronous scripts.

Notes

429 storms

max_rpm throttles aggregate requests but does not understand per-account burst quotas. Add exponential backoff at the HTTP client layer when you see repeated rate-limit responses.

Deterministic debugging

Parallel runs interleave logs. Include a batch_index or business id in every tool call via inputs so log aggregators can filter one row's story.

Memory backends under load

Embedded Chroma or local SQLite can serialize writes. If you need high parallel fan-out, move memory to a networked vector store and monitor p99 insert latency.

Backpressure vs throughput

Sometimes fewer in-flight crews with deeper tasks beat many shallow concurrent crews because each completion frees provider capacity for the next wave.

Parameters

Parameter Type Required Purpose
inputs list[dict] No List of input dicts.

Code Examples

Async batch

python
results = await crew.kickoff_for_each_async(inputs=batch)

With asyncio timeout

python
import asyncio

try:
    results = await asyncio.wait_for(
        crew.kickoff_for_each_async(inputs=batch),
        timeout=600,
    )
except asyncio.TimeoutError:
    raise RuntimeError('batch exceeded SLA')

When to Use

Async batch jobs with concurrency.

Common Mistakes

❌ Not setting max_rpm and getting 429s

✅ Tune Crew(max_rpm=...) to your provider's limit.

Related: @tool decorator reference, Agent class reference, and the first Crew tutorial.

kickoff_for_each_async() FAQ

What is kickoff_for_each_async() in CrewAI?

Async batch — runs all items concurrently with bounded concurrency. kickoff_for_each_async mirrors kickoff_for_each but schedules independent kickoff_async workloads so IO-heavy agents can overlap waiting on LLMs and tools. CrewAI still honors max_rpm and per-agent limits you configured on the Crew, which is the primary guardrail against blasting OpenAI-style endpoints with hundreds of simultaneous completions. Because concurrency is real, ordering of completion times is nondeterministic even if the returned list is normalized back to input …

Which CrewAI types expose the method kickoff_for_each_async()?

DevShelfHub documents kickoff_for_each_async() on Crew. The reference maps it to Python module crewai.Crew — pin your installed crewai version and match imports to the snippet on this page.

When should I use kickoff_for_each_async()?

Async batch jobs with concurrency.

When should I avoid kickoff_for_each_async()?

Synchronous scripts.

How do I call kickoff_for_each_async() from Python?

results = await crew.kickoff_for_each_async(inputs=batch)

Where can I explore more CrewAI API reference pages?

Open the CrewAI API reference index on DevShelfHub to search classes, methods, and decorators, each with runnable examples, parameters, common mistakes, and cross-links.