microsoft/autogen · error · ArgumentException
There are more than one available agents from the workflow f
Error message
There are more than one available agents from the workflow for the next speaker.
What it means
Thrown by WorkflowOrchestrator.GetNextSpeakerAsync when the workflow graph yields MORE than one next agent for the current speaker. Unlike RolePlayOrchestrator (which falls back to an admin LLM to disambiguate), WorkflowOrchestrator requires the graph to produce exactly one next speaker and throws ArgumentException otherwise.
Source
Thrown at dotnet/src/AutoGen.Core/Orchestrator/WorkflowOrchestrator.cs:51
if (currentSpeaker == null)
{
return null;
}
var nextAgents = await this.workflow.TransitToNextAvailableAgentsAsync(currentSpeaker, context.ChatHistory, cancellationToken);
nextAgents = nextAgents.Where(nextAgent => candidates.Any(candidate => candidate.Name == nextAgent.Name));
candidates = nextAgents.ToList();
if (!candidates.Any())
{
return null;
}
if (candidates is { Count: 1 })
{
return candidates.First();
}
else
{
throw new ArgumentException("There are more than one available agents from the workflow for the next speaker.");
}
}
}
View on GitHub (pinned to 027ecf0a37)
Solutions
- Redesign the graph so each node has exactly one satisfied outgoing transition per round (add conditions to transitions)
- If multiple next speakers are legitimate, use RolePlayOrchestrator with the workflow, which uses an admin agent to pick one
- Add a disambiguating intermediary node that routes to exactly one successor
- Catch ArgumentException to detect graph design errors early in tests
Example fix
// before: workflow.AddTransition(a, b); workflow.AddTransition(a, c); // ambiguous when both conditions pass
// after: make conditions mutually exclusive
workflow.AddTransition(a, b, ct => ct.ChatHistory.Last().GetContent()?.Contains("B") == true);
workflow.AddTransition(a, c, ct => ct.ChatHistory.Last().GetContent()?.Contains("C") == true); Defensive patterns
Strategy: validation
Validate before calling
// Validate the graph has deterministic out-degree before starting the chat
foreach (var node in workflow.Transitions.GroupBy(t => t.From))
{
// at runtime conditions matter; at minimum assert no unconditional fan-out
if (node.Count(t => t.Condition is null) > 1)
throw new InvalidOperationException($"Node {node.Key} has ambiguous unconditional transitions");
} Try / catch
try { await groupChat.CallAsync(input, maxRound, ct); }
catch (ArgumentException e) when (e.Message.Contains("more than one available agents"))
{ /* redesign graph conditions or switch to RolePlayOrchestrator(workflow) */ } Prevention
- Give every transition a mutually exclusive condition in fan-out graphs
- Use RolePlayOrchestrator when the next speaker is genuinely ambiguous
When it happens
Trigger: Building a Graph where a node has multiple outgoing transitions that are all valid given the current chat history, then running GroupChat with WorkflowOrchestrator; TransitToNextAvailableAgentsAsync returns 2+ agents and the Count==1 check fails.
Common situations: Designing a fan-out workflow (one reviewer broadcasting to two writers), adding transitions whose conditions are all satisfied in the same round, or converting a RolePlayOrchestrator setup (which tolerated ambiguity) to WorkflowOrchestrator.
Related errors
- All agents in the workflow must be in the group chat.
- No next available agents found in the current workflow
- No name is returned.
- The response from admin is {name}, which is either not in th
- MagenticOneOrchestrator does not support GroupChatTeamRespon
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/76a45511f3e5f027.
Report an issue: GitHub.