Skip to content

[BUG] Graph nodes execute sequentially instead of parallel #478

@ahmetatalay

Description

@ahmetatalay

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 execution

Additional Context

No response

Possible Solution

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

No one assigned

    Labels

    area-multiagentMulti-agent relatedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions