AgentTeam once and call start() as many times as you like — each call is a fresh run.
Quick Start
1
Run the same team twice
task.context only holds the latest input (["Ticket B"]). Previously the second call returned the first run’s output.2
Keep your own task variables
3
Change team variables between runs
start() after a start_for_each(...) batch also picks up the current team.variables.How It Works
Astart() after a finished run resets task state first; a start() after restore_session_state() resumes instead.
astart() follows the same rules.
Building a new AgentTeam over the same Task objects is also safe — the inferred chain is idempotent and never duplicates context entries. See Task Graph.
Best Practices
Reuse a team across requests
Reuse a team across requests
Build the
AgentTeam once, then call team.start(request) per request. Each call is isolated — no stale output, no stale context.Mutate team.variables between runs
Mutate team.variables between runs
Change
team.variables and the next start() picks up the new values automatically; copies propagated to tasks on the previous run are dropped first. Tasks with their own variables keep them.Use restore_session_state() only for resume
Use restore_session_state() only for resume
It continues an interrupted run, not a re-execution. The next fresh
start() after a resume still reruns and clears the previous inputs.Related
Batch Runs
Run the same team once per input with
start_for_eachTeam Checkpoint & Resume
Save and restore team progress across processes

