Skip to content

Skyvern: Run a task

Skyvern tasks.runTask: arguments, response, policy and SDK examples.

← Tasks operations · Get started

Operation skyvern.run_task_v1_run_tasks_post

Provider route: POST /v1/run/tasks. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/skyvern with npm, or alter-sdk-skyvern with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { SkyvernIntegration } from "@alter-ai/skyvern";
async function execute(input: Parameters<SkyvernIntegration["tasks"]["runTask"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new SkyvernIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.tasks.runTask(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_skyvern import SkyvernIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SkyvernIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.tasks.run_task(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectOptionalAdditional keys: not allowed
headers.x-user-agentJSONOptional
headers.x-user-agent (anyOf 1)stringAlternative
headers.x-user-agent (anyOf 2)nullAlternative
bodyModelRequired within parentExpand Run a task — request body — body

Referenced models: Run a task — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Run a task — response body

Referenced models: Run a task — response body

2 more schemas are linked from the tables above, on the schema pages.

Run a task — response body
FieldTypePresenceDescription and constraints
$objectRoot
app_urlJSONOptionalURL to the application UI where the run can be viewed
app_url (anyOf 1)stringAlternative
app_url (anyOf 2)nullAlternative
browser_profile_idJSONOptionalID of the browser profile used for this run
browser_profile_id (anyOf 1)stringAlternative
browser_profile_id (anyOf 2)nullAlternative
browser_session_idJSONOptionalID of the Skyvern persistent browser session used for this run
browser_session_id (anyOf 1)stringAlternative
browser_session_id (anyOf 2)nullAlternative
created_atstringRequired within parentTimestamp when this run was created
Format: date-time
downloaded_filesJSONOptionalList of files downloaded during the run
downloaded_files (anyOf 1)arrayAlternative
downloaded_files (anyOf 1)[]ModelEach itemExpand Get a session — response body — recordings array item
downloaded_files (anyOf 2)nullAlternative
errorsJSONOptionalThe errors for the run
errors (anyOf 1)arrayAlternative
errors (anyOf 1)[]objectEach itemAdditional keys: allowed
errors (anyOf 2)nullAlternative
failure_reasonJSONOptionalReason for failure if the run failed or terminated
failure_reason (anyOf 1)stringAlternative
failure_reason (anyOf 2)nullAlternative
finished_atJSONOptionalTimestamp when this run finished
finished_at (anyOf 1)stringAlternativeFormat: date-time
finished_at (anyOf 2)nullAlternative
max_screenshot_scrollsJSONOptionalThe maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot
max_screenshot_scrolls (anyOf 1)JSONAlternative
max_screenshot_scrolls (anyOf 1) (anyOf 1)integerAlternative
max_screenshot_scrolls (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
max_screenshot_scrolls (anyOf 2)nullAlternative
modified_atstringRequired within parentTimestamp when this run was last modified
Format: date-time
outputJSONOptionalOutput data from the run, if any. Format/schema depends on the data extracted by the run.
output (anyOf 1)objectAlternativeAdditional keys: allowed
output (anyOf 2)arrayAlternative
output (anyOf 2)[]JSONEach item
output (anyOf 3)stringAlternative
output (anyOf 4)nullAlternative
queued_atJSONOptionalTimestamp when this run was queued
queued_at (anyOf 1)stringAlternativeFormat: date-time
queued_at (anyOf 2)nullAlternative
recording_archivedbooleanOptionalTrue when the recording exists but has been archived to cold storage and is not currently accessible.
Default: false
recording_urlJSONOptionalURL to the recording of the run
recording_url (anyOf 1)stringAlternative
recording_url (anyOf 2)nullAlternative
run_idstringRequired within parentUnique identifier for this run. Run ID starts with `tsk_` for task runs and `wr_` for workflow runs.
run_requestJSONOptionalThe original request parameters used to start this task run
run_request (anyOf 1)ModelAlternativeExpand Run a task — response body — run request browser address, browser profile id, browser session id, cdp connect headers, data extraction schema, engine, error code mapping, extra http headers, file ids, include action history in verification, max screenshot scrolls, max steps, model, prompt, proxy location, publish workflow, run with, start fresh browser, title, totp identifier, totp url, url, webhook url
run_request (anyOf 2)nullAlternative
run_typestringRequired within parentTypes of a task run - task_v1, task_v2, openai_cua, anthropic_cua, ui_tars
Known values: task_v1, task_v2, task_v3, openai_cua, anthropic_cua, ui_tars, yutori_navigator
screenshot_urlsJSONOptionalList of last n screenshot URLs in reverse chronological order - the first one the list is the latest screenshot.
screenshot_urls (anyOf 1)arrayAlternative
screenshot_urls (anyOf 1)[]stringEach item
screenshot_urls (anyOf 2)nullAlternative
script_runJSONOptionalThe script run result
script_run (anyOf 1)ModelAlternativeExpand Login Task — response body — script run ai fallback triggered, script id, script revision id
script_run (anyOf 2)nullAlternative
started_atJSONOptionalTimestamp when this run started execution
started_at (anyOf 1)stringAlternativeFormat: date-time
started_at (anyOf 2)nullAlternative
statusstringRequired within parentCurrent status of the run
Known values: created, queued, running, paused, timed_out, failed, terminated, completed, canceled
step_countJSONOptionalTotal number of steps executed in this run
step_count (anyOf 1)JSONAlternative
step_count (anyOf 1) (anyOf 1)integerAlternative
step_count (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
step_count (anyOf 2)nullAlternative

Referenced models: Get a session — response body — recordings array item, Login Task — response body — script run ai fallback triggered, script id, script revision id, Run a task — response body — run request browser address, browser profile id, browser session id, cdp connect headers, data extraction schema, engine, error code mapping, extra http headers, file ids, include action history in verification, max screenshot scrolls, max steps, model, prompt, proxy location, publish workflow, run with, start fresh browser, title, totp identifier, totp url, url, webhook url

Get a session — response body — recordings array item
FieldTypePresenceDescription and constraints
$objectRootInformation about a downloaded file, including URL and checksum.
artifact_idJSONOptionalArtifact row id for refresh-on-read
artifact_id (anyOf 1)stringAlternative
artifact_id (anyOf 2)nullAlternative
checksumJSONOptionalSHA-256 checksum of the file
checksum (anyOf 1)stringAlternative
checksum (anyOf 2)nullAlternative
file_sizeJSONOptionalSize of the file in bytes
file_size (anyOf 1)JSONAlternative
file_size (anyOf 1) (anyOf 1)integerAlternative
file_size (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
file_size (anyOf 2)nullAlternative
filenameJSONOptionalOriginal filename
filename (anyOf 1)stringAlternative
filename (anyOf 2)nullAlternative
modified_atJSONOptionalModified time of the file
modified_at (anyOf 1)stringAlternativeFormat: date-time
modified_at (anyOf 2)nullAlternative
urlstringRequired within parentURL to access the file
Login Task — response body — script run ai fallback triggered, script id, script revision id
FieldTypePresenceDescription and constraints
$objectRoot
ai_fallback_triggeredbooleanOptionalDefault: false
script_idJSONOptional
script_id (anyOf 1)stringAlternative
script_id (anyOf 2)nullAlternative
script_revision_idJSONOptional
script_revision_id (anyOf 1)stringAlternative
script_revision_id (anyOf 2)nullAlternative
Update an agent — response body — proxy location city, country, is ISP, subdivision
FieldTypePresenceDescription and constraints
$objectRootGranular proxy geo-targeting request with country, optional subdivision, and optional city.
cityJSONOptionalCity name in English from GeoNames (e.g., 'New York', 'Los Angeles', 'London')
city (anyOf 1)stringAlternativeMaximum length: 100
city (anyOf 2)nullAlternative
countrystringRequired within parentISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'DE')
Maximum length: 2
Minimum length: 2
isISPbooleanOptionalWhether this geo target is marked as an ISP proxy location.
Default: false
subdivisionJSONOptionalISO 3166-2 subdivision code without country prefix (e.g., 'CA' for California, 'NY' for New York)
subdivision (anyOf 1)stringAlternativeMaximum length: 10
subdivision (anyOf 2)nullAlternative
Update an agent — response body — proxy location string
FieldTypePresenceDescription and constraints
$stringRootKnown values: RESIDENTIAL, US-CA, US-NY, US-TX, US-FL, US-WA, RESIDENTIAL_ES, RESIDENTIAL_IE, RESIDENTIAL_GB, RESIDENTIAL_IN, RESIDENTIAL_JP, RESIDENTIAL_FR, RESIDENTIAL_DE, RESIDENTIAL_NZ, RESIDENTIAL_ZA, RESIDENTIAL_AR, RESIDENTIAL_AU, RESIDENTIAL_BR, RESIDENTIAL_TR, RESIDENTIAL_CA, RESIDENTIAL_MX, RESIDENTIAL_IT, RESIDENTIAL_NL, RESIDENTIAL_PH, RESIDENTIAL_KR, RESIDENTIAL_SA, RESIDENTIAL_ISP, NONE

SDK function policy ID: skyvern.run_task_v1_run_tasks_post. Catalog operation: run_task_v1_run_tasks_post. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.