Start For Each • AI Agent SDK
start_for_each: Run this team once per input dict, interpolating “key“ placeholders.
start_for_each
Method
</div>
This is a method of the AgentTeam class in the agents module.
Run this team once per input dict, interpolating `{{key}}` placeholders.
Each input dict is applied as per-run `variables (existing {{placeholder}}` interpolation in task descriptions), so the original task templates are never permanently mutated.
Signature
def start_for_each(inputs: Any) -> AnyParameters
ParamField
AnyList of dicts; each runs the team once with those variables.
Returns
ResponseField
Anydict with `batch_id, items (per-item index/input/ success/output/error), outputs, succeeded, failed, total and token_usage_total`.
Uses
ValueErrorstart_for_eachuuid.uuid4start
Used By
Source
View on GitHubpraisonaiagents/agents/agents.py at line 3004