Skip to main content
Browser automations are multi-step automations written in code. You launch a cloud browser, get a Playwright page with AI methods layered on top, and write your automation in Python or TypeScript. The code lives in your repo, runs in your CI, and deploys like any other software. This is the code-first path. If you prefer building automations visually with drag-and-drop blocks, see Agents in the Cloud UI docs.
Agents vs. Browser Automation: Agents are built and run in the Cloud UI, no code required. Browser automations are built and run in code using Page, Agent, and Browser. Both can do multi-step work across pages. Choose based on whether your team prefers a visual editor or a code editor.
This guide walks through a real example: logging into a vendor portal, extracting invoice data, and downloading a PDF. Four steps:
  1. Launch a browser and get a page
  2. Navigate and interact with the page using AI actions, selectors, or both
  3. Use the agent for complex goals like login, multi-step tasks, and file downloads
  4. Run the script and check results

Step 1: Launch a browser and get a page

Every automation starts by launching a cloud browser and getting a page. The browser is a Chromium instance hosted by Skyvern. The page is a Playwright page with AI methods added on top.
Install the SDK first if you haven’t:
pip install skyvern is enough for Skyvern Cloud and remote API usage. If you are using embedded local mode with Skyvern.local() or launch_local_browser(), install pip install "skyvern[local]". For a local self-hosted server, install pip install "skyvern[server]".All code snippets below run inside an async function. See the complete example for the full runnable script.
The browser stays alive until you call browser.close() or the session times out (default: 60 minutes). All pages inside it share cookies, localStorage, and auth state. For browser launch options (timeouts, proxies, connecting to local browsers), see Managing Browsers.

Step 2: Navigate and interact with the page

Once you have a page, you can interact with it using standard Playwright, AI actions, or both. For the full list of available methods and parameters, see the Actions Reference.

Use AI actions (no selectors needed)

Four methods let you interact with the page using natural language. Skyvern screenshots the page and determines which elements to target.

Use selectors with AI fallback

click, fill, and select_option accept both a CSS selector and an AI prompt. The selector runs first. If it fails, the AI takes over.

Mix Playwright and AI

Standard Playwright methods work directly. Use selectors where you know the DOM, AI where you don’t.

Step 3: Use the agent for complex goals

For multi-step goals (“log in with 2FA”, “navigate to billing and download the invoice”), hand off to the agent. The agent runs a full AI task loop inside your page, preserving all browser state.

Login with stored credentials

The agent handles multi-page login flows, CAPTCHAs, and 2FA automatically. Four credential providers: skyvern (built-in vault), bitwarden, onepassword, azure_vault. Store credentials via the Credentials API.

Run a multi-step task

After the agent finishes, you take back control. The page retains all state:

Download files

Run a workflow on the page

If you have built a workflow, run it on a page you already control:
agent.run_workflow vs skyvern.run_workflow: The top-level run_workflow opens its own browser. Use agent.run_workflow when you need to log in first or do setup before the workflow runs.

Complete example

Putting it all together: log into a vendor portal, extract invoices, and download a statement.

Step 4: Run and get results

Run the script:
You’ll see the browser session URL in the console output. Open it in your browser to watch the automation run in real time.

Example output

Here’s what the Complete Example prints, grouped by the call that produced each block:
The [Skyvern] ... lines come from the SDK’s built-in logger and stream in real time as each call runs. Your own print output appears after the awaited call returns. For the full response shape, see TaskRunResponse and WorkflowRunResponse.

View results in the Cloud UI

Every run appears in the Runs page. Click any run to see:
  • Recording - video of the browser session
  • Actions - step-by-step timeline with screenshots and AI reasoning
  • Output - extracted data as JSON
  • Artifacts - screenshots, HAR files, generated code

Artifacts

Every run captures recordings, screenshots, AI reasoning logs, network HAR files, and downloaded files. Access them via the Cloud UI or programmatically:
For the full artifact type reference and debugging workflows, see Using Artifacts.

Next steps

Actions Reference

Every page action and agent method with parameters and return types

Managing Browsers

Launch options, multiple tabs, proxies, connecting to local browsers

Store Credentials

Set up credentials for automated login with the agent

SDK Reference

Every SDK method, parameter, and type on one page (Python + TypeScript)

API Reference

Full OpenAPI spec for every REST endpoint

llms.txt

Machine-readable index of the entire documentation for AI coding agents