Skip to main content
Browser Use supports running multiple browser instances in parallel, enabling concurrent automation tasks for faster execution.

Basic Parallel Execution

Run multiple agents in parallel using asyncio.gather:

How It Works

1

Create Multiple Browser Instances

Each browser uses a separate user data directory to avoid conflicts
2

Define Independent Tasks

Create agents with different tasks that can run concurrently
3

Run in Parallel

Use asyncio.gather() to execute all agent tasks simultaneously
4

Collect Results

Gather all results once tasks complete, with error handling
Experimental Feature: Parallel execution is still experimental. Agents might conflict with each other in some scenarios.

Parallel Data Collection

Collect data from multiple sources simultaneously:

Parallel Form Submissions

Submit forms to multiple sites simultaneously:

Parallel Research Tasks

Gather information from multiple sources concurrently:

Error Handling in Parallel Execution

Handle errors gracefully when running tasks in parallel:

Performance Considerations

Resource Usage: Each browser instance consumes memory and CPU. Monitor system resources when running many parallel tasks.

Optimizing Parallel Execution

Best Practices

1

Separate User Data Directories

Give each browser instance its own user data directory to prevent conflicts
2

Use Headless Mode

Enable headless mode for better performance when running multiple browsers
3

Implement Error Handling

Use return_exceptions=True in asyncio.gather() to prevent one failure from stopping all tasks
4

Limit Concurrency

Use asyncio.Semaphore to limit concurrent tasks based on system resources
5

Clean Up Resources

Ensure browser instances are properly closed after task completion

Concurrency Limits

  • Data Scraping - Extract data from multiple sites in parallel
  • Research - Gather information from multiple sources
  • Shopping - Compare prices across multiple stores