AutoGen Team Workflows: RoundRobinGroupChat, SelectorGroupChat, and Swarm
In this post, I'm going to break down how each of the AutoGen team workflows works and how each one of them helps your team achieve its goal as efficiently as possible.

If you're building or experimenting with AutoGen 0.4 (and later) and wondering about the difference between the available team workflows, you're in the right place.
Ready? Let's go!
A word of caution
Also keep in mind that AutoGen 0.4 is a complete rewrite of the original framework and this post assumes you're working with 0.4 or later versions.
AutoGen 0.4 Team Workflows
With that in mind, here are the available team workflows within AutoGen 0.4+:
RoundRobinGroupChat
SelectorGroupChat
Swarm
Each one of them serves a different purpose and you may be able to guess how they work based on their naming. To better illustrate how the workflow determines the team's communication pattern, we'll assume that our AutoGen team is made up of agents that work together to make me a delicious pizza!
We'll see how this translates when we implement each one of the workflows.
Let's assume our agentic team is made up of three agents:
1- Dough Chef
dough_chef = AssistantAgent(
name="dough_chef",
system_message="""
You are a pizza dough chef. You must choose a dough type for the pizza.
Do not handle the sauce or the toppings.
Respond with: 'Dough ready: <dough_type>'
""",
model_client=openai_client
)
2- Sauce Chef
sauce_chef = AssistantAgent(
name="sauce_chef",
system_message="""
You are a pizza sauce chef. You must choose a sauce type for the pizza.
Do not handle the dough or the toppings.
Respond with: 'Sauce ready: <sauce_type>'
""",
model_client=openai_client
)
3- Toppings Chef
toppings_chef = AssistantAgent(
name="toppings_chef",
system_message="""
You are a pizza toppings chef. You must choose toppings for the pizza.
Do not handle the dough or the sauce.
Respond with the list of ingredients then say "Pizza Ready!"
""",
model_client=openai_client
)
You can read more about AssistantAgent
here, but at a minimum, we must define these properties:
name
: Give a name to your agentsystem_message
: The system model that the agent will use. This will be prepended to the context and should be used to give your agent an identity.model_client
: The model that this agent will use. In our case, we'll work with OpenAI's GPT-4o.
Ok, cool. Knowing the above, let's see what these agents look like as part of a team!
What is RoundRobinGroupChat
?
In a RoundRobinGroupChat
, agents take turns in a linear fashion. There’s no thinking involved, just a fixed order. Agent 1 runs, then Agent 2, then Agent 3, and so on, looping back around if needed. It’s predictable and everyone gets their turn.
In a RoundRobinGroupChat
pattern, no one makes decisions about which agent should go next. Great for many real-world use cases.
Here's what this looks like in code (assuming we have three agents):
team = RoundRobinGroupChat(
[dough_chef, sauce_chef, toppings_chef]
)
In this case, dough_chef
goes first, then sauce_chef
, and finally, toppings_chef
.
What is SelectorGroupChat
?
SelectorGroupChat
is like having a head chef watching the other sous-chefs and deciding who gets to go next based on the current situation and each agent's capabilities. The SelectorGroupChat
can determine which agent gets to handle the task at hand based on each agent's provided description.
By default, each agent gets to speak once, but this can be modified by setting the allow_repeated_speaker
property to True
when initializing the team.
Here's what this looks like in code:
team = SelectorGroupChat(
participants=[dough_chef, sauce_chef, toppings_chef],
model_client=openai_client
)
Notice that the SelectorGroupChat
here requires a model_client
parameter which is used to understand the context and assist in selecting the most appropriate next agent.
SelectorGroupChat
in the official docs.What is Swarm
?
A Swarm
team is more dynamic. Every agent is aware of its fellow team members, and can decide on its own whether it can handle a given task or hand it off to another agent on the team that is better suited for it.
There’s no head chef here and no strict order. It’s flexible and fast-paced, which can lead to more natural, emergent behaviors. Swarms shine in scenarios where autonomy and adaptability matter.
Here's what it looks like in code:
team = Swarm(
participants=[dough_chef, sauce_chef, toppings_chef]
)
The key here is that each agent can hand off tasks to one (or more) agents on the team. You can define this by setting the handoffs
parameter when initializing the agent as follows:
dough_chef = AssistantAgent(
name="dough_chef",
handoffs=["sauce_chef"], <----
...
This means that the dough_chef
can determine that the sauce_chef
is better suited for a given task and hand off the request to it.
Swarm
in the official docs.