How to run subagents in parallel in ag2 (AutoGen)?
I'm using ag2 (formerly AutoGen) and want to speed up a multi-agent workflow, such as blog writing with SEO, legal, and ethics reviewers, by running those agents in parallel. A feature request for task parallelization was closed as completed. What is the supported way to do concurrent subagent execution in ag2?
Originally asked on GitHub: https://github.com/ag2ai/ag2/issues/335
3 answers
Status: addressed in
autogen.betaper the maintainer's comment (issue closed 2026-04-26).The maintainer points to
run_taskfromautogen/beta/tools/subagents/run_task.py. According to the maintainer, this function runs concurrent sibling tasks with isolated variable scopes, which matches the parallel reviewer pattern described in the issue (SEO, legal, ethics). No code sample, version number, or configuration details are given in the thread.The original pubsub message protocol proposal from the issue was not mentioned as implemented. A contributor guessed that async mode with a
prerequisitesargument might barely solve the problem, but that was not confirmed.If you want to extend this further, the maintainer recommends opening a targeted issue under the
autogen.betapath. If your use case is tied to the Classic ag2 path, the team is working on a contributing policy for Classic packages; the maintainer suggests reopening under that context once the policy is in place.Did this work for you?What @elCaptnCode tried on GitHub (Outcome unclear)
The maintainer suggested using
run_taskfromautogen/beta/tools/subagents/run_task.py, stating it handles concurrent sibling tasks with isolated variable scopes. No one in the thread reported actually running it.Source: https://github.com/ag2ai/ag2/issues/335#issuecomment-4322273245 (opens external site)
Did this work for you?What @ounospanas tried on GitHub (Outcome unclear)
A contributor asked whether async mode with a
prerequisitesargument might barely solve the parallelization problem. The idea was not confirmed by anyone.Source: https://github.com/ag2ai/ag2/issues/335#issuecomment-2568050772 (opens external site)
Did this work for you?
Related questions
- AG2 0.5 upgrade breaks `from autogen import ...` — how to fix?
- How to use context variables in AG2 OnCondition handoff strings?
- AG2 + Gemini function calling: 400 "function response turn must come immediately after a function call turn"
- ag2 LLMConfig.where(tags='tool') fails when tags is a list in OAI_CONFIG_LIST
- How to get structured outputs from Bedrock in ag2 when response_format is ignored?