Create a session
Start a session with optional configuration for timeout, proxy, browser type, and extensions.
Example response:
Run tasks with a session
Passbrowser_session_id to run_task to execute tasks in an existing session. Each task continues from where the previous one left off: same page, same cookies, same form data.
Run agents with a session
Passbrowser_session_id to run_workflow to execute an agent in an existing session. This is useful when you need to run a predefined agent but want it to continue from your current browser state.
You cannot use both
browser_session_id and browser_profile_id in the same request. Choose one or the other.Save a session’s profile
By default, a browser session does not save its browser profile when it ends. To capture the session’s state (cookies, localStorage, session files) for reuse, opt in withgenerate_browser_profile. Python and TypeScript SDK support for this flag is rolling out; until your SDK version includes it, call the REST API directly (the Python SDK can also pass it via request_options with additional_body_parameters={"generate_browser_profile": True}).
409 error.
GET /v1/browser_sessions/{browser_session_id} — the response includes generate_browser_profile.
Once the session closes and its profile finishes uploading, turn it into a reusable profile with create_browser_profile.
Sessions started from a saved profile (
browser_profile_id) always save their profile when they end, regardless of this flag. This does not update the original profile — to keep the refreshed login state, create a new profile from the closed session and use the new profile’s ID in future runs.Close a session
Close a session to release resources and stop billing. The browser shuts down immediately.Example: Human-in-the-loop
A shopping bot that pauses for human approval before completing a purchase.Best practices
Set appropriate timeouts
Sessions bill while open, so match the timeout to your use case. A task typically completes in 30 to 90 seconds, so a 10-minute timeout covers most multi-step sequences with margin. Human-in-the-loop flows need longer timeouts to account for wait time.Use agents for predetermined sequences
If your steps don’t need pauses between them, an agent runs them in a single browser instance without the overhead of creating and managing a session. Each task in a session incurs its own startup cost, while agent blocks share one browser.Choose the right browser type
Chrome has the widest compatibility. Use Edge only when a site requires or detects it specifically.Use extensions strategically
Extensions add startup time, so only enable them when needed. The ad-blocker removes overlay ads that can interfere with automation. The captcha-solver handles CAPTCHAs automatically but is only available on Cloud.Sessions vs Profiles
Skyvern also offers Browser Profiles, saved snapshots of browser state (cookies, storage, session files) that you can reuse across days or weeks. Choose based on your use case:Next steps
Connect Your Local Browser
Let Skyvern Cloud use your local browser with your existing logins
Browser Profiles
Save session state for reuse across days
Cost Control
Optimize costs with max_steps and efficient prompts

