Migrate Browser Use To Hyperbrowser migrate-browser-use-to-hyperbrowser

Migrate an app from Browser Use to Hyperbrowser running on Composio Instant (toolkit `hyperbrowser`, tools `HYPERBROWSER_*`). Covers apps that call Composio's `BROWSER_USE_*` tools, Browser Use Cloud (REST or SDK), Browser Use browsers over CDP, the open-source `browser-use` library, and Browser Use MCP or n8n setups.

Use it when asked to move a browser agent, live view or sign-in hand-off off Browser Use onto Hyperbrowser through Composio, with no Hyperbrowser account of your own.

Works in Claude, ChatGPT, Codex and more
Our test
8/10✓ Verified
tested Dec 6, 2026
GitHub stars
31k
composiohq/composio
Added by
0
members
Updated
Dec 6
commit 9f844a8
Content
1 file
no scripts · 16 KB
License
MIT
free to use

What our test found

The skill gives a detailed, practical migration workflow with useful schema, lifecycle, per-user isolation, cost, and verification guidance.

Request we tested it on“Help me migrate my app's Browser Use Cloud integration to Hyperbrowser through Composio Instant. It starts browser tasks, polls for results, and provides a live view for users to sign in.”

Limits spotted

  • Specific tool schemas, endpoint behavior, and pricing may change and should be verified against current documentation.
  • The broad coverage of several integration types makes the instructions lengthy and may require tailoring to the app.
View on GitHub ↗
name: migrate-browser-use-to-hyperbrowser
description: Migrate an app from Browser Use to Hyperbrowser running on Composio Instant (toolkit `hyperbrowser`, tools `HYPERBROWSER_*`). Covers apps that call Composio's `BROWSER_USE_*` tools, Browser Use Cloud (REST or SDK), Browser Use browsers over CDP, the open-source `browser-use` library, and Browser Use MCP or n8n setups. Use when asked to move a browser agent, live view or sign-in hand-off off Browser Use onto Hyperbrowser through Composio, with no Hyperbrowser account of your own.

Migrate Browser Use to Hyperbrowser on Composio Instant

You are moving an app's browser agent from Browser Use to Hyperbrowser, run through Composio Instant. Instant runs Hyperbrowser on Composio's account and bills the Composio project's prepaid balance: the app needs only its COMPOSIO_API_KEY, no Hyperbrowser key. Hyperbrowser's START_BROWSER_USE_TASK runs the same open-source Browser Use agent, so task text carries over.

Work in order: inventory, plan, check schemas, rewrite, verify. Ask the user before any paid test.

Reference flow

Every call goes through one tool router session. execute returns {data, error, log_id, result_type}; stop unless the status is 2xx, error is empty and result_type is "completed".

POST {host}/api/v3.1/tool_router/session          {"user_id": U, "toolkits": {"enable": ["hyperbrowser"]}}
  -> session_id = S
POST .../session/S/execute  HYPERBROWSER_CREATE_SESSION {"timeout_minutes": 5, "screen": {"width": 1280, "height": 800}}
  -> data.id = B (browser), data.live_url = embed this
POST .../session/S/execute  HYPERBROWSER_START_BROWSER_USE_TASK
       {"task": T, "llm": "gpt-4.1", "max_steps": 5, "session_id": B, "keep_browser_open": true}
  -> data.id = R (signed task ID: the only one you pass back)
loop every 3 s: HYPERBROWSER_GET_BROWSER_USE_TASK_STATUS {"run_id": R}
  -> data.status; new items of data.data.steps; data.data.final_result when completed
stop:   HYPERBROWSER_STOP_BROWSER_USE_TASK {"run_id": R}, then read status until "stopped"
always: HYPERBROWSER_STOP_SESSION {"session_id": B}   (in finally, on Ctrl+C and SIGTERM)

1. Inventory every Browser Use touchpoint

Search the whole repo, including README, AGENTS.md, CLAUDE.md, .env.example, config and UI text (skip node_modules, build output and installed skills), for each pattern below:

| Look for | What it is | |---|---| | BROWSER_USE_, BROWSER_TOOL_, "browser_use", "browser_tool" | Composio browser_use / browser_tool toolkit | | api.browser-use.com, browser_use_sdk, browser-use-sdk, BROWSER_USE_API_KEY | Browser Use Cloud REST or SDK | | from browser_use, import browser_use, a browser-use dependency | The open-source browser-use library | | --cli-mcp, @browser_use/pi, n8n-nodes-browser-use | Browser Use MCP server, pi or n8n | | connect_over_cdp, connectOverCDP, cdp_url, cdpUrl, Page.startScreencast, Input.dispatch, /json/list | A browser driven over CDP, or a CDP screencast used as a live view | | live_view_url, keep_alive, max_cost_usd, and model or session_id passed to Browser Use calls | Browser Use run fields | | "Browser Use" in prose | Docs or UI text to reword for the new provider |

Also read the code: wrappers and string-built URLs can hide a call. Group findings into workflows (start a task, poll, show progress, live view, sign-in wait, stop, sign out) and say what each becomes before you edit. Each kind of finding maps to a section of step 5.

2. Decisions to make first

  • Does the app need sign-ins kept? Apps that never sign in (Browser Use keep_alive: false) need no profile. Open a short CREATE_SESSION without profile: you get live_url and can close the browser yourself. (session_options on the task also works but gives you less control.) Profiles are only for keeping sign-ins.
  • End-user ID. Use the app's own signed-in user ID as the Composio user_id. With no accounts (one shared login, anonymous visitors), create a random ID per chat or visitor and keep it in their state. Never one shared ID: browsers and profiles would be shared between people.
  • Where the profile ID lives. Next to that user (database row or chat state). Lose it and the user loses their sign-in, and the old profile is never deleted.
  • Composio host. Read it from an env var (keep the app's existing name if it has one, otherwise COMPOSIO_BASE_URL; default https://backend.composio.dev).
  • How the session reaches Instant. With Instant on for the project, a session runs a tool on Instant when the user has no connection of their own for that toolkit; nothing extra goes in the session body. If users may have their own connection, force Instant as below.
  • Call Instant explicitly. Through a tool router session (POST /api/v3.1/tool_router/session, then /{id}/execute), or the SDK with account="instant_account" (Python) / { account: "instant_account" } (TypeScript). Unpinned tool listings can serve an older version with different argument names.
  • Enable the new toolkit. Change the session's toolkit list (toolkits.enable) from browser_use to the new toolkit. With the SDK's direct execute, also pass the Instant account.
  • Check success explicitly. The session execute response is {data, error, log_id, result_type} with no successful field (that field belongs to the direct tools.execute API). A call succeeded only when the HTTP status is 2xx, error is empty and result_type is "completed" (resultType in the TypeScript SDK). Many refusals come back as HTTP 200 with an error string (a refused field, or a provider 404); some as HTTP 4xx (6602 refused ID, 6604 tool not allowed on Instant). Check both, and match provider codes in the error text. A task succeeded only when its status is completed. A failed task can still carry text.

3. Check the live schemas

Before writing code, read each tool you will call from GET https://backend.composio.dev/api/v3.1/tools/<SLUG> (header x-api-key), or composio execute <SLUG> --get-schema. Never guess an argument name.

4. Tool map (Composio BROWSER_USE_* → Hyperbrowser)

| Browser Use | Hyperbrowser | Change | |---|---|---| | (none) | HYPERBROWSER_CREATE_PROFILE {name} | One profile per end user, once. Store id. | | (browser started by the run) | HYPERBROWSER_CREATE_SESSION {timeout_minutes, profile: {id, persist_changes: true}} | Opens the user's browser. timeout_minutes (1 to 720) is required on Instant. Returns id, live_url, ws_endpoint, status. | | BROWSER_USE_START_RUN | HYPERBROWSER_START_BROWSER_USE_TASK | Send task, llm, max_steps (required on Instant), session_id, keep_browser_open: true. Remove model, max_cost_usd, keep_alive. | | BROWSER_USE_LIST_RUN_EVENTS | HYPERBROWSER_GET_BROWSER_USE_TASK_STATUS {run_id} | Returns all steps so far on every read. No cursor. | | BROWSER_USE_GET_RUN / GET_RUN_STATUS | HYPERBROWSER_GET_BROWSER_USE_TASK_RESULT {run_id} | Answer in data.data.final_result. Optional: the status call returns it too. | | BROWSER_USE_CANCEL_RUN | HYPERBROWSER_STOP_BROWSER_USE_TASK {run_id} | The browser stays open. | | BROWSER_USE_STOP_BROWSER_SESSION | HYPERBROWSER_STOP_SESSION {session_id} | Closing saves cookies into the profile. | | BROWSER_USE_GET_BROWSER_SESSION | HYPERBROWSER_GET_SESSION_DETAILS {session_id} | status is active, closed or error. | | forgetting a session to sign out | HYPERBROWSER_STOP_SESSION, then HYPERBROWSER_DELETE_PROFILE {profile_id} | Stop first, then delete. New profile next time. | | BROWSER_USE_QUEUE_SESSION_MESSAGE | New START_BROWSER_USE_TASK on the same session_id | Put the earlier result in the new task text; tasks share no memory. |

Without your own browser: omit session_id and pass session_options: {timeout_minutes, profile: {id, persist_changes: true}} on the task. Then each task pays for its own browser time. The own-browser flow above is closest to keep_alive.

HYPERBROWSER_START_HYPER_AGENT_TASK (and its GET_*/STOP_* tools) runs Hyperbrowser's own agent instead, at the same price. Use it only if the user wants to leave the Browser Use engine.

IDs: use the start call's ID
  • Task ID: take id from the START_BROWSER_USE_TASK response and pass exactly that as run_id to status, result and stop. On Instant it is signed to your user.
  • Never rebuild an ID from other responses (for example an id echoed by a status read). Pass back only the ID the start call returned.
  • Browser session_id and profile IDs are signed too (<uuid>.<suffix>), even where a schema says "UUID format". Store and pass them exactly as returned.
  • Keep the task ID and the browser session_id in different variables.
  • HYPERBROWSER_LIST_SESSIONS is not allowed on Instant, so you can't find a lost browser later. Save every session_id as soon as it is created, close browsers in finally and on SIGTERM as well as Ctrl+C, and keep timeout_minutes short as the backstop.

5. Rewrite by kind of integration

Composio Browser Use toolkit

Apply the tool map. Then map the responses:

  • Response shape of status and result (note the two levels):
  data: { id, status, error, job_params, finishedAt, live_url,
          data: { steps: [...], final_result } }

Read status from data.status, and only steps and final_result from data.data.

  • Status: pending, running → running; completed → done; failed → failed; stopped → cancelled. Errors in error.
  • Steps are one level deeper than you'd expect: data.data.steps[]. Each step is {metadata.step_number, model_output: {next_goal, action[]}, result[], state: {url, title}}. Use next_goal as the agent's narration. Name actions: go_to_url → "Open <host>", click_element* → "Click", input_text → "Type", scroll* → "Scroll", wait → "Wait", extract_content → "Read the page", execute_js → "Run a script", write_file and replace_file_str → "Take notes", done → "Wrap up". Show any other name as is. Step 0 is Hyperbrowser's own first navigation.
  • Current page: the latest step's state.url and state.title (replaces parsing [state] Title | URL lines).
  • Model that ran: job_params.llm. Hyperbrowser may run a different model than requested; show the real one.
Browser Use Cloud (REST or SDK)

Replace the client with Composio calls through the tool map. A blocking SDK helper (wait_for_completion, client.run) becomes a poll loop on GET_BROWSER_USE_TASK_STATUS with a deadline; on timeout call STOP_BROWSER_USE_TASK, then read status until it is terminal. A structured output schema has no field here: ask for JSON in the task text and validate it in app code. Remove BROWSER_USE_API_KEY and the SDK dependency.

CDP

For a Browser Use browser driven by Playwright or your own code: create it with HYPERBROWSER_CREATE_SESSION and connect to ws_endpoint; close it with STOP_SESSION in a finally block. For CDP screencast/input code used as a live view, see step 7.

Open-source library

Either keep the library and point it at a Hyperbrowser browser (ws_endpoint as its CDP URL; check your version accepts one), or remove it and run hosted tasks with START_BROWSER_USE_TASK. Custom actions (@tools.action) don't move to a hosted task: run them in app code before or after. Record the choice.

MCP, pi or n8n

Replace the Browser Use MCP config with a Composio MCP server that includes the hyperbrowser toolkit. If the app must force Instant or cap spend per call, call tools from app code instead of handing them to a model. For n8n, use an HTTP Request node to the tool router execute endpoint.

6. Sign-in persistence and the sign-in wait

Browser Use kept a browser open (keep_alive + reused session). Here: open the browser yourself with CREATE_SESSION on the user's profile and run every task on it with session_id and keep_browser_open: true. Track when it closes (created time + timeout_minutes); open a new one on the same profile when it is closed or under about 5 minutes left, stopping the old one first so its cookies save. Tasks with different llm values can share one browser.

Hyperbrowser has no pause/resume. Keep the wait in the task text:

If <Site> is not signed in, open <sign-in URL> and never type into it yourself. The user is watching
this browser live and will sign in themselves. Use the wait action for 30 seconds at a time, then
check whether <Site> is signed in, for up to 4 minutes. As soon as it is, carry on with the task.
If it is still not signed in after 4 minutes, finish with exactly: NEEDS_SIGN_IN
  • Add the wait steps to max_steps (about 10 for 4 minutes); each step is charged.
  • While the latest step's state.url is a sign-in URL, show a sign-in prompt with the live view in control mode.
  • Past your limit, call STOP_BROWSER_USE_TASK and report that sign-in is needed. Treat NEEDS_SIGN_IN in final_result, or ending on a sign-in page, the same way. Retry = new task on the same session_id.

7. Live view

Delete CDP screencast and input code (/json/list, Page.startScreencast, Input.dispatchMouseEvent, Input.dispatchKeyEvent). Embed live_url from CREATE_SESSION:

<iframe src="{live_url}" sandbox="allow-same-origin allow-scripts"
        allow="clipboard-read; clipboard-write" style="width:1280px;height:800px;border:0"></iframe>
  • It is a noVNC page and interactive (default view_only_live_view: false). For watch-only, cover it with a transparent element that takes pointer events; remove it when the user takes control.
  • Pass screen: {width: 1280, height: 800} on CREATE_SESSION and scale with CSS.
  • GET_SESSION_DETAILS needs your API key: check from the server whether the browser is still active.
  • The URL carries an access token: give it only to the user who owns the browser; never log it.

8. Models, cost and limits

  • Time: short tasks often finish in a minute or two, but the browser is charged for the whole timeout_minutes. Use 5 to 10 minutes unless the app needs longer, and reuse the browser.
  • Model pickers: keep them, mapped to llm plus a max_steps cap (for example Fast = a fast model from the llm values in the live schema with about 10 steps, Accurate = a stronger model with about 15). Keep tasks at or under 25 steps (the provider's common plan limit; the schema says it is plan-dependent).
  • max_cost_usd → max_steps. Price: $0.02 per step × `max_steps`, charged at start (in full, even if the task ends early), plus $0.10 per browser hour if the task opens its own browser (none with session_id). CREATE_SESSION: $0.10 per browser hour for the whole timeout_minutes, at start. Status, result, stop, session reads and profile calls: $0.
  • Refused on Instant: proxies, CAPTCHA solving, extensions, custom browser args, custom LLM keys (use_custom_api_keys, api_keys). List any the app relied on as a gap.

9. Keep it safe

  • One Composio user_id per end user, reused. Profile, session and task IDs are bound to the user that created them; another user's call is refused before it reaches Hyperbrowser (code 6602 or just "Invalid arguments": treat both as refused).
  • Never put passwords in task text or chat; the user signs in in the live view.
  • Update README, "how it works" pages and .env.example too.

10. Verify

  1. Type-check and build (for a plain script, compile it).
  2. Search again for the step 1 patterns. Anything left must be deliberate; list it. Don't leave Browser Use field names in comments.
  3. One plain task ("Open https://example.com and tell me the page title", max_steps ≤ 5): status reaches completed, final_result shows, live view loads.
  4. Stop works: start a task, call stop, read status until stopped. Test it from a small script that calls the app's stop path: a background job in a non-interactive shell ignores Ctrl+C.
  5. If the app has a sign-in flow: one task on a site that needs sign-in, without signing in; the prompt shows and the task ends with NEEDS_SIGN_IN or is stopped at the limit.
  6. Clean up: stop every browser, delete every test profile.

Report: changed files, each Browser Use feature and its replacement, gaps, spend, check results.