Quick Start
1
Run the team over a list of inputs
Each input dict fills the
{{placeholder}} slots in your task templates.2
Run it asynchronously
astart_for_each is the async twin — same inputs, same result shape.How It Works
The team runs once per input dict, restoring its original templates afterwards so it stays reusable.Result Shape
start_for_each returns a plain dict summarising the whole batch.
Each entry in
items has this shape:
Parameters
Error Handling
Choose whether a failing item stops the batch or is recorded and skipped.- continue (default)
- fail_fast
Errors are captured per item; the batch runs to completion.
Common Patterns
Generate bios for many names in one call.Best Practices
Use double braces in templates
Use double braces in templates
Placeholders use
{{name}} (double braces). This runs through the team’s built-in variables interpolator, not Python’s str.format. Single braces are left untouched.Pick on_error by job type
Pick on_error by job type
Use
on_error="continue" for bulk jobs where one bad row shouldn’t stop the rest. Use on_error="fail_fast" for evaluation harnesses that must halt on the first failure.token_usage_total is session-cumulative
token_usage_total is session-cumulative
token_usage_total comes from get_token_usage_summary() and reflects cumulative session usage, not just this batch. For finer accounting, reset the team between batches or inspect per-item outputs.The team stays reusable
The team stays reusable
self.variables and the task templates are restored in a finally block after every batch, so you can call start_for_each again — or start() — on the same team without side effects.Related
AgentTeam
The team class behind batch runs.
Multi-Agent Execution
How teams execute tasks.
Dynamic Variables
How
{{placeholder}} interpolation works.Async Crew Kickoff
Running teams asynchronously.

