Skip to main content
Agents are saved, multi-step automations (called workflows in older SDK versions and in method names). Agent IDs start with wpid_; agent run IDs start with wr_. Every method here also accepts request_options (Python) or a final requestOptions argument (TypeScript) to override the timeout, retries or headers for one call; see request options.

Run an agent

run_workflow

Run an agent
Parameters
str
required
ID of the agent (wpid_…).TypeScript: agent_id
dict[str, Any] | None
Parameters to pass to the workflowDefault: None
bool | None
Default: None
str | None
The title for this workflow runDefault: None
ProxyLocationInput
Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.Default: None
str | None
URL to send workflow status updates to after a run is finished. Refer to https://www.skyvern.com/docs/running-tasks/webhooks-faq for webhook questions.Default: None
str | None
URL that serves TOTP/2FA/MFA codes for Skyvern to use during the workflow run. Refer to https://www.skyvern.com/docs/credentials/totp#option-2-get-code-from-your-endpoint for more details.Default: None
str | None
Identifier for the TOTP/2FA/MFA code when the code is pushed to Skyvern. Refer to https://www.skyvern.com/docs/credentials/totp#option-3-push-code-to-skyvern for more details.Default: None
str | None
ID of a Skyvern browser session to reuse, having it continue from the current screen stateDefault: None
int | None
Override the agent’s maximum number of steps for this run.Default: None · TypeScript: x-max-steps-override
str | None
User-Agent string the browser sends.Default: None · TypeScript: x-user-agent
str | None
ID of a browser profile to reuse for this workflow runDefault: None
int | None
The maximum number of scrolls for the post action screenshot. When it’s None or 0, it takes the current viewpoint screenshot.Default: None
int | None
Timeout this workflow run after the configured elapsed runtime in minutes. When omitted, the platform default is 240 minutes. The maximum configurable value is 480 minutes.Default: None
dict[str, str] | None
The extra HTTP headers for the requests in browser.Default: None
str | None
The CDP address for the workflow run.Default: None
bool | None
Whether to fallback to AI if the workflow run fails.Default: None
str | None
Whether to run the workflow with agent or code. Null inherits from the workflow setting.Default: None
dict[str, str] | None
String key/value metadata to attach to this workflow run for analytics tag filtering.Default: None
bool
Wait for the run to reach a final status before returning.Default: False · TypeScript: waitForCompletion
float
Maximum time to wait for completion, in seconds.Default: 1800
Record<string, string | undefined>
HTTP headers attached ONLY to the CDP WebSocket handshake when connecting to a remote browser via browser_address. Use this for browser-provider auth (e.g., x-api-key for Skyvern Cloud, Browserless, or similar). These headers are NEVER forwarded to target websites.TypeScript only
Returns WorkflowRunResponse · TypeScript Promise<WorkflowRunResponse>
Example

retry_workflow_run

Retry a workflow run using the original run parameters.
Parameters
str
required
The id of the workflow run to retry.TypeScript: workflowRunId
int | None
Override the agent’s maximum number of steps for this run.Default: None · TypeScript: x-max-steps-override
str | None
User-Agent string the browser sends.Default: None · TypeScript: x-user-agent
Returns WorkflowRunResponse · TypeScript Promise<WorkflowRunResponse>
Example

Manage agents

create_workflow

Create a new agent
Parameters
str | None
Optional folder ID to assign the workflow toDefault: None
WorkflowCreateYamlRequest | None
Workflow definition in JSON formatSent only when you pass it · TypeScript: body.json_definition
str | None
Workflow definition in YAML formatSent only when you pass it · TypeScript: body.yaml_definition
WorkflowRequest
required
TypeScript only
Returns Workflow · TypeScript Promise<Workflow>
Example

get_workflow

Get an agent by id
Parameters
str
required
ID of the agent (wpid_…).TypeScript: workflowPermanentId
int | None
Default: None
bool | None
Default: None
Returns Workflow · TypeScript Promise<Workflow>
Example

get_workflows

Get all workflows with the latest version for the organization. Search semantics:
  • If search_key is provided, its value is used as a unified search term for workflows.title, folders.title, and workflow parameter metadata (key, description, and default_value for WorkflowParameterModel).
  • Falls back to deprecated title (title-only search) if search_key is not provided.
  • Parameter metadata search excludes soft-deleted parameter rows across all parameter tables.
Parameters
int | None
Default: None
int | None
Default: None
bool | None
Default: None
bool | None
Default: None
bool | None
Default: None
str | None
Case-insensitive substring search across: workflow title, folder name, and parameter metadata (key, description, default_value). A workflow is returned if any of these fields match. Soft-deleted parameter definitions are excluded. Takes precedence over the deprecated title parameter.Default: None
str | None
Deprecated: use search_key instead. Falls back to title-only search if search_key is not provided.Default: None
str | None
Filter workflows by folder IDDefault: None
WorkflowStatus | Sequence[WorkflowStatus] | None
Default: None
str | Sequence[str] | None
Filter by tags. Each term is a label (production), a group (env:*), or a group:label (env:prod). Repeat the param or comma-separate (?tags=env:prod,env:staging). AND across distinct terms, OR within a group’s labels (?tags=customer:acme,env:prod,env:staging -> customer=acme AND env in (prod, staging)). A label term matches the value across any/no group. Matches current tag values only. Not supported with template=true.Default: None
bool | None
Default: None
Returns list[Workflow] · TypeScript Promise<Workflow[]>
Example

get_workflow_versions

Get all versions of a workflow by its permanent ID.
Parameters
str
required
ID of the agent (wpid_…).TypeScript: workflowPermanentId
bool | None
Default: None
Returns list[Workflow] · TypeScript Promise<Workflow[]>
Example

update_workflow

Update an agent
Parameters
str
required
The ID of the agent to update. Starts with wpid_.TypeScript: workflowId
WorkflowCreateYamlRequest | None
Workflow definition in JSON formatSent only when you pass it
str | None
Workflow definition in YAML formatSent only when you pass it
Returns Workflow · TypeScript Promise<Workflow>
Example

delete_workflow

Delete an agent
Parameters
str
required
The ID of the agent to delete. Starts with wpid_.TypeScript: workflowId
Returns Any | None · TypeScript Promise<unknown> Example

Agent runs

get_workflow_runs

List workflow runs across all workflows for the current organization. Results are paginated and can be filtered by status, search_key, and error_code. All filters are combined with AND logic — a run must match every supplied filter to be returned. search_key A case-insensitive substring search that matches against any of the following fields: Soft-deleted parameter definitions are excluded from key/description matching. A run is returned if any of the fields above contain the search term. error_code An exact-match filter against the error_code field inside each task’s errors JSON array. A run matches if any of its tasks contains an error object with a matching error_code value. Error codes are user-defined strings set during workflow execution (e.g. INVALID_CREDENTIALS, LOGIN_FAILED, CAPTCHA_DETECTED). Combining filters All query parameters use AND logic:
  • ?status=failed — only failed runs
  • ?status=failed&error_code=LOGIN_FAILED — failed runs and have a LOGIN_FAILED error
  • ?status=failed&error_code=LOGIN_FAILED&search_key=prod_credential — all three conditions must match
Parameters
int | None
Page number for pagination.Default: None
int | None
Number of runs to return per page.Default: None
WorkflowRunStatus | Sequence[WorkflowRunStatus] | None
Filter by one or more run statuses.Default: None
str | None
Case-insensitive substring search across: workflow run ID, parameter key, parameter description, run parameter value, and extra HTTP headers. A run is returned if any of these fields match. Soft-deleted parameter definitions are excluded from key/description matching.Default: None
str | None
Exact-match filter on the error_code field inside each task’s errors JSON array. A run matches if any of its tasks contains an error with a matching error_code. Error codes are user-defined strings set during workflow execution.Default: None
Returns list[WorkflowRun] · TypeScript Promise<WorkflowRun[]>
Example

get_workflow_runs_by_id

List runs for a specific workflow. Supports filtering by status, search_key, and error_code. All filters are combined with AND logic. search_key Case-insensitive substring search across: workflow run ID, parameter key, parameter description, run parameter value, and extra HTTP headers. Soft-deleted parameter definitions are excluded. error_code Exact-match filter on the error_code field inside each task’s errors JSON array. A run matches if any of its tasks contains an error with a matching error_code.
Parameters
str
required
ID of the agent (wpid_…).TypeScript: workflowId
int | None
Page number for pagination.Default: None
int | None
Number of runs to return per page.Default: None
WorkflowRunStatus | Sequence[WorkflowRunStatus] | None
Filter by one or more run statuses.Default: None
str | None
Case-insensitive substring search across: workflow run ID, parameter key, parameter description, run parameter value, and extra HTTP headers. A run is returned if any of these fields match. Soft-deleted parameter definitions are excluded from key/description matching.Default: None
str | None
Exact-match filter on the error_code field inside each task’s errors JSON array. A run matches if any of its tasks contains an error with a matching error_code. Error codes are user-defined strings set during workflow execution.Default: None
datetime | None
Only include runs created at or after this UTC timestamp (ISO 8601).Default: None
datetime | None
Only include runs created strictly before this UTC timestamp (ISO 8601).Default: None
Returns list[WorkflowRun] · TypeScript Promise<WorkflowRun[]>
Example