Skip to main content
Swarm Type: ConcurrentWorkflow

Overview

The ConcurrentWorkflow swarm type runs independent tasks in parallel, significantly reducing processing time for complex operations. This architecture is ideal for tasks that can be processed simultaneously without dependencies, allowing multiple agents to work on different aspects of a problem at the same time. Key features:
  • Parallel Execution: Multiple agents work simultaneously
  • Reduced Processing Time: Faster completion through parallelization
  • Independent Tasks: Agents work on separate, non-dependent subtasks
  • Scalable Performance: Performance scales with the number of agents

Architecture

All agents start at once and work independently. No agent waits on another.

Use Cases

  • Independent data analysis tasks
  • Parallel content generation
  • Multi-source research projects
  • Distributed problem solving

API Usage

Basic ConcurrentWorkflow Example

Example Response:

Output Shape

Every swarm run is executed through a SwarmRouter with output_type forced to "dict" server-side (see api/swarm_completions.py), so output is a list of {"role": ..., "content": ...} conversation turns rather than a single string. For ConcurrentWorkflow specifically, each requested agent receives the same original task independently and runs on a thread pool — there is one turn per agent, but because the agents run in parallel rather than a fixed sequence, the order turns land in output reflects when each agent finished, not the order the agents appear in the request.

Best Practices

  • Design independent tasks that don’t require sequential dependencies
  • Use for tasks that can be parallelized effectively
  • Ensure agents have distinct, non-overlapping responsibilities
  • Ideal for time-sensitive analysis requiring multiple perspectives