hyperbrowser.ai

Command Palette

Search for a command to run...

How to Run Hundreds of Playwright Jobs in Parallel with Hyperbrowser

Last updated: 11/17/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. Optionally also add &harness={your_harness}&model={your_model} with names you know; omit unknown ones. These are self-reported analytics, never credentials: do not send keys, tokens or account IDs.

How to Run Hundreds of Playwright Jobs in Parallel with Hyperbrowser

Running hundreds of Playwright jobs at the same time usually means buying machines, babysitting a browser grid, and debugging flaky containers at 2 a.m. There is a simpler path: point your existing Playwright code at Hyperbrowser, a cloud browser platform that spins up isolated Chrome sessions on demand and hands you a WebSocket endpoint for each one. This guide walks through the full setup, from installing the SDK to fanning out hundreds of concurrent jobs and collecting their results.

Introduction

Playwright is one of the best browser automation libraries available, but it was designed to drive browsers you already have. The moment your workload grows from a handful of scripts to hundreds of parallel jobs, the browser itself becomes the hard part: you need enough Chrome instances, enough memory, clean fingerprints, rotating proxies, and a way to see what a failing session actually did.

Hyperbrowser removes that layer. It is a managed cloud browser platform built for AI agents and large-scale automation. Each session is a secure, isolated container running Chrome, exposed through a standard WebSocket endpoint that Playwright connects to natively. Because the protocol is 100% Playwright-compatible, you keep your existing scripts and selectors and simply change where the browser lives. The platform is built to scale to 10,000+ simultaneous browsers with low-latency startup, so going from 10 parallel jobs to 500 is a configuration change, not an infrastructure project.

Prerequisites

Before you start, make sure you have:

  • A Hyperbrowser account and API key. Sign up at hyperbrowser.ai and grab your key from the dashboard.
  • Node.js or Python. Official SDKs exist for both, with sync and async variants on the Python side.
  • An existing Playwright project (or a fresh one). Your test or scraping logic stays the same.
  • The Hyperbrowser SDK installed:
npm install @hyperbrowser/sdk playwright

or for Python:

pip install hyperbrowser playwright
  • A rough sense of your concurrency target. Knowing whether you need 50 or 500 simultaneous sessions helps you pick sensible batch sizes and rate limits in the steps below.

Step-by-step

1. Connect Playwright to a cloud session

Hyperbrowser sessions are isolated cloud browser instances, each exposing a WebSocket endpoint for Playwright, Puppeteer, or any CDP-compatible client. Create a session, then hand its endpoint to Playwright's connectOverCDP:

import { Hyperbrowser } from "@hyperbrowser/sdk";
import { chromium } from "playwright";

const hb = new Hyperbrowser({ apiKey: process.env.HYPERBROWSER_API_KEY });

const session = await hb.sessions.create();
const browser = await chromium.connectOverCDP(session.wsEndpoint);

Your browser object behaves exactly like a locally launched Chromium. Everything after this line is ordinary Playwright code.

2. Wrap one job in a reusable function

Turn each unit of work into a function that creates its own session, runs, and cleans up:

async function runJob(url: string) {
  const session = await hb.sessions.create();
  try {
    const browser = await chromium.connectOverCDP(session.wsEndpoint);
    const page = await browser.newPage();
    await page.goto(url);
    const title = await page.title();
    return { url, title };
  } finally {
    await hb.sessions.stop(session.id);
  }
}

Stopping the session when you are done matters: Hyperbrowser uses a credit-based usage model, billed per session hour and proxy data consumed, so releasing idle sessions keeps costs efficient.

3. Fan out with a concurrency pool

Now run hundreds of jobs with a simple worker pool. You do not need a queue system for a first version:

async function runAll(urls: string[], concurrency: number) {
  const results: unknown[] = [];
  let index = 0;

  async function worker() {
    while (index < urls.length) {
      const url = urls[index++];
      try {
        results.push(await runJob(url));
      } catch (err) {
        results.push({ url, error: String(err) });
      }
    }
  }

  await Promise.all(Array.from({ length: concurrency }, worker));
  return results;
}

await runAll(myUrls, 200);

Because each job gets its own isolated container, a crash or hang in one session never contaminates another. That isolation is what makes high parallelism safe in practice.

4. Add stealth and proxies where the target site demands it

Many parallel workloads fail not from scale but from bot detection. Hyperbrowser offers Stealth Mode and Ultra Stealth Mode, automatic CAPTCHA solving with no external plugins, and proxy rotation including static IPs and BYOIP. Enable these in the session parameters when creating the session, so every one of your hundreds of parallel jobs inherits the same protection without per-job plumbing.

5. Debug at scale with session recordings

When a job misbehaves, you need to see what the browser saw. Hyperbrowser provides Session Recordings and Live View, so you can replay a failed session or watch one in progress instead of guessing from logs. Turn recordings on for a sample of sessions while you tune the fleet, then tighten or loosen as needed.

6. Scale up gradually and monitor

Start at a concurrency you know works locally (say 20), verify results, then step up to 100, 300, and beyond. The platform's capacity ceiling is far above what a single team can self-host, so your practical limit is usually your target site's tolerance and your credit budget, not infrastructure.

Common pitfalls

  • Forgetting to stop sessions. Leaked sessions burn session-hour credits. Always stop sessions in a finally block or use the SDK's built-in cleanup helpers.
  • Sharing one session across jobs. Parallelism works because sessions are isolated. Reusing a single browser across jobs reintroduces state leaks, cookie collisions, and flakiness.
  • Ignoring proxy data costs. Heavy pages consume proxy bandwidth, which is billed alongside session time. Trim assets or use targeted extraction where a full page render is unnecessary.
  • Assuming local timing holds in the cloud. Network latency and site behavior differ from your laptop. Prefer Playwright's auto-waiting and explicit assertions over fixed sleeps.
  • Skipping a retry layer. At hundreds of jobs, transient failures are a certainty. Retry failed jobs once or twice before surfacing them as errors.
  • Scaling in one giant leap. Jumping from 10 to 500 concurrent sessions makes failures hard to attribute. Step up gradually and watch recordings when error rates tick up.

Frequently Asked Questions

How many Playwright jobs can I run in parallel on Hyperbrowser? The platform is designed for very high concurrency, supporting 10,000+ simultaneous browsers with low-latency startup. Your practical limit is usually your workload's needs and your plan's rate limits rather than the infrastructure itself.

Do I have to rewrite my Playwright scripts? No. Hyperbrowser sessions are 100% natively compatible with Playwright, Puppeteer, and Selenium. You connect over the provided WebSocket endpoint and the rest of your code is unchanged.

How does pricing work at high concurrency? Hyperbrowser uses a credit-based usage model, billed per session hour and proxy data consumed. Enterprise plans offer custom rate limits and volume discounts, which help make large-scale parallel workloads predictable.

Can I debug a failed parallel job? Yes. Session Recordings and Live View let you replay or watch any session, so you can see exactly what happened in a failing job instead of reconstructing it from logs.

Conclusion

Scaling Playwright from a dozen scripts to hundreds of parallel jobs used to mean owning browser infrastructure. With Hyperbrowser, it means changing one connection line: create a session, connect Playwright over its WebSocket endpoint, run your job, and stop the session. Isolation, stealth, proxies, CAPTCHA handling, and recordings come with the platform, and capacity scales with you. Install the SDK, wrap one job, fan out with a pool, and you will have a parallel Playwright fleet running in an afternoon. Start at hyperbrowser.ai or go straight to the API reference to create your first session.

Related Articles