Install and initialize
Imports
SkyvernError and SkyvernTimeoutError are top-level exports. The HTTP-specific errors (BadRequestError, etc.) extend SkyvernError and are accessed via the SkyvernApi namespace.
Tasks
runTask
TaskRunResponse fields:
| Field | Type | Description |
|---|---|---|
run_id | string | Unique ID (tsk_...). |
status | string | created | queued | running | completed | failed | terminated | timed_out | canceled |
output | Record<string, unknown> | null | Extracted data. null until completed. |
failure_reason | string | undefined | Error description if failed. |
downloaded_files | FileInfo[] | undefined | Files downloaded during the run. |
recording_url | string | undefined | Session recording video URL. |
screenshot_urls | string[] | undefined | Final screenshots. |
app_url | string | undefined | Link to run in Skyvern UI. |
step_count | number | undefined | Number of AI steps taken. |
created_at | string | When the run was created. |
finished_at | string | undefined | When the run finished. |
getRun
cancelRun
getRunTimeline
getRunArtifacts
getArtifact
retryRunWebhook
Workflows
runWorkflow
WorkflowRunResponse fields: Same as TaskRunResponse plus run_with, ai_fallback, script_run.
createWorkflow
Workflow fields: workflow_id, workflow_permanent_id, version, title, workflow_definition, status, created_at
getWorkflows
getWorkflow
getWorkflowVersions
updateWorkflow
deleteWorkflow
Browser sessions
A persistent browser instance that stays alive between API calls. Use to chain tasks without losing cookies or login state.createBrowserSession
BrowserSessionResponse fields: browser_session_id, status, browser_address, app_url, timeout, started_at, created_at
getBrowserSession
getBrowserSessions
closeBrowserSession
Session chaining example
Browser profiles
A saved snapshot of browser state (cookies, local storage). Create from a completed workflow run, then reuse to skip login.createBrowserProfile
BrowserProfile fields: browser_profile_id, name, description, created_at
listBrowserProfiles
getBrowserProfile
deleteBrowserProfile
Credentials
Store login information securely. Reference by ID instead of passing secrets in code.createCredential
getCredentials
getCredential
deleteCredential
sendTotpCode
Send a TOTP code to Skyvern during a run that requires 2FA.
Helper methods
login
Automate logging into a website using stored credentials.
downloadFiles
uploadFile
Browser automation (Playwright + AI)
The TypeScript SDK extends Playwright with AI capabilities via cloud browsers.Launch browsers
Get pages
AI-enhanced page methods
Full task execution via page.agent
Error handling
SkyvernApi.BadRequestError (400), SkyvernApi.ForbiddenError (403), SkyvernApi.NotFoundError (404), SkyvernApi.ConflictError (409), SkyvernApi.UnprocessableEntityError (422). All inherit from SkyvernError.
Completion timeout throws a standard Error:
result.status:
Request options
Override timeout, retries, or headers per-request (second parameter on all methods):Polling pattern
When not usingwaitForCompletion:
Key constraints
browser_profile_idworks withrunWorkflowonly — silently ignored byrunTask.- Only workflow runs with
persist_browser_session: trueproduce archives for profile creation. - Session archiving is async — profile creation may need a short retry delay after a run completes.
engineaccepts string values:"skyvern_v1","skyvern_v2","openai_cua","anthropic_cua","ui_tars".- Cloud browser methods (
launchCloudBrowser,useCloudBrowser,connectToCloudBrowserSession) only work withCloudorStagingenvironments. - The SDK depends on
playwrightfor browser automation features.

