generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 499
Closed
Labels
area-multiagentMulti-agent relatedMulti-agent relatedbugSomething isn't workingSomething isn't working
Description
Checks
- I have updated to the lastest minor and patch version of Strands
- I have checked the documentation and this is not expected behavior
- I have searched ./issues and there are no duplicates of my issue
Strands Version
1.0.0
Python Version
3.13.3
Operating System
macOS 15.5
Installation Method
pip
Steps to Reproduce
from strands.multiagent import GraphBuilder
from strands import Agent
# Create agents
agent1 = Agent(name="agent1", system_prompt="Agent 1")
agent2 = Agent(name="agent2", system_prompt="Agent 2")
agent3 = Agent(name="agent3", system_prompt="Agent 3")
synthesizer = Agent(name="synthesizer", system_prompt="Synthesizer")
# Build graph with multiple entry points
builder = GraphBuilder()
builder.add_node(agent1, "agent1")
builder.add_node(agent2, "agent2")
builder.add_node(agent3, "agent3")
builder.add_node(synthesizer, "synthesizer")
# All agents feed into synthesizer
builder.add_edge("agent1", "synthesizer")
builder.add_edge("agent2", "synthesizer")
builder.add_edge("agent3", "synthesizer")
# Set multiple entry points
builder.set_entry_point("agent1")
builder.set_entry_point("agent2")
builder.set_entry_point("agent3")
graph = builder.build()
result = await graph.invoke_async("Test task")
# Expected: agent1, agent2, agent3 run in parallel
# Actual: agent1 → agent2 → agent3 → synthesizer (sequential)
Expected Behavior
According to the Graph documentation, nodes without dependencies should execute in parallel when they're in the same batch.
Actual Behavior
Nodes execute sequentially due to the await in the for loop:
# Current implementation in graph.py line
for node in current_batch:
await self._execute_node(node) # Sequential executionAdditional Context
No response
Possible Solution
sdk-python/src/strands/multiagent/graph.py
Line 344 in 19fb01e
| await self._execute_node(node) |
It should be switched to using asyncio.create_task here to concurrently run these entry point nodes.
For reference code; create_task pattern for concurrent tool execution (source).
Related Issues
No response
Metadata
Metadata
Assignees
Labels
area-multiagentMulti-agent relatedMulti-agent relatedbugSomething isn't workingSomething isn't working