runTask
Start a browser automation. Skyvern opens a cloud browser, navigates to the URL, and executes your prompt with AI.
Parameters
TherunTask method accepts a single request object with the following shape:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
body.prompt | string | Yes | — | Natural language instructions for what the AI should do. |
body.url | string | No | undefined | Starting page URL. If omitted, the AI navigates from a blank page. |
body.engine | RunEngine | No | "skyvern_v2" | AI engine. Options: "skyvern_v2", "skyvern_v1", "openai_cua", "anthropic_cua", "ui_tars". |
body.max_steps | number | No | undefined | Cap the number of AI steps to limit cost. Run terminates with timed_out if hit. |
body.data_extraction_schema | Record<string, unknown> | string | No | undefined | JSON schema constraining the output shape. |
body.proxy_location | ProxyLocation | No | undefined | Route the browser through a geographic proxy. |
body.browser_session_id | string | No | undefined | Run inside an existing browser session. |
body.publish_workflow | boolean | No | false | Save the generated code as a reusable workflow. Only works with skyvern_v2. |
body.webhook_url | string | No | undefined | URL to receive a POST when the run finishes. |
body.error_code_mapping | Record<string, string> | No | undefined | Map custom error codes to failure reasons. |
body.totp_identifier | string | No | undefined | Identifier for TOTP verification. |
body.totp_url | string | No | undefined | URL to receive TOTP codes. |
body.title | string | No | undefined | Display name for this run in the dashboard. |
body.model | Record<string, unknown> | No | undefined | Override the output model definition. |
body.user_agent | string | No | undefined | Custom User-Agent header for the browser. |
body.extra_http_headers | Record<string, string> | No | undefined | Additional HTTP headers injected into every browser request. |
body.browser_address | string | No | undefined | Connect to a browser at this CDP address instead of spinning up a new one. |
waitForCompletion | boolean | No | false | Block until the run finishes. |
timeout | number | No | 1800 | Max wait time in seconds when waitForCompletion is true. |
Returns TaskRunResponse
| Field | Type | Description |
|---|---|---|
run_id | string | Unique identifier. Starts with tsk_ for task runs. |
status | string | "created", "queued", "running", "completed", "failed", "terminated", "timed_out", or "canceled". |
output | Record<string, unknown> | null | Extracted data from the run. Shape depends on your prompt or data_extraction_schema. |
downloaded_files | FileInfo[] | undefined | Files downloaded during the run. |
recording_url | string | undefined | URL to the session recording video. |
screenshot_urls | string[] | undefined | Final screenshots (most recent first). |
failure_reason | string | undefined | Error description if the run failed. |
app_url | string | undefined | Link to view this run in the Cloud UI. |
step_count | number | undefined | Number of AI steps taken. |
script_run | ScriptRunResponse | undefined | Code execution result if the run used generated code. |
created_at | string | When the run was created. |
finished_at | string | undefined | When the run finished. |
Examples
Extract structured data:getRun
Get the current status and results of any run (task or workflow).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | The run ID returned by runTask or runWorkflow. |
Returns GetRunResponse
A discriminated union based on run_type. All variants share the same core fields as TaskRunResponse above, plus a run_type field (task_v1, task_v2, openai_cua, anthropic_cua, ui_tars, workflow_run).
Workflow run responses additionally include run_with and ai_fallback fields.
cancelRun
Cancel a running or queued run.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | The run ID to cancel. |
canceled status. If the run has already finished, this is a no-op.
getRunTimeline
Get the step-by-step timeline of a run. Each entry represents one AI action with screenshots and reasoning.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | The run ID. |
Returns WorkflowRunTimeline[]
Each timeline entry contains step details including type, status, order, and associated artifacts.
getRunArtifacts
Get all artifacts (screenshots, recordings, generated code, etc.) for a run.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | The run ID. |
artifactType | ArtifactType | ArtifactType[] | No | Filter by artifact type. |
Returns Artifact[]
getArtifact
Get a single artifact by ID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
artifactId | string | Yes | The artifact ID. |
Returns Artifact
retryRunWebhook
Re-send the webhook notification for a completed run. Useful if your webhook endpoint was down when the run finished.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | The run ID. |
Polling pattern
If you don’t usewaitForCompletion, poll getRun manually:

