Browser Runtimes

View as Markdown

Browser automation now starts from a workspace, not from a root browser client.

Start a profile-backed runtime

1const workspace = await bctrl.workspaces.create({ name: 'sales-workflow' });
2
3const runtime = await workspace.runtimes.browser('crm').playwright({
4 launch: {
5 mode: 'profile',
6 profileId: 'sales-bot',
7 },
8});

Start an ephemeral runtime

1const runtime = await workspace.runtimes.browser('quick').playwright({
2 launch: {
3 mode: 'ephemeral',
4 },
5});

Start an ephemeral runtime with config

1const runtime = await workspace.runtimes.browser('scrape').playwright({
2 launch: {
3 mode: 'ephemeral',
4 config: {
5 humanize: true,
6 solveCaptchas: true,
7 },
8 },
9});

Work with the runtime

1await runtime.page.goto('https://example.com');
2
3const live = await runtime.live({ interactive: true });
4const recording = await runtime.recording();
5
6await runtime.stop();

Long-running agents

Use the same runtime for long-running agent calls:

1const op = await runtime.browserUse.agent.execute('Export the latest invoices');
2
3const latest = await workspace.operations.wait(op.id, { until: 'completed' });
  • Browser capability reference covers page.goto, locator.click, event listeners, Stagehand, and browser-use.
  • API reference covers workspaces, runtimes, operations, artifacts, and browser profiles.