2025-02-19 00:58:48 +08:00
# This file was auto-generated by Fern from our API Definition.
2025-10-27 16:26:37 -06:00
from __future__ import annotations
import datetime as dt
2025-02-19 00:58:48 +08:00
import typing
2025-10-27 16:26:37 -06:00
2025-02-19 00:58:48 +08:00
import httpx
2025-12-19 12:16:02 -08:00
from . import core
2025-10-27 16:26:37 -06:00
from . core . client_wrapper import AsyncClientWrapper , SyncClientWrapper
2025-05-27 23:38:14 -07:00
from . core . request_options import RequestOptions
2025-10-27 16:26:37 -06:00
from . environment import SkyvernEnvironment
from . raw_client import AsyncRawSkyvern , RawSkyvern
2025-05-27 23:38:14 -07:00
from . types . artifact import Artifact
2025-07-15 02:01:23 -07:00
from . types . artifact_type import ArtifactType
2025-12-02 20:21:25 -07:00
from . types . browser_profile import BrowserProfile
2025-05-27 23:38:14 -07:00
from . types . browser_session_response import BrowserSessionResponse
from . types . create_credential_request_credential import CreateCredentialRequestCredential
2025-10-27 16:26:37 -06:00
from . types . create_script_response import CreateScriptResponse
from . types . credential_response import CredentialResponse
from . types . get_run_response import GetRunResponse
from . types . proxy_location import ProxyLocation
2025-12-19 12:16:02 -08:00
from . types . retry_run_webhook_request import RetryRunWebhookRequest
2025-10-27 16:26:37 -06:00
from . types . run_engine import RunEngine
2025-11-06 11:26:37 -07:00
from . types . run_sdk_action_request_action import RunSdkActionRequestAction
2025-10-29 11:54:57 -06:00
from . types . run_sdk_action_response import RunSdkActionResponse
2025-10-21 14:25:45 -07:00
from . types . script import Script
from . types . script_file_create import ScriptFileCreate
2025-10-27 16:26:37 -06:00
from . types . skyvern_forge_sdk_schemas_credentials_credential_type import SkyvernForgeSdkSchemasCredentialsCredentialType
from . types . skyvern_schemas_run_blocks_credential_type import SkyvernSchemasRunBlocksCredentialType
from . types . task_run_request_data_extraction_schema import TaskRunRequestDataExtractionSchema
2025-12-02 20:21:25 -07:00
from . types . task_run_request_proxy_location import TaskRunRequestProxyLocation
2025-10-27 16:26:37 -06:00
from . types . task_run_response import TaskRunResponse
from . types . totp_code import TotpCode
2025-12-19 12:16:02 -08:00
from . types . upload_file_response import UploadFileResponse
2025-10-27 16:26:37 -06:00
from . types . workflow import Workflow
from . types . workflow_create_yaml_request import WorkflowCreateYamlRequest
2025-12-02 20:21:25 -07:00
from . types . workflow_run_request_proxy_location import WorkflowRunRequestProxyLocation
2025-10-27 16:26:37 -06:00
from . types . workflow_run_response import WorkflowRunResponse
from . types . workflow_run_timeline import WorkflowRunTimeline
2025-11-06 11:26:37 -07:00
from . types . workflow_status import WorkflowStatus
2025-05-27 23:38:14 -07:00
2025-10-27 16:26:37 -06:00
if typing . TYPE_CHECKING :
from . scripts . client import AsyncScriptsClient , ScriptsClient
2025-05-27 23:38:14 -07:00
# this is used as the default value for optional parameters
OMIT = typing . cast ( typing . Any , . . . )
2025-02-19 00:58:48 +08:00
class Skyvern :
"""
Use this class to access the different functions within the SDK . You can instantiate any number of clients with different configuration that will propagate to these functions .
Parameters
- - - - - - - - - -
base_url : typing . Optional [ str ]
2025-06-05 07:01:46 -07:00
The base url to use for requests from the client .
2025-02-19 00:58:48 +08:00
environment : SkyvernEnvironment
The environment to use for requests from the client . from . environment import SkyvernEnvironment
2025-10-31 10:40:33 -06:00
Defaults to SkyvernEnvironment . CLOUD
2025-02-19 00:58:48 +08:00
2025-03-27 22:54:35 -07:00
api_key : typing . Optional [ str ]
2025-10-27 16:26:37 -06:00
headers : typing . Optional [ typing . Dict [ str , str ] ]
Additional headers to send with every request .
2025-02-19 00:58:48 +08:00
timeout : typing . Optional [ float ]
The timeout to be used , in seconds , for requests . By default the timeout is 60 seconds , unless a custom httpx client is used , in which case this default is not enforced .
follow_redirects : typing . Optional [ bool ]
Whether the default httpx client follows redirects or not , this is irrelevant if a custom httpx client is passed in .
httpx_client : typing . Optional [ httpx . Client ]
The httpx client to use for making requests , a preconfigured client is used by default , however this is useful should you want to pass in any custom httpx configuration .
Examples
- - - - - - - -
2025-03-27 22:54:35 -07:00
from skyvern import Skyvern
2025-02-19 00:58:48 +08:00
2025-03-27 22:54:35 -07:00
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
2025-02-19 00:58:48 +08:00
"""
def __init__ (
self ,
* ,
base_url : typing . Optional [ str ] = None ,
2025-10-31 10:40:33 -06:00
environment : SkyvernEnvironment = SkyvernEnvironment . CLOUD ,
2025-03-27 22:54:35 -07:00
api_key : typing . Optional [ str ] = None ,
2025-10-27 16:26:37 -06:00
headers : typing . Optional [ typing . Dict [ str , str ] ] = None ,
2025-02-19 00:58:48 +08:00
timeout : typing . Optional [ float ] = None ,
follow_redirects : typing . Optional [ bool ] = True ,
httpx_client : typing . Optional [ httpx . Client ] = None ,
) :
2025-10-27 16:26:37 -06:00
_defaulted_timeout = (
timeout if timeout is not None else 60 if httpx_client is None else httpx_client . timeout . read
)
2025-02-19 00:58:48 +08:00
self . _client_wrapper = SyncClientWrapper (
base_url = _get_base_url ( base_url = base_url , environment = environment ) ,
2025-03-27 22:54:35 -07:00
api_key = api_key ,
2025-10-27 16:26:37 -06:00
headers = headers ,
2025-02-19 00:58:48 +08:00
httpx_client = httpx_client
if httpx_client is not None
else httpx . Client ( timeout = _defaulted_timeout , follow_redirects = follow_redirects )
if follow_redirects is not None
else httpx . Client ( timeout = _defaulted_timeout ) ,
timeout = _defaulted_timeout ,
)
2025-10-27 16:26:37 -06:00
self . _raw_client = RawSkyvern ( client_wrapper = self . _client_wrapper )
self . _scripts : typing . Optional [ ScriptsClient ] = None
@property
def with_raw_response ( self ) - > RawSkyvern :
"""
Retrieves a raw implementation of this client that returns raw responses .
Returns
- - - - - - -
RawSkyvern
"""
return self . _raw_client
2025-05-27 23:38:14 -07:00
def run_task (
self ,
* ,
prompt : str ,
user_agent : typing . Optional [ str ] = None ,
url : typing . Optional [ str ] = OMIT ,
engine : typing . Optional [ RunEngine ] = OMIT ,
title : typing . Optional [ str ] = OMIT ,
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ TaskRunRequestProxyLocation ] = OMIT ,
2025-05-27 23:38:14 -07:00
data_extraction_schema : typing . Optional [ TaskRunRequestDataExtractionSchema ] = OMIT ,
error_code_mapping : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
max_steps : typing . Optional [ int ] = OMIT ,
webhook_url : typing . Optional [ str ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
2025-07-15 02:01:23 -07:00
model : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ] = OMIT ,
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
2025-05-27 23:38:14 -07:00
publish_workflow : typing . Optional [ bool ] = OMIT ,
include_action_history_in_verification : typing . Optional [ bool ] = OMIT ,
2025-07-15 02:01:23 -07:00
max_screenshot_scrolls : typing . Optional [ int ] = OMIT ,
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ] = OMIT ,
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
) - > TaskRunResponse :
"""
Run a task
Parameters
- - - - - - - - - -
prompt : str
The goal or task description for Skyvern to accomplish
user_agent : typing . Optional [ str ]
url : typing . Optional [ str ]
The starting URL for the task . If not provided , Skyvern will attempt to determine an appropriate URL
engine : typing . Optional [ RunEngine ]
The engine that powers the agent task . The default value is ` skyvern - 2.0 ` , the latest Skyvern agent that performs pretty well with complex and multi - step tasks . ` skyvern - 1.0 ` is good for simple tasks like filling a form , or searching for information on Google . The ` openai - cua ` engine uses OpenAI ' s CUA model. The `anthropic-cua` uses Anthropic ' s Claude Sonnet 3.7 model with the computer use tool .
title : typing . Optional [ str ]
The title for the task
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ TaskRunRequestProxyLocation ]
2025-05-27 23:38:14 -07:00
Geographic Proxy location to route the browser traffic through . This is only available in Skyvern Cloud .
Available geotargeting options :
- RESIDENTIAL : the default value . Skyvern Cloud uses a random US residential proxy .
- RESIDENTIAL_ES : Spain
- RESIDENTIAL_IE : Ireland
- RESIDENTIAL_GB : United Kingdom
- RESIDENTIAL_IN : India
- RESIDENTIAL_JP : Japan
- RESIDENTIAL_FR : France
- RESIDENTIAL_DE : Germany
- RESIDENTIAL_NZ : New Zealand
- RESIDENTIAL_ZA : South Africa
- RESIDENTIAL_AR : Argentina
2025-07-15 02:01:23 -07:00
- RESIDENTIAL_AU : Australia
2025-05-27 23:38:14 -07:00
- RESIDENTIAL_ISP : ISP proxy
- US - CA : California
- US - NY : New York
- US - TX : Texas
- US - FL : Florida
- US - WA : Washington
- NONE : No proxy
2025-12-02 20:21:25 -07:00
Can also be a GeoTarget object for granular city / state targeting : { " country " : " US " , " subdivision " : " CA " , " city " : " San Francisco " }
2025-05-27 23:38:14 -07:00
data_extraction_schema : typing . Optional [ TaskRunRequestDataExtractionSchema ]
The schema for data to be extracted from the webpage . If you ' re looking for consistent data schema being returned by the agent, it ' s highly recommended to use https : / / json - schema . org / .
error_code_mapping : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
Custom mapping of error codes to error messages if Skyvern encounters an error .
max_steps : typing . Optional [ int ]
Maximum number of steps the task can take . Task will fail if it exceeds this number . Cautions : you are charged per step so please set this number to a reasonable value . Contact sales @skyvern.com for custom pricing .
webhook_url : typing . Optional [ str ]
2025-10-10 10:40:58 -04:00
After a run is finished , send an update to this URL . Refer to https : / / www . skyvern . com / docs / running - tasks / webhooks - faq for more details .
2025-05-27 23:38:14 -07:00
totp_identifier : typing . Optional [ str ]
2025-10-10 10:40:58 -04:00
Identifier for the TOTP / 2 FA / 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.
2025-05-27 23:38:14 -07:00
totp_url : typing . Optional [ str ]
2025-10-10 10:40:58 -04:00
URL that serves TOTP / 2 FA / 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.
2025-05-27 23:38:14 -07:00
browser_session_id : typing . Optional [ str ]
Run the task or workflow in the specific Skyvern browser session . Having a browser session can persist the real - time state of the browser , so that the next run can continue from where the previous run left off .
2025-07-15 02:01:23 -07:00
model : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ]
Optional model configuration .
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
The extra HTTP headers for the requests in browser .
2025-05-27 23:38:14 -07:00
publish_workflow : typing . Optional [ bool ]
Whether to publish this task as a reusable workflow . Only available for skyvern - 2.0 .
include_action_history_in_verification : typing . Optional [ bool ]
Whether to include action history when verifying that the task is complete
2025-07-15 02:01:23 -07:00
max_screenshot_scrolls : typing . Optional [ int ]
The maximum number of scrolls for the post action screenshot . When it ' s None or 0, it takes the current viewpoint screenshot.
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ]
The CDP address for the task .
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
TaskRunResponse
Successfully run task
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . run_task (
2025-10-27 16:26:37 -06:00
user_agent = " x-user-agent " ,
2025-05-27 23:38:14 -07:00
prompt = " Find the top 3 posts on Hacker News. " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . run_task (
prompt = prompt ,
user_agent = user_agent ,
url = url ,
engine = engine ,
title = title ,
proxy_location = proxy_location ,
data_extraction_schema = data_extraction_schema ,
error_code_mapping = error_code_mapping ,
max_steps = max_steps ,
webhook_url = webhook_url ,
totp_identifier = totp_identifier ,
totp_url = totp_url ,
browser_session_id = browser_session_id ,
model = model ,
extra_http_headers = extra_http_headers ,
publish_workflow = publish_workflow ,
include_action_history_in_verification = include_action_history_in_verification ,
max_screenshot_scrolls = max_screenshot_scrolls ,
browser_address = browser_address ,
2025-05-27 23:38:14 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def run_workflow (
self ,
* ,
workflow_id : str ,
template : typing . Optional [ bool ] = None ,
max_steps_override : typing . Optional [ int ] = None ,
user_agent : typing . Optional [ str ] = None ,
parameters : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ] = OMIT ,
title : typing . Optional [ str ] = OMIT ,
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ WorkflowRunRequestProxyLocation ] = OMIT ,
2025-05-27 23:38:14 -07:00
webhook_url : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
2025-11-10 13:51:53 -07:00
browser_profile_id : typing . Optional [ str ] = OMIT ,
2025-07-15 02:01:23 -07:00
max_screenshot_scrolls : typing . Optional [ int ] = OMIT ,
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ] = OMIT ,
ai_fallback : typing . Optional [ bool ] = OMIT ,
run_with : typing . Optional [ str ] = OMIT ,
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
) - > WorkflowRunResponse :
"""
Run a workflow
Parameters
- - - - - - - - - -
workflow_id : str
ID of the workflow to run . Workflow ID starts with ` wpid_ ` .
template : typing . Optional [ bool ]
max_steps_override : typing . Optional [ int ]
user_agent : typing . Optional [ str ]
parameters : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ]
Parameters to pass to the workflow
title : typing . Optional [ str ]
The title for this workflow run
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ WorkflowRunRequestProxyLocation ]
2025-05-27 23:38:14 -07:00
Geographic Proxy location to route the browser traffic through . This is only available in Skyvern Cloud .
Available geotargeting options :
- RESIDENTIAL : the default value . Skyvern Cloud uses a random US residential proxy .
- RESIDENTIAL_ES : Spain
- RESIDENTIAL_IE : Ireland
- RESIDENTIAL_GB : United Kingdom
- RESIDENTIAL_IN : India
- RESIDENTIAL_JP : Japan
- RESIDENTIAL_FR : France
- RESIDENTIAL_DE : Germany
- RESIDENTIAL_NZ : New Zealand
- RESIDENTIAL_ZA : South Africa
- RESIDENTIAL_AR : Argentina
2025-07-15 02:01:23 -07:00
- RESIDENTIAL_AU : Australia
2025-05-27 23:38:14 -07:00
- RESIDENTIAL_ISP : ISP proxy
- US - CA : California
- US - NY : New York
- US - TX : Texas
- US - FL : Florida
- US - WA : Washington
- NONE : No proxy
2025-12-02 20:21:25 -07:00
Can also be a GeoTarget object for granular city / state targeting : { " country " : " US " , " subdivision " : " CA " , " city " : " San Francisco " }
2025-05-27 23:38:14 -07:00
webhook_url : typing . Optional [ str ]
2025-10-10 10:40:58 -04:00
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 .
2025-05-27 23:38:14 -07:00
totp_url : typing . Optional [ str ]
2025-10-10 10:40:58 -04:00
URL that serves TOTP / 2 FA / 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.
2025-05-27 23:38:14 -07:00
totp_identifier : typing . Optional [ str ]
2025-10-10 10:40:58 -04:00
Identifier for the TOTP / 2 FA / 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.
2025-05-27 23:38:14 -07:00
browser_session_id : typing . Optional [ str ]
ID of a Skyvern browser session to reuse , having it continue from the current screen state
2025-11-10 13:51:53 -07:00
browser_profile_id : typing . Optional [ str ]
ID of a browser profile to reuse for this workflow run
2025-07-15 02:01:23 -07:00
max_screenshot_scrolls : typing . Optional [ int ]
The maximum number of scrolls for the post action screenshot . When it ' s None or 0, it takes the current viewpoint screenshot.
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
The extra HTTP headers for the requests in browser .
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ]
The CDP address for the workflow run .
ai_fallback : typing . Optional [ bool ]
Whether to fallback to AI if the workflow run fails .
run_with : typing . Optional [ str ]
Whether to run the workflow with agent or code .
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
WorkflowRunResponse
Successfully run workflow
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . run_workflow (
2025-10-27 16:26:37 -06:00
max_steps_override = 1 ,
user_agent = " x-user-agent " ,
template = True ,
2025-05-27 23:38:14 -07:00
workflow_id = " wpid_123 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . run_workflow (
workflow_id = workflow_id ,
template = template ,
max_steps_override = max_steps_override ,
user_agent = user_agent ,
parameters = parameters ,
title = title ,
proxy_location = proxy_location ,
webhook_url = webhook_url ,
totp_url = totp_url ,
totp_identifier = totp_identifier ,
browser_session_id = browser_session_id ,
2025-11-10 13:51:53 -07:00
browser_profile_id = browser_profile_id ,
2025-10-27 16:26:37 -06:00
max_screenshot_scrolls = max_screenshot_scrolls ,
extra_http_headers = extra_http_headers ,
browser_address = browser_address ,
ai_fallback = ai_fallback ,
run_with = run_with ,
2025-05-27 23:38:14 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def get_run ( self , run_id : str , * , request_options : typing . Optional [ RequestOptions ] = None ) - > GetRunResponse :
"""
Get run information ( task run , workflow run )
Parameters
- - - - - - - - - -
run_id : str
The id of the task run or the workflow run .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
GetRunResponse
Successfully got run
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_run (
run_id = " tsk_123 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_run ( run_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def cancel_run (
self , run_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . Optional [ typing . Any ] :
"""
Cancel a run ( task or workflow )
Parameters
- - - - - - - - - -
run_id : str
The id of the task run or the workflow run to cancel .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . Optional [ typing . Any ]
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . cancel_run (
run_id = " run_id " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . cancel_run ( run_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def get_workflows (
self ,
* ,
page : typing . Optional [ int ] = None ,
page_size : typing . Optional [ int ] = None ,
only_saved_tasks : typing . Optional [ bool ] = None ,
only_workflows : typing . Optional [ bool ] = None ,
2025-12-17 14:11:39 -07:00
only_templates : typing . Optional [ bool ] = None ,
2025-10-21 14:25:45 -07:00
search_key : typing . Optional [ str ] = None ,
2025-05-27 23:38:14 -07:00
title : typing . Optional [ str ] = None ,
2025-11-06 11:26:37 -07:00
folder_id : typing . Optional [ str ] = None ,
status : typing . Optional [ typing . Union [ WorkflowStatus , typing . Sequence [ WorkflowStatus ] ] ] = None ,
2025-05-27 23:38:14 -07:00
template : typing . Optional [ bool ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > typing . List [ Workflow ] :
"""
Get all workflows with the latest version for the organization .
2025-10-21 14:25:45 -07:00
Search semantics :
2025-11-06 11:26:37 -07:00
- 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
2025-10-21 14:25:45 -07:00
` 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 .
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
page : typing . Optional [ int ]
page_size : typing . Optional [ int ]
only_saved_tasks : typing . Optional [ bool ]
only_workflows : typing . Optional [ bool ]
2025-12-17 14:11:39 -07:00
only_templates : typing . Optional [ bool ]
2025-10-21 14:25:45 -07:00
search_key : typing . Optional [ str ]
2025-11-06 11:26:37 -07:00
Unified search across workflow title , folder name , and parameter metadata ( key , description , default_value ) .
2025-10-21 14:25:45 -07:00
2025-05-27 23:38:14 -07:00
title : typing . Optional [ str ]
2025-10-21 14:25:45 -07:00
Deprecated : use search_key instead .
2025-05-27 23:38:14 -07:00
2025-11-06 11:26:37 -07:00
folder_id : typing . Optional [ str ]
Filter workflows by folder ID
status : typing . Optional [ typing . Union [ WorkflowStatus , typing . Sequence [ WorkflowStatus ] ] ]
2025-05-27 23:38:14 -07:00
template : typing . Optional [ bool ]
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . List [ Workflow ]
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
2025-10-27 16:26:37 -06:00
client . get_workflows (
page = 1 ,
page_size = 1 ,
only_saved_tasks = True ,
only_workflows = True ,
2025-12-17 14:11:39 -07:00
only_templates = True ,
2025-10-27 16:26:37 -06:00
search_key = " search_key " ,
title = " title " ,
2025-11-06 11:26:37 -07:00
folder_id = " folder_id " ,
2025-10-27 16:26:37 -06:00
template = True ,
)
"""
_response = self . _raw_client . get_workflows (
page = page ,
page_size = page_size ,
only_saved_tasks = only_saved_tasks ,
only_workflows = only_workflows ,
2025-12-17 14:11:39 -07:00
only_templates = only_templates ,
2025-10-27 16:26:37 -06:00
search_key = search_key ,
title = title ,
2025-11-06 11:26:37 -07:00
folder_id = folder_id ,
status = status ,
2025-10-27 16:26:37 -06:00
template = template ,
2025-05-27 23:38:14 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def create_workflow (
self ,
* ,
2025-11-10 13:51:53 -07:00
folder_id : typing . Optional [ str ] = None ,
2025-05-27 23:38:14 -07:00
json_definition : typing . Optional [ WorkflowCreateYamlRequest ] = OMIT ,
yaml_definition : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > Workflow :
"""
Create a new workflow
Parameters
- - - - - - - - - -
2025-11-10 13:51:53 -07:00
folder_id : typing . Optional [ str ]
Optional folder ID to assign the workflow to
2025-05-27 23:38:14 -07:00
json_definition : typing . Optional [ WorkflowCreateYamlRequest ]
Workflow definition in JSON format
yaml_definition : typing . Optional [ str ]
Workflow definition in YAML format
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
Workflow
Successfully created workflow
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
2025-11-10 13:51:53 -07:00
client . create_workflow (
folder_id = " folder_id " ,
)
2025-05-27 23:38:14 -07:00
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . create_workflow (
2025-11-10 13:51:53 -07:00
folder_id = folder_id ,
json_definition = json_definition ,
yaml_definition = yaml_definition ,
request_options = request_options ,
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def update_workflow (
self ,
workflow_id : str ,
* ,
json_definition : typing . Optional [ WorkflowCreateYamlRequest ] = OMIT ,
yaml_definition : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > Workflow :
"""
Update a workflow
Parameters
- - - - - - - - - -
workflow_id : str
The ID of the workflow to update . Workflow ID starts with ` wpid_ ` .
json_definition : typing . Optional [ WorkflowCreateYamlRequest ]
Workflow definition in JSON format
yaml_definition : typing . Optional [ str ]
Workflow definition in YAML format
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
Workflow
Successfully updated workflow
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . update_workflow (
workflow_id = " wpid_123 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . update_workflow (
workflow_id ,
json_definition = json_definition ,
yaml_definition = yaml_definition ,
2025-05-27 23:38:14 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def delete_workflow (
self , workflow_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . Optional [ typing . Any ] :
"""
Delete a workflow
Parameters
- - - - - - - - - -
workflow_id : str
The ID of the workflow to delete . Workflow ID starts with ` wpid_ ` .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . Optional [ typing . Any ]
Successfully deleted workflow
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . delete_workflow (
workflow_id = " wpid_123 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . delete_workflow ( workflow_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def get_artifact ( self , artifact_id : str , * , request_options : typing . Optional [ RequestOptions ] = None ) - > Artifact :
"""
Get an artifact
Parameters
- - - - - - - - - -
artifact_id : str
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
Artifact
Successfully retrieved artifact
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_artifact (
artifact_id = " artifact_id " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_artifact ( artifact_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-07-15 02:01:23 -07:00
def get_run_artifacts (
self ,
run_id : str ,
* ,
artifact_type : typing . Optional [ typing . Union [ ArtifactType , typing . Sequence [ ArtifactType ] ] ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > typing . List [ Artifact ] :
"""
Get artifacts for a run
Parameters
- - - - - - - - - -
run_id : str
The id of the task run or the workflow run .
artifact_type : typing . Optional [ typing . Union [ ArtifactType , typing . Sequence [ ArtifactType ] ] ]
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . List [ Artifact ]
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_run_artifacts (
run_id = " run_id " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_run_artifacts (
run_id , artifact_type = artifact_type , request_options = request_options
2025-07-15 02:01:23 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-07-15 02:01:23 -07:00
2025-05-27 23:38:14 -07:00
def retry_run_webhook (
2025-12-18 10:38:51 -08:00
self ,
run_id : str ,
* ,
2025-12-19 12:16:02 -08:00
request : typing . Optional [ RetryRunWebhookRequest ] = None ,
2025-12-18 10:38:51 -08:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-05-27 23:38:14 -07:00
) - > typing . Optional [ typing . Any ] :
"""
Retry sending the webhook for a run
Parameters
- - - - - - - - - -
run_id : str
The id of the task run or the workflow run .
2025-12-19 12:16:02 -08:00
request : typing . Optional [ RetryRunWebhookRequest ]
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . Optional [ typing . Any ]
Successful Response
Examples
- - - - - - - -
2025-12-19 12:16:02 -08:00
from skyvern import RetryRunWebhookRequest , Skyvern
2025-05-27 23:38:14 -07:00
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . retry_run_webhook (
run_id = " tsk_123 " ,
2025-12-19 12:16:02 -08:00
request = RetryRunWebhookRequest ( ) ,
2025-05-27 23:38:14 -07:00
)
"""
2025-12-19 12:16:02 -08:00
_response = self . _raw_client . retry_run_webhook ( run_id , request = request , request_options = request_options )
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
def get_run_timeline (
self , run_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . List [ WorkflowRunTimeline ] :
"""
Get timeline for a run ( workflow run or task_v2 run )
Parameters
- - - - - - - - - -
run_id : str
The id of the workflow run or task_v2 run .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . List [ WorkflowRunTimeline ]
Successfully retrieved run timeline
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_run_timeline (
run_id = " wr_123 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_run_timeline ( run_id , request_options = request_options )
return _response . data
2025-10-21 14:25:45 -07:00
2025-12-19 12:16:02 -08:00
def upload_file (
self , * , file : core . File , request_options : typing . Optional [ RequestOptions ] = None
) - > UploadFileResponse :
"""
Parameters
- - - - - - - - - -
file : core . File
See core . File for more documentation
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
UploadFileResponse
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . upload_file ( )
"""
_response = self . _raw_client . upload_file ( file = file , request_options = request_options )
return _response . data
2025-12-02 20:21:25 -07:00
def list_browser_profiles (
self , * , include_deleted : typing . Optional [ bool ] = None , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . List [ BrowserProfile ] :
"""
Get all browser profiles for the organization
Parameters
- - - - - - - - - -
include_deleted : typing . Optional [ bool ]
Include deleted browser profiles
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . List [ BrowserProfile ]
Successfully retrieved browser profiles
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . list_browser_profiles (
include_deleted = True ,
)
"""
_response = self . _raw_client . list_browser_profiles (
include_deleted = include_deleted , request_options = request_options
)
return _response . data
def create_browser_profile (
self ,
* ,
name : str ,
description : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
workflow_run_id : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > BrowserProfile :
"""
Create a browser profile from a persistent browser session or workflow run .
Parameters
- - - - - - - - - -
name : str
Name for the browser profile
description : typing . Optional [ str ]
Optional profile description
browser_session_id : typing . Optional [ str ]
Persistent browser session to convert into a profile
workflow_run_id : typing . Optional [ str ]
Workflow run whose persisted session should be captured
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
BrowserProfile
Successfully created browser profile
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . create_browser_profile (
name = " name " ,
)
"""
_response = self . _raw_client . create_browser_profile (
name = name ,
description = description ,
browser_session_id = browser_session_id ,
workflow_run_id = workflow_run_id ,
request_options = request_options ,
)
return _response . data
def get_browser_profile (
self , profile_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > BrowserProfile :
"""
Get a specific browser profile by ID
Parameters
- - - - - - - - - -
profile_id : str
The ID of the browser profile . browser_profile_id starts with ` bp_ `
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
BrowserProfile
Successfully retrieved browser profile
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_browser_profile (
profile_id = " bp_123456 " ,
)
"""
_response = self . _raw_client . get_browser_profile ( profile_id , request_options = request_options )
return _response . data
def delete_browser_profile (
self , profile_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > None :
"""
Delete a browser profile ( soft delete )
Parameters
- - - - - - - - - -
profile_id : str
The ID of the browser profile to delete . browser_profile_id starts with ` bp_ `
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
None
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . delete_browser_profile (
profile_id = " bp_123456 " ,
)
"""
_response = self . _raw_client . delete_browser_profile ( profile_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def get_browser_sessions (
self , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . List [ BrowserSessionResponse ] :
"""
Get all active browser sessions for the organization
Parameters
- - - - - - - - - -
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . List [ BrowserSessionResponse ]
Successfully retrieved all active browser sessions
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_browser_sessions ( )
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_browser_sessions ( request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def create_browser_session (
2025-10-21 14:25:45 -07:00
self ,
* ,
timeout : typing . Optional [ int ] = OMIT ,
proxy_location : typing . Optional [ ProxyLocation ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
2025-05-27 23:38:14 -07:00
) - > BrowserSessionResponse :
"""
2025-07-22 07:21:45 -07:00
Create a browser session that persists across multiple runs
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
timeout : typing . Optional [ int ]
2025-10-21 14:25:45 -07:00
Timeout in minutes for the session . Timeout is applied after the session is started . Must be between 5 and 1440. Defaults to 60.
proxy_location : typing . Optional [ ProxyLocation ]
Geographic Proxy location to route the browser traffic through . This is only available in Skyvern Cloud .
Available geotargeting options :
- RESIDENTIAL : the default value . Skyvern Cloud uses a random US residential proxy .
- RESIDENTIAL_ES : Spain
- RESIDENTIAL_IE : Ireland
- RESIDENTIAL_GB : United Kingdom
- RESIDENTIAL_IN : India
- RESIDENTIAL_JP : Japan
- RESIDENTIAL_FR : France
- RESIDENTIAL_DE : Germany
- RESIDENTIAL_NZ : New Zealand
- RESIDENTIAL_ZA : South Africa
- RESIDENTIAL_AR : Argentina
- RESIDENTIAL_AU : Australia
- RESIDENTIAL_ISP : ISP proxy
- US - CA : California
- US - NY : New York
- US - TX : Texas
- US - FL : Florida
- US - WA : Washington
- NONE : No proxy
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
BrowserSessionResponse
Successfully created browser session
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . create_browser_session ( )
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . create_browser_session (
timeout = timeout , proxy_location = proxy_location , request_options = request_options
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def close_browser_session (
self , browser_session_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . Optional [ typing . Any ] :
"""
2025-07-22 07:21:45 -07:00
Close a session . Once closed , the session cannot be used again .
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
browser_session_id : str
The ID of the browser session to close . completed_at will be set when the browser session is closed . browser_session_id starts with ` pbs_ `
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . Optional [ typing . Any ]
Successfully closed browser session
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . close_browser_session (
browser_session_id = " pbs_123456 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . close_browser_session ( browser_session_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def get_browser_session (
self , browser_session_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > BrowserSessionResponse :
"""
2025-07-22 07:21:45 -07:00
Get details about a specific browser session , including the browser address for cdp connection .
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
browser_session_id : str
The ID of the browser session . browser_session_id starts with ` pbs_ `
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
BrowserSessionResponse
Successfully retrieved browser session details
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_browser_session (
browser_session_id = " pbs_123456 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_browser_session ( browser_session_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def send_totp_code (
self ,
* ,
totp_identifier : str ,
content : str ,
task_id : typing . Optional [ str ] = OMIT ,
workflow_id : typing . Optional [ str ] = OMIT ,
workflow_run_id : typing . Optional [ str ] = OMIT ,
source : typing . Optional [ str ] = OMIT ,
expired_at : typing . Optional [ dt . datetime ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > TotpCode :
"""
Forward a TOTP ( 2 FA , MFA ) email or sms message containing the code to Skyvern . This endpoint stores the code in database so that Skyvern can use it while running tasks / workflows .
Parameters
- - - - - - - - - -
totp_identifier : str
The identifier of the TOTP code . It can be the email address , phone number , or the identifier of the user .
content : str
The content of the TOTP code . It can be the email content that contains the TOTP code , or the sms message that contains the TOTP code . Skyvern will automatically extract the TOTP code from the content .
task_id : typing . Optional [ str ]
The task_id the totp code is for . It can be the task_id of the task that the TOTP code is for .
workflow_id : typing . Optional [ str ]
The workflow ID the TOTP code is for . It can be the workflow ID of the workflow that the TOTP code is for .
workflow_run_id : typing . Optional [ str ]
The workflow run id that the TOTP code is for . It can be the workflow run id of the workflow run that the TOTP code is for .
source : typing . Optional [ str ]
An optional field . The source of the TOTP code . e . g . email , sms , etc .
expired_at : typing . Optional [ dt . datetime ]
The timestamp when the TOTP code expires
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
TotpCode
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . send_totp_code (
totp_identifier = " john.doe@example.com " ,
content = " Hello, your verification code is 123456 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . send_totp_code (
totp_identifier = totp_identifier ,
content = content ,
task_id = task_id ,
workflow_id = workflow_id ,
workflow_run_id = workflow_run_id ,
source = source ,
expired_at = expired_at ,
2025-05-27 23:38:14 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def get_credentials (
self ,
* ,
page : typing . Optional [ int ] = None ,
page_size : typing . Optional [ int ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > typing . List [ CredentialResponse ] :
"""
Retrieves a paginated list of credentials for the current organization
Parameters
- - - - - - - - - -
page : typing . Optional [ int ]
Page number for pagination
page_size : typing . Optional [ int ]
Number of items per page
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . List [ CredentialResponse ]
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
2025-07-15 02:01:23 -07:00
)
client . get_credentials (
page = 1 ,
page_size = 10 ,
2025-05-27 23:38:14 -07:00
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_credentials ( page = page , page_size = page_size , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def create_credential (
self ,
* ,
name : str ,
2025-07-22 08:25:06 -07:00
credential_type : SkyvernForgeSdkSchemasCredentialsCredentialType ,
2025-05-27 23:38:14 -07:00
credential : CreateCredentialRequestCredential ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > CredentialResponse :
"""
Creates a new credential for the current organization
Parameters
- - - - - - - - - -
name : str
Name of the credential
2025-07-22 08:25:06 -07:00
credential_type : SkyvernForgeSdkSchemasCredentialsCredentialType
2025-05-27 23:38:14 -07:00
Type of credential to create
credential : CreateCredentialRequestCredential
The credential data to store
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
CredentialResponse
Successful Response
Examples
- - - - - - - -
from skyvern import NonEmptyPasswordCredential , Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . create_credential (
name = " My Credential " ,
credential_type = " password " ,
credential = NonEmptyPasswordCredential (
password = " securepassword123 " ,
username = " user@example.com " ,
totp = " JBSWY3DPEHPK3PXP " ,
) ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . create_credential (
name = name , credential_type = credential_type , credential = credential , request_options = request_options
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
def delete_credential ( self , credential_id : str , * , request_options : typing . Optional [ RequestOptions ] = None ) - > None :
"""
Deletes a specific credential by its ID
Parameters
- - - - - - - - - -
credential_id : str
The unique identifier of the credential to delete
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
None
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . delete_credential (
credential_id = " cred_1234567890 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . delete_credential ( credential_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
def get_credential (
self , credential_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > CredentialResponse :
"""
Retrieves a specific credential by its ID
Parameters
- - - - - - - - - -
credential_id : str
The unique identifier of the credential
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
CredentialResponse
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_credential (
credential_id = " cred_1234567890 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_credential ( credential_id , request_options = request_options )
return _response . data
2025-02-19 00:58:48 +08:00
2025-07-22 07:21:45 -07:00
def login (
2025-07-22 08:25:06 -07:00
self ,
* ,
credential_type : SkyvernSchemasRunBlocksCredentialType ,
url : typing . Optional [ str ] = OMIT ,
webhook_url : typing . Optional [ str ] = OMIT ,
proxy_location : typing . Optional [ ProxyLocation ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
2025-11-21 19:13:42 -07:00
browser_profile_id : typing . Optional [ str ] = OMIT ,
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ] = OMIT ,
2025-07-22 08:25:06 -07:00
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
max_screenshot_scrolling_times : typing . Optional [ int ] = OMIT ,
2025-12-04 10:50:29 -07:00
prompt : typing . Optional [ str ] = OMIT ,
2025-07-22 08:25:06 -07:00
credential_id : typing . Optional [ str ] = OMIT ,
bitwarden_collection_id : typing . Optional [ str ] = OMIT ,
bitwarden_item_id : typing . Optional [ str ] = OMIT ,
onepassword_vault_id : typing . Optional [ str ] = OMIT ,
onepassword_item_id : typing . Optional [ str ] = OMIT ,
2025-10-21 14:25:45 -07:00
azure_vault_name : typing . Optional [ str ] = OMIT ,
azure_vault_username_key : typing . Optional [ str ] = OMIT ,
azure_vault_password_key : typing . Optional [ str ] = OMIT ,
azure_vault_totp_secret_key : typing . Optional [ str ] = OMIT ,
2025-07-22 08:25:06 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-07-22 07:21:45 -07:00
) - > WorkflowRunResponse :
"""
2025-10-21 14:25:45 -07:00
Log in to a website using either credential stored in Skyvern , Bitwarden , 1 Password , or Azure Vault
2025-07-22 07:21:45 -07:00
Parameters
- - - - - - - - - -
2025-07-22 08:25:06 -07:00
credential_type : SkyvernSchemasRunBlocksCredentialType
Where to get the credential from
url : typing . Optional [ str ]
2025-12-04 10:50:29 -07:00
Website URL
2025-07-22 08:25:06 -07:00
webhook_url : typing . Optional [ str ]
2025-12-04 10:50:29 -07:00
Webhook URL to send status updates
2025-07-22 08:25:06 -07:00
proxy_location : typing . Optional [ ProxyLocation ]
Proxy location to use
totp_identifier : typing . Optional [ str ]
Identifier for TOTP ( Time - based One - Time Password ) if required
totp_url : typing . Optional [ str ]
TOTP URL to fetch one - time passwords
browser_session_id : typing . Optional [ str ]
ID of the browser session to use , which is prefixed by ` pbs_ ` e . g . ` pbs_123456 `
2025-11-21 19:13:42 -07:00
browser_profile_id : typing . Optional [ str ]
ID of a browser profile to reuse for this run
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ]
The CDP address for the task .
2025-07-22 08:25:06 -07:00
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
Additional HTTP headers to include in requests
max_screenshot_scrolling_times : typing . Optional [ int ]
Maximum number of times to scroll for screenshots
2025-12-04 10:50:29 -07:00
prompt : typing . Optional [ str ]
Login instructions . Skyvern has default prompt / instruction for login if this field is not provided .
2025-07-22 08:25:06 -07:00
credential_id : typing . Optional [ str ]
ID of the Skyvern credential to use for login .
bitwarden_collection_id : typing . Optional [ str ]
Bitwarden collection ID . You can find it in the Bitwarden collection URL . e . g . ` https : / / vault . bitwarden . com / vaults / collection_id / items `
bitwarden_item_id : typing . Optional [ str ]
Bitwarden item ID
onepassword_vault_id : typing . Optional [ str ]
1 Password vault ID
onepassword_item_id : typing . Optional [ str ]
1 Password item ID
2025-07-22 07:21:45 -07:00
2025-10-21 14:25:45 -07:00
azure_vault_name : typing . Optional [ str ]
Azure Vault Name
azure_vault_username_key : typing . Optional [ str ]
Azure Vault username key
azure_vault_password_key : typing . Optional [ str ]
Azure Vault password key
azure_vault_totp_secret_key : typing . Optional [ str ]
Azure Vault TOTP secret key
2025-07-22 07:21:45 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
WorkflowRunResponse
Successful Response
Examples
- - - - - - - -
2025-07-22 08:25:06 -07:00
from skyvern import Skyvern
2025-07-22 07:21:45 -07:00
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . login (
2025-07-22 08:25:06 -07:00
credential_type = " skyvern " ,
2025-07-22 07:21:45 -07:00
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . login (
credential_type = credential_type ,
url = url ,
webhook_url = webhook_url ,
proxy_location = proxy_location ,
totp_identifier = totp_identifier ,
totp_url = totp_url ,
browser_session_id = browser_session_id ,
2025-11-21 19:13:42 -07:00
browser_profile_id = browser_profile_id ,
2025-10-27 16:26:37 -06:00
browser_address = browser_address ,
extra_http_headers = extra_http_headers ,
max_screenshot_scrolling_times = max_screenshot_scrolling_times ,
2025-12-04 10:50:29 -07:00
prompt = prompt ,
2025-10-27 16:26:37 -06:00
credential_id = credential_id ,
bitwarden_collection_id = bitwarden_collection_id ,
bitwarden_item_id = bitwarden_item_id ,
onepassword_vault_id = onepassword_vault_id ,
onepassword_item_id = onepassword_item_id ,
azure_vault_name = azure_vault_name ,
azure_vault_username_key = azure_vault_username_key ,
azure_vault_password_key = azure_vault_password_key ,
azure_vault_totp_secret_key = azure_vault_totp_secret_key ,
2025-07-22 07:21:45 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-07-22 07:21:45 -07:00
2025-12-04 13:44:47 -07:00
def download_files (
2025-12-04 10:50:29 -07:00
self ,
* ,
navigation_goal : str ,
url : typing . Optional [ str ] = OMIT ,
webhook_url : typing . Optional [ str ] = OMIT ,
proxy_location : typing . Optional [ ProxyLocation ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
browser_profile_id : typing . Optional [ str ] = OMIT ,
browser_address : typing . Optional [ str ] = OMIT ,
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
max_screenshot_scrolling_times : typing . Optional [ int ] = OMIT ,
download_suffix : typing . Optional [ str ] = OMIT ,
download_timeout : typing . Optional [ float ] = OMIT ,
max_steps_per_run : typing . Optional [ int ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > WorkflowRunResponse :
"""
Download a file from a website by navigating and clicking download buttons
Parameters
- - - - - - - - - -
navigation_goal : str
Instructions for navigating to and downloading the file
url : typing . Optional [ str ]
Website URL
webhook_url : typing . Optional [ str ]
Webhook URL to send status updates
proxy_location : typing . Optional [ ProxyLocation ]
Proxy location to use
totp_identifier : typing . Optional [ str ]
Identifier for TOTP ( Time - based One - Time Password ) if required
totp_url : typing . Optional [ str ]
TOTP URL to fetch one - time passwords
browser_session_id : typing . Optional [ str ]
ID of the browser session to use , which is prefixed by ` pbs_ ` e . g . ` pbs_123456 `
browser_profile_id : typing . Optional [ str ]
ID of a browser profile to reuse for this run
browser_address : typing . Optional [ str ]
The CDP address for the task .
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
Additional HTTP headers to include in requests
max_screenshot_scrolling_times : typing . Optional [ int ]
Maximum number of times to scroll for screenshots
download_suffix : typing . Optional [ str ]
Suffix or complete filename for the downloaded file
download_timeout : typing . Optional [ float ]
Timeout in seconds for the download operation
max_steps_per_run : typing . Optional [ int ]
Maximum number of steps to execute
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
WorkflowRunResponse
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
2025-12-04 13:44:47 -07:00
client . download_files (
2025-12-04 10:50:29 -07:00
navigation_goal = " navigation_goal " ,
)
"""
2025-12-04 13:44:47 -07:00
_response = self . _raw_client . download_files (
2025-12-04 10:50:29 -07:00
navigation_goal = navigation_goal ,
url = url ,
webhook_url = webhook_url ,
proxy_location = proxy_location ,
totp_identifier = totp_identifier ,
totp_url = totp_url ,
browser_session_id = browser_session_id ,
browser_profile_id = browser_profile_id ,
browser_address = browser_address ,
extra_http_headers = extra_http_headers ,
max_screenshot_scrolling_times = max_screenshot_scrolling_times ,
download_suffix = download_suffix ,
download_timeout = download_timeout ,
max_steps_per_run = max_steps_per_run ,
request_options = request_options ,
)
return _response . data
2025-10-21 14:25:45 -07:00
def get_scripts (
self ,
* ,
page : typing . Optional [ int ] = None ,
page_size : typing . Optional [ int ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > typing . List [ Script ] :
"""
Retrieves a paginated list of scripts for the current organization
2025-02-19 00:58:48 +08:00
2025-10-21 14:25:45 -07:00
Parameters
- - - - - - - - - -
page : typing . Optional [ int ]
Page number for pagination
2025-02-19 00:58:48 +08:00
2025-10-21 14:25:45 -07:00
page_size : typing . Optional [ int ]
Number of items per page
2025-02-19 00:58:48 +08:00
2025-10-21 14:25:45 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
2025-02-19 00:58:48 +08:00
2025-10-21 14:25:45 -07:00
Returns
- - - - - - -
typing . List [ Script ]
Successful Response
2025-02-19 00:58:48 +08:00
2025-10-21 14:25:45 -07:00
Examples
- - - - - - - -
from skyvern import Skyvern
2025-02-19 00:58:48 +08:00
2025-10-21 14:25:45 -07:00
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_scripts (
page = 1 ,
page_size = 10 ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_scripts ( page = page , page_size = page_size , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
def create_script (
2025-05-27 23:38:14 -07:00
self ,
* ,
2025-10-21 14:25:45 -07:00
workflow_id : typing . Optional [ str ] = OMIT ,
run_id : typing . Optional [ str ] = OMIT ,
files : typing . Optional [ typing . Sequence [ ScriptFileCreate ] ] = OMIT ,
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-10-21 14:25:45 -07:00
) - > CreateScriptResponse :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Create a new script with optional files and metadata
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
workflow_id : typing . Optional [ str ]
Associated workflow ID
run_id : typing . Optional [ str ]
Associated run ID
files : typing . Optional [ typing . Sequence [ ScriptFileCreate ] ]
Array of files to include in the script
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
CreateScriptResponse
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . create_script ( )
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . create_script (
workflow_id = workflow_id , run_id = run_id , files = files , request_options = request_options
2025-10-21 14:25:45 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-10-21 14:25:45 -07:00
def get_script ( self , script_id : str , * , request_options : typing . Optional [ RequestOptions ] = None ) - > Script :
"""
Retrieves a specific script by its ID
Parameters
- - - - - - - - - -
script_id : str
The unique identifier of the script
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
Script
Successful Response
Examples
- - - - - - - -
from skyvern import Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . get_script (
script_id = " s_abc123 " ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . get_script ( script_id , request_options = request_options )
return _response . data
2025-10-21 14:25:45 -07:00
def deploy_script (
self ,
script_id : str ,
* ,
files : typing . Sequence [ ScriptFileCreate ] ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > CreateScriptResponse :
"""
Deploy a script with updated files , creating a new version
Parameters
- - - - - - - - - -
script_id : str
The unique identifier of the script
files : typing . Sequence [ ScriptFileCreate ]
Array of files to include in the script
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
CreateScriptResponse
Successful Response
Examples
- - - - - - - -
from skyvern import ScriptFileCreate , Skyvern
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . deploy_script (
script_id = " s_abc123 " ,
files = [
ScriptFileCreate (
path = " src/main.py " ,
content = " content " ,
)
] ,
)
"""
2025-10-27 16:26:37 -06:00
_response = self . _raw_client . deploy_script ( script_id , files = files , request_options = request_options )
return _response . data
2025-10-29 11:54:57 -06:00
def run_sdk_action (
self ,
* ,
url : str ,
2025-11-06 11:26:37 -07:00
action : RunSdkActionRequestAction ,
2025-10-29 11:54:57 -06:00
browser_session_id : typing . Optional [ str ] = OMIT ,
browser_address : typing . Optional [ str ] = OMIT ,
workflow_run_id : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > RunSdkActionResponse :
"""
Execute a single SDK action with the specified parameters
Parameters
- - - - - - - - - -
url : str
The URL where the action should be executed
2025-11-06 11:26:37 -07:00
action : RunSdkActionRequestAction
2025-10-29 11:54:57 -06:00
The action to execute with its specific parameters
browser_session_id : typing . Optional [ str ]
The browser session ID
browser_address : typing . Optional [ str ]
The browser address
workflow_run_id : typing . Optional [ str ]
Optional workflow run ID to continue an existing workflow run
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
RunSdkActionResponse
2025-11-06 11:26:37 -07:00
Successful Response
2025-10-29 11:54:57 -06:00
Examples
- - - - - - - -
2025-11-06 11:26:37 -07:00
from skyvern import RunSdkActionRequestAction_AiAct , Skyvern
2025-10-29 11:54:57 -06:00
client = Skyvern (
api_key = " YOUR_API_KEY " ,
)
client . run_sdk_action (
url = " url " ,
2025-11-06 11:26:37 -07:00
action = RunSdkActionRequestAction_AiAct ( ) ,
2025-10-29 11:54:57 -06:00
)
"""
_response = self . _raw_client . run_sdk_action (
url = url ,
action = action ,
browser_session_id = browser_session_id ,
browser_address = browser_address ,
workflow_run_id = workflow_run_id ,
request_options = request_options ,
)
return _response . data
2025-10-27 16:26:37 -06:00
@property
def scripts ( self ) :
if self . _scripts is None :
from . scripts . client import ScriptsClient # noqa: E402
self . _scripts = ScriptsClient ( client_wrapper = self . _client_wrapper )
return self . _scripts
2025-10-21 14:25:45 -07:00
class AsyncSkyvern :
"""
Use this class to access the different functions within the SDK . You can instantiate any number of clients with different configuration that will propagate to these functions .
Parameters
- - - - - - - - - -
base_url : typing . Optional [ str ]
The base url to use for requests from the client .
environment : SkyvernEnvironment
The environment to use for requests from the client . from . environment import SkyvernEnvironment
2025-10-31 10:40:33 -06:00
Defaults to SkyvernEnvironment . CLOUD
2025-10-21 14:25:45 -07:00
api_key : typing . Optional [ str ]
2025-10-27 16:26:37 -06:00
headers : typing . Optional [ typing . Dict [ str , str ] ]
Additional headers to send with every request .
2025-10-21 14:25:45 -07:00
timeout : typing . Optional [ float ]
The timeout to be used , in seconds , for requests . By default the timeout is 60 seconds , unless a custom httpx client is used , in which case this default is not enforced .
follow_redirects : typing . Optional [ bool ]
Whether the default httpx client follows redirects or not , this is irrelevant if a custom httpx client is passed in .
httpx_client : typing . Optional [ httpx . AsyncClient ]
The httpx client to use for making requests , a preconfigured client is used by default , however this is useful should you want to pass in any custom httpx configuration .
Examples
- - - - - - - -
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
"""
def __init__ (
self ,
* ,
base_url : typing . Optional [ str ] = None ,
2025-10-31 10:40:33 -06:00
environment : SkyvernEnvironment = SkyvernEnvironment . CLOUD ,
2025-10-21 14:25:45 -07:00
api_key : typing . Optional [ str ] = None ,
2025-10-27 16:26:37 -06:00
headers : typing . Optional [ typing . Dict [ str , str ] ] = None ,
2025-10-21 14:25:45 -07:00
timeout : typing . Optional [ float ] = None ,
follow_redirects : typing . Optional [ bool ] = True ,
httpx_client : typing . Optional [ httpx . AsyncClient ] = None ,
) :
2025-10-27 16:26:37 -06:00
_defaulted_timeout = (
timeout if timeout is not None else 60 if httpx_client is None else httpx_client . timeout . read
)
2025-10-21 14:25:45 -07:00
self . _client_wrapper = AsyncClientWrapper (
base_url = _get_base_url ( base_url = base_url , environment = environment ) ,
api_key = api_key ,
2025-10-27 16:26:37 -06:00
headers = headers ,
2025-10-21 14:25:45 -07:00
httpx_client = httpx_client
if httpx_client is not None
else httpx . AsyncClient ( timeout = _defaulted_timeout , follow_redirects = follow_redirects )
if follow_redirects is not None
else httpx . AsyncClient ( timeout = _defaulted_timeout ) ,
timeout = _defaulted_timeout ,
)
2025-10-27 16:26:37 -06:00
self . _raw_client = AsyncRawSkyvern ( client_wrapper = self . _client_wrapper )
self . _scripts : typing . Optional [ AsyncScriptsClient ] = None
@property
def with_raw_response ( self ) - > AsyncRawSkyvern :
"""
Retrieves a raw implementation of this client that returns raw responses .
Returns
- - - - - - -
AsyncRawSkyvern
"""
return self . _raw_client
2025-10-21 14:25:45 -07:00
async def run_task (
self ,
* ,
prompt : str ,
user_agent : typing . Optional [ str ] = None ,
url : typing . Optional [ str ] = OMIT ,
engine : typing . Optional [ RunEngine ] = OMIT ,
title : typing . Optional [ str ] = OMIT ,
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ TaskRunRequestProxyLocation ] = OMIT ,
2025-10-21 14:25:45 -07:00
data_extraction_schema : typing . Optional [ TaskRunRequestDataExtractionSchema ] = OMIT ,
error_code_mapping : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
max_steps : typing . Optional [ int ] = OMIT ,
webhook_url : typing . Optional [ str ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
model : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ] = OMIT ,
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
publish_workflow : typing . Optional [ bool ] = OMIT ,
include_action_history_in_verification : typing . Optional [ bool ] = OMIT ,
max_screenshot_scrolls : typing . Optional [ int ] = OMIT ,
browser_address : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > TaskRunResponse :
"""
Run a task
Parameters
- - - - - - - - - -
prompt : str
2025-05-27 23:38:14 -07:00
The goal or task description for Skyvern to accomplish
user_agent : typing . Optional [ str ]
url : typing . Optional [ str ]
The starting URL for the task . If not provided , Skyvern will attempt to determine an appropriate URL
engine : typing . Optional [ RunEngine ]
The engine that powers the agent task . The default value is ` skyvern - 2.0 ` , the latest Skyvern agent that performs pretty well with complex and multi - step tasks . ` skyvern - 1.0 ` is good for simple tasks like filling a form , or searching for information on Google . The ` openai - cua ` engine uses OpenAI ' s CUA model. The `anthropic-cua` uses Anthropic ' s Claude Sonnet 3.7 model with the computer use tool .
title : typing . Optional [ str ]
The title for the task
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ TaskRunRequestProxyLocation ]
2025-05-27 23:38:14 -07:00
Geographic Proxy location to route the browser traffic through . This is only available in Skyvern Cloud .
Available geotargeting options :
- RESIDENTIAL : the default value . Skyvern Cloud uses a random US residential proxy .
- RESIDENTIAL_ES : Spain
- RESIDENTIAL_IE : Ireland
- RESIDENTIAL_GB : United Kingdom
- RESIDENTIAL_IN : India
- RESIDENTIAL_JP : Japan
- RESIDENTIAL_FR : France
- RESIDENTIAL_DE : Germany
- RESIDENTIAL_NZ : New Zealand
- RESIDENTIAL_ZA : South Africa
- RESIDENTIAL_AR : Argentina
2025-07-15 02:01:23 -07:00
- RESIDENTIAL_AU : Australia
2025-05-27 23:38:14 -07:00
- RESIDENTIAL_ISP : ISP proxy
- US - CA : California
- US - NY : New York
- US - TX : Texas
- US - FL : Florida
- US - WA : Washington
- NONE : No proxy
2025-12-02 20:21:25 -07:00
Can also be a GeoTarget object for granular city / state targeting : { " country " : " US " , " subdivision " : " CA " , " city " : " San Francisco " }
2025-05-27 23:38:14 -07:00
data_extraction_schema : typing . Optional [ TaskRunRequestDataExtractionSchema ]
The schema for data to be extracted from the webpage . If you ' re looking for consistent data schema being returned by the agent, it ' s highly recommended to use https : / / json - schema . org / .
2025-10-21 14:25:45 -07:00
error_code_mapping : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
Custom mapping of error codes to error messages if Skyvern encounters an error .
max_steps : typing . Optional [ int ]
Maximum number of steps the task can take . Task will fail if it exceeds this number . Cautions : you are charged per step so please set this number to a reasonable value . Contact sales @skyvern.com for custom pricing .
webhook_url : typing . Optional [ str ]
After a run is finished , send an update to this URL . Refer to https : / / www . skyvern . com / docs / running - tasks / webhooks - faq for more details .
totp_identifier : typing . Optional [ str ]
Identifier for the TOTP / 2 FA / 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.
totp_url : typing . Optional [ str ]
URL that serves TOTP / 2 FA / 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.
browser_session_id : typing . Optional [ str ]
Run the task or workflow in the specific Skyvern browser session . Having a browser session can persist the real - time state of the browser , so that the next run can continue from where the previous run left off .
model : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ]
Optional model configuration .
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
The extra HTTP headers for the requests in browser .
publish_workflow : typing . Optional [ bool ]
Whether to publish this task as a reusable workflow . Only available for skyvern - 2.0 .
include_action_history_in_verification : typing . Optional [ bool ]
Whether to include action history when verifying that the task is complete
max_screenshot_scrolls : typing . Optional [ int ]
The maximum number of scrolls for the post action screenshot . When it ' s None or 0, it takes the current viewpoint screenshot.
browser_address : typing . Optional [ str ]
The CDP address for the task .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
TaskRunResponse
Successfully run task
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . run_task (
2025-10-27 16:26:37 -06:00
user_agent = " x-user-agent " ,
2025-10-21 14:25:45 -07:00
prompt = " Find the top 3 posts on Hacker News. " ,
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . run_task (
prompt = prompt ,
user_agent = user_agent ,
url = url ,
engine = engine ,
title = title ,
proxy_location = proxy_location ,
data_extraction_schema = data_extraction_schema ,
error_code_mapping = error_code_mapping ,
max_steps = max_steps ,
webhook_url = webhook_url ,
totp_identifier = totp_identifier ,
totp_url = totp_url ,
browser_session_id = browser_session_id ,
model = model ,
extra_http_headers = extra_http_headers ,
publish_workflow = publish_workflow ,
include_action_history_in_verification = include_action_history_in_verification ,
max_screenshot_scrolls = max_screenshot_scrolls ,
browser_address = browser_address ,
2025-10-21 14:25:45 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-10-21 14:25:45 -07:00
async def run_workflow (
self ,
* ,
workflow_id : str ,
template : typing . Optional [ bool ] = None ,
max_steps_override : typing . Optional [ int ] = None ,
user_agent : typing . Optional [ str ] = None ,
parameters : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ] = OMIT ,
title : typing . Optional [ str ] = OMIT ,
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ WorkflowRunRequestProxyLocation ] = OMIT ,
2025-10-21 14:25:45 -07:00
webhook_url : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
2025-11-10 13:51:53 -07:00
browser_profile_id : typing . Optional [ str ] = OMIT ,
2025-10-21 14:25:45 -07:00
max_screenshot_scrolls : typing . Optional [ int ] = OMIT ,
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
browser_address : typing . Optional [ str ] = OMIT ,
ai_fallback : typing . Optional [ bool ] = OMIT ,
run_with : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > WorkflowRunResponse :
"""
Run a workflow
Parameters
- - - - - - - - - -
workflow_id : str
ID of the workflow to run . Workflow ID starts with ` wpid_ ` .
template : typing . Optional [ bool ]
max_steps_override : typing . Optional [ int ]
user_agent : typing . Optional [ str ]
parameters : typing . Optional [ typing . Dict [ str , typing . Optional [ typing . Any ] ] ]
Parameters to pass to the workflow
title : typing . Optional [ str ]
The title for this workflow run
2025-12-02 20:21:25 -07:00
proxy_location : typing . Optional [ WorkflowRunRequestProxyLocation ]
2025-10-21 14:25:45 -07:00
Geographic Proxy location to route the browser traffic through . This is only available in Skyvern Cloud .
Available geotargeting options :
- RESIDENTIAL : the default value . Skyvern Cloud uses a random US residential proxy .
- RESIDENTIAL_ES : Spain
- RESIDENTIAL_IE : Ireland
- RESIDENTIAL_GB : United Kingdom
- RESIDENTIAL_IN : India
- RESIDENTIAL_JP : Japan
- RESIDENTIAL_FR : France
- RESIDENTIAL_DE : Germany
- RESIDENTIAL_NZ : New Zealand
- RESIDENTIAL_ZA : South Africa
- RESIDENTIAL_AR : Argentina
- RESIDENTIAL_AU : Australia
- RESIDENTIAL_ISP : ISP proxy
- US - CA : California
- US - NY : New York
- US - TX : Texas
- US - FL : Florida
- US - WA : Washington
- NONE : No proxy
2025-12-02 20:21:25 -07:00
Can also be a GeoTarget object for granular city / state targeting : { " country " : " US " , " subdivision " : " CA " , " city " : " San Francisco " }
2025-10-21 14:25:45 -07:00
webhook_url : typing . Optional [ str ]
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 .
totp_url : typing . Optional [ str ]
URL that serves TOTP / 2 FA / 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.
totp_identifier : typing . Optional [ str ]
Identifier for the TOTP / 2 FA / 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.
browser_session_id : typing . Optional [ str ]
ID of a Skyvern browser session to reuse , having it continue from the current screen state
2025-11-10 13:51:53 -07:00
browser_profile_id : typing . Optional [ str ]
ID of a browser profile to reuse for this workflow run
2025-10-21 14:25:45 -07:00
max_screenshot_scrolls : typing . Optional [ int ]
The maximum number of scrolls for the post action screenshot . When it ' s None or 0, it takes the current viewpoint screenshot.
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
The extra HTTP headers for the requests in browser .
browser_address : typing . Optional [ str ]
The CDP address for the workflow run .
ai_fallback : typing . Optional [ bool ]
Whether to fallback to AI if the workflow run fails .
run_with : typing . Optional [ str ]
Whether to run the workflow with agent or code .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
WorkflowRunResponse
Successfully run workflow
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . run_workflow (
2025-10-27 16:26:37 -06:00
max_steps_override = 1 ,
user_agent = " x-user-agent " ,
template = True ,
2025-10-21 14:25:45 -07:00
workflow_id = " wpid_123 " ,
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . run_workflow (
workflow_id = workflow_id ,
template = template ,
max_steps_override = max_steps_override ,
user_agent = user_agent ,
parameters = parameters ,
title = title ,
proxy_location = proxy_location ,
webhook_url = webhook_url ,
totp_url = totp_url ,
totp_identifier = totp_identifier ,
browser_session_id = browser_session_id ,
2025-11-10 13:51:53 -07:00
browser_profile_id = browser_profile_id ,
2025-10-27 16:26:37 -06:00
max_screenshot_scrolls = max_screenshot_scrolls ,
extra_http_headers = extra_http_headers ,
browser_address = browser_address ,
ai_fallback = ai_fallback ,
run_with = run_with ,
2025-10-21 14:25:45 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-10-21 14:25:45 -07:00
async def get_run ( self , run_id : str , * , request_options : typing . Optional [ RequestOptions ] = None ) - > GetRunResponse :
"""
Get run information ( task run , workflow run )
Parameters
- - - - - - - - - -
run_id : str
The id of the task run or the workflow run .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
GetRunResponse
Successfully got run
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . get_run (
run_id = " tsk_123 " ,
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_run ( run_id , request_options = request_options )
return _response . data
2025-10-21 14:25:45 -07:00
async def cancel_run (
self , run_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . Optional [ typing . Any ] :
"""
Cancel a run ( task or workflow )
Parameters
- - - - - - - - - -
run_id : str
The id of the task run or the workflow run to cancel .
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . Optional [ typing . Any ]
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . cancel_run (
run_id = " run_id " ,
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . cancel_run ( run_id , request_options = request_options )
return _response . data
2025-10-21 14:25:45 -07:00
async def get_workflows (
self ,
* ,
page : typing . Optional [ int ] = None ,
page_size : typing . Optional [ int ] = None ,
only_saved_tasks : typing . Optional [ bool ] = None ,
only_workflows : typing . Optional [ bool ] = None ,
2025-12-17 14:11:39 -07:00
only_templates : typing . Optional [ bool ] = None ,
2025-10-21 14:25:45 -07:00
search_key : typing . Optional [ str ] = None ,
title : typing . Optional [ str ] = None ,
2025-11-06 11:26:37 -07:00
folder_id : typing . Optional [ str ] = None ,
status : typing . Optional [ typing . Union [ WorkflowStatus , typing . Sequence [ WorkflowStatus ] ] ] = None ,
2025-10-21 14:25:45 -07:00
template : typing . Optional [ bool ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > typing . List [ Workflow ] :
"""
Get all workflows with the latest version for the organization .
Search semantics :
2025-11-06 11:26:37 -07:00
- 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
2025-10-21 14:25:45 -07:00
` 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
- - - - - - - - - -
page : typing . Optional [ int ]
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
page_size : typing . Optional [ int ]
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
only_saved_tasks : typing . Optional [ bool ]
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
only_workflows : typing . Optional [ bool ]
2025-05-27 23:38:14 -07:00
2025-12-17 14:11:39 -07:00
only_templates : typing . Optional [ bool ]
2025-10-21 14:25:45 -07:00
search_key : typing . Optional [ str ]
2025-11-06 11:26:37 -07:00
Unified search across workflow title , folder name , and parameter metadata ( key , description , default_value ) .
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
title : typing . Optional [ str ]
Deprecated : use search_key instead .
2025-05-27 23:38:14 -07:00
2025-11-06 11:26:37 -07:00
folder_id : typing . Optional [ str ]
Filter workflows by folder ID
status : typing . Optional [ typing . Union [ WorkflowStatus , typing . Sequence [ WorkflowStatus ] ] ]
2025-10-21 14:25:45 -07:00
template : typing . Optional [ bool ]
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
Returns
- - - - - - -
typing . List [ Workflow ]
Successful Response
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
Examples
- - - - - - - -
import asyncio
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
from skyvern import AsyncSkyvern
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
2025-05-27 23:38:14 -07:00
2025-10-17 13:15:24 -06:00
2025-10-21 14:25:45 -07:00
async def main ( ) - > None :
2025-10-27 16:26:37 -06:00
await client . get_workflows (
page = 1 ,
page_size = 1 ,
only_saved_tasks = True ,
only_workflows = True ,
2025-12-17 14:11:39 -07:00
only_templates = True ,
2025-10-27 16:26:37 -06:00
search_key = " search_key " ,
title = " title " ,
2025-11-06 11:26:37 -07:00
folder_id = " folder_id " ,
2025-10-27 16:26:37 -06:00
template = True ,
)
2025-07-15 02:01:23 -07:00
2025-10-21 14:25:45 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_workflows (
page = page ,
page_size = page_size ,
only_saved_tasks = only_saved_tasks ,
only_workflows = only_workflows ,
2025-12-17 14:11:39 -07:00
only_templates = only_templates ,
2025-10-27 16:26:37 -06:00
search_key = search_key ,
title = title ,
2025-11-06 11:26:37 -07:00
folder_id = folder_id ,
status = status ,
2025-10-27 16:26:37 -06:00
template = template ,
2025-10-21 14:25:45 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-07-15 02:01:23 -07:00
2025-10-21 14:25:45 -07:00
async def create_workflow (
self ,
* ,
2025-11-10 13:51:53 -07:00
folder_id : typing . Optional [ str ] = None ,
2025-10-21 14:25:45 -07:00
json_definition : typing . Optional [ WorkflowCreateYamlRequest ] = OMIT ,
yaml_definition : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > Workflow :
"""
Create a new workflow
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
Parameters
- - - - - - - - - -
2025-11-10 13:51:53 -07:00
folder_id : typing . Optional [ str ]
Optional folder ID to assign the workflow to
2025-10-21 14:25:45 -07:00
json_definition : typing . Optional [ WorkflowCreateYamlRequest ]
Workflow definition in JSON format
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
yaml_definition : typing . Optional [ str ]
Workflow definition in YAML format
2025-07-15 02:01:23 -07:00
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
Workflow
Successfully created workflow
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-11-10 13:51:53 -07:00
await client . create_workflow (
folder_id = " folder_id " ,
)
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . create_workflow (
2025-11-10 13:51:53 -07:00
folder_id = folder_id ,
json_definition = json_definition ,
yaml_definition = yaml_definition ,
request_options = request_options ,
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def update_workflow (
2025-05-27 23:38:14 -07:00
self ,
workflow_id : str ,
2025-10-21 14:25:45 -07:00
* ,
json_definition : typing . Optional [ WorkflowCreateYamlRequest ] = OMIT ,
yaml_definition : typing . Optional [ str ] = OMIT ,
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-10-21 14:25:45 -07:00
) - > Workflow :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Update a workflow
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
workflow_id : str
2025-10-21 14:25:45 -07:00
The ID of the workflow to update . Workflow ID starts with ` wpid_ ` .
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
json_definition : typing . Optional [ WorkflowCreateYamlRequest ]
Workflow definition in JSON format
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
yaml_definition : typing . Optional [ str ]
Workflow definition in YAML format
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
Returns
- - - - - - -
Workflow
Successfully updated workflow
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
Examples
- - - - - - - -
import asyncio
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
from skyvern import AsyncSkyvern
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def main ( ) - > None :
await client . update_workflow (
workflow_id = " wpid_123 " ,
)
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . update_workflow (
workflow_id ,
json_definition = json_definition ,
yaml_definition = yaml_definition ,
2025-10-21 14:25:45 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-10-17 13:15:24 -06:00
2025-10-21 14:25:45 -07:00
async def delete_workflow (
self , workflow_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . Optional [ typing . Any ] :
"""
Delete a workflow
2025-07-15 02:01:23 -07:00
2025-10-21 14:25:45 -07:00
Parameters
- - - - - - - - - -
workflow_id : str
The ID of the workflow to delete . Workflow ID starts with ` wpid_ ` .
2025-07-15 02:01:23 -07:00
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . Optional [ typing . Any ]
Successfully deleted workflow
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . delete_workflow (
2025-05-27 23:38:14 -07:00
workflow_id = " wpid_123 " ,
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . delete_workflow ( workflow_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def get_artifact (
self , artifact_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > Artifact :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Get an artifact
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
artifact_id : str
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
Artifact
Successfully retrieved artifact
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_artifact (
artifact_id = " artifact_id " ,
2025-05-27 23:38:14 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_artifact ( artifact_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def get_run_artifacts (
self ,
run_id : str ,
* ,
artifact_type : typing . Optional [ typing . Union [ ArtifactType , typing . Sequence [ ArtifactType ] ] ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > typing . List [ Artifact ] :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Get artifacts for a run
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
run_id : str
2025-10-21 14:25:45 -07:00
The id of the task run or the workflow run .
artifact_type : typing . Optional [ typing . Union [ ArtifactType , typing . Sequence [ ArtifactType ] ] ]
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . List [ Artifact ]
2025-05-27 23:38:14 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_run_artifacts (
2025-05-27 23:38:14 -07:00
run_id = " run_id " ,
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_run_artifacts (
run_id , artifact_type = artifact_type , request_options = request_options
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def retry_run_webhook (
2025-12-18 10:38:51 -08:00
self ,
run_id : str ,
* ,
2025-12-19 12:16:02 -08:00
request : typing . Optional [ RetryRunWebhookRequest ] = None ,
2025-12-18 10:38:51 -08:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-10-21 14:25:45 -07:00
) - > typing . Optional [ typing . Any ] :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Retry sending the webhook for a run
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
run_id : str
The id of the task run or the workflow run .
2025-05-27 23:38:14 -07:00
2025-12-19 12:16:02 -08:00
request : typing . Optional [ RetryRunWebhookRequest ]
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . Optional [ typing . Any ]
2025-05-27 23:38:14 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
2025-12-19 12:16:02 -08:00
from skyvern import AsyncSkyvern , RetryRunWebhookRequest
2025-05-27 23:38:14 -07:00
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . retry_run_webhook (
run_id = " tsk_123 " ,
2025-12-19 12:16:02 -08:00
request = RetryRunWebhookRequest ( ) ,
2025-10-21 14:25:45 -07:00
)
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-12-19 12:16:02 -08:00
_response = await self . _raw_client . retry_run_webhook ( run_id , request = request , request_options = request_options )
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def get_run_timeline (
self , run_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . List [ WorkflowRunTimeline ] :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Get timeline for a run ( workflow run or task_v2 run )
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
run_id : str
The id of the workflow run or task_v2 run .
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . List [ WorkflowRunTimeline ]
Successfully retrieved run timeline
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_run_timeline (
run_id = " wr_123 " ,
)
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_run_timeline ( run_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-12-19 12:16:02 -08:00
async def upload_file (
self , * , file : core . File , request_options : typing . Optional [ RequestOptions ] = None
) - > UploadFileResponse :
"""
Parameters
- - - - - - - - - -
file : core . File
See core . File for more documentation
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
UploadFileResponse
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . upload_file ( )
asyncio . run ( main ( ) )
"""
_response = await self . _raw_client . upload_file ( file = file , request_options = request_options )
return _response . data
2025-12-02 20:21:25 -07:00
async def list_browser_profiles (
self , * , include_deleted : typing . Optional [ bool ] = None , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . List [ BrowserProfile ] :
"""
Get all browser profiles for the organization
Parameters
- - - - - - - - - -
include_deleted : typing . Optional [ bool ]
Include deleted browser profiles
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
typing . List [ BrowserProfile ]
Successfully retrieved browser profiles
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . list_browser_profiles (
include_deleted = True ,
)
asyncio . run ( main ( ) )
"""
_response = await self . _raw_client . list_browser_profiles (
include_deleted = include_deleted , request_options = request_options
)
return _response . data
async def create_browser_profile (
self ,
* ,
name : str ,
description : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
workflow_run_id : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > BrowserProfile :
"""
Create a browser profile from a persistent browser session or workflow run .
Parameters
- - - - - - - - - -
name : str
Name for the browser profile
description : typing . Optional [ str ]
Optional profile description
browser_session_id : typing . Optional [ str ]
Persistent browser session to convert into a profile
workflow_run_id : typing . Optional [ str ]
Workflow run whose persisted session should be captured
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
BrowserProfile
Successfully created browser profile
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . create_browser_profile (
name = " name " ,
)
asyncio . run ( main ( ) )
"""
_response = await self . _raw_client . create_browser_profile (
name = name ,
description = description ,
browser_session_id = browser_session_id ,
workflow_run_id = workflow_run_id ,
request_options = request_options ,
)
return _response . data
async def get_browser_profile (
self , profile_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > BrowserProfile :
"""
Get a specific browser profile by ID
Parameters
- - - - - - - - - -
profile_id : str
The ID of the browser profile . browser_profile_id starts with ` bp_ `
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
BrowserProfile
Successfully retrieved browser profile
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . get_browser_profile (
profile_id = " bp_123456 " ,
)
asyncio . run ( main ( ) )
"""
_response = await self . _raw_client . get_browser_profile ( profile_id , request_options = request_options )
return _response . data
async def delete_browser_profile (
self , profile_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > None :
"""
Delete a browser profile ( soft delete )
Parameters
- - - - - - - - - -
profile_id : str
The ID of the browser profile to delete . browser_profile_id starts with ` bp_ `
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
None
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . delete_browser_profile (
profile_id = " bp_123456 " ,
)
asyncio . run ( main ( ) )
"""
_response = await self . _raw_client . delete_browser_profile ( profile_id , request_options = request_options )
return _response . data
2025-10-21 14:25:45 -07:00
async def get_browser_sessions (
self , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . List [ BrowserSessionResponse ] :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Get all active browser sessions for the organization
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . List [ BrowserSessionResponse ]
Successfully retrieved all active browser sessions
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_browser_sessions ( )
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_browser_sessions ( request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def create_browser_session (
self ,
* ,
timeout : typing . Optional [ int ] = OMIT ,
proxy_location : typing . Optional [ ProxyLocation ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > BrowserSessionResponse :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Create a browser session that persists across multiple runs
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
timeout : typing . Optional [ int ]
Timeout in minutes for the session . Timeout is applied after the session is started . Must be between 5 and 1440. Defaults to 60.
proxy_location : typing . Optional [ ProxyLocation ]
Geographic Proxy location to route the browser traffic through . This is only available in Skyvern Cloud .
Available geotargeting options :
- RESIDENTIAL : the default value . Skyvern Cloud uses a random US residential proxy .
- RESIDENTIAL_ES : Spain
- RESIDENTIAL_IE : Ireland
- RESIDENTIAL_GB : United Kingdom
- RESIDENTIAL_IN : India
- RESIDENTIAL_JP : Japan
- RESIDENTIAL_FR : France
- RESIDENTIAL_DE : Germany
- RESIDENTIAL_NZ : New Zealand
- RESIDENTIAL_ZA : South Africa
- RESIDENTIAL_AR : Argentina
- RESIDENTIAL_AU : Australia
- RESIDENTIAL_ISP : ISP proxy
- US - CA : California
- US - NY : New York
- US - TX : Texas
- US - FL : Florida
- US - WA : Washington
- NONE : No proxy
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
BrowserSessionResponse
Successfully created browser session
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . create_browser_session ( )
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . create_browser_session (
timeout = timeout , proxy_location = proxy_location , request_options = request_options
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def close_browser_session (
self , browser_session_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > typing . Optional [ typing . Any ] :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Close a session . Once closed , the session cannot be used again .
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
browser_session_id : str
The ID of the browser session to close . completed_at will be set when the browser session is closed . browser_session_id starts with ` pbs_ `
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . Optional [ typing . Any ]
Successfully closed browser session
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . close_browser_session (
browser_session_id = " pbs_123456 " ,
2025-05-27 23:38:14 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . close_browser_session ( browser_session_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def get_browser_session (
self , browser_session_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > BrowserSessionResponse :
2025-07-15 02:01:23 -07:00
"""
2025-10-21 14:25:45 -07:00
Get details about a specific browser session , including the browser address for cdp connection .
2025-07-15 02:01:23 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
browser_session_id : str
The ID of the browser session . browser_session_id starts with ` pbs_ `
2025-07-15 02:01:23 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
BrowserSessionResponse
Successfully retrieved browser session details
2025-07-15 02:01:23 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_browser_session (
browser_session_id = " pbs_123456 " ,
2025-07-15 02:01:23 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_browser_session ( browser_session_id , request_options = request_options )
return _response . data
2025-07-15 02:01:23 -07:00
2025-10-21 14:25:45 -07:00
async def send_totp_code (
self ,
* ,
totp_identifier : str ,
content : str ,
task_id : typing . Optional [ str ] = OMIT ,
workflow_id : typing . Optional [ str ] = OMIT ,
workflow_run_id : typing . Optional [ str ] = OMIT ,
source : typing . Optional [ str ] = OMIT ,
expired_at : typing . Optional [ dt . datetime ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > TotpCode :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Forward a TOTP ( 2 FA , MFA ) email or sms message containing the code to Skyvern . This endpoint stores the code in database so that Skyvern can use it while running tasks / workflows .
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
totp_identifier : str
The identifier of the TOTP code . It can be the email address , phone number , or the identifier of the user .
content : str
The content of the TOTP code . It can be the email content that contains the TOTP code , or the sms message that contains the TOTP code . Skyvern will automatically extract the TOTP code from the content .
task_id : typing . Optional [ str ]
The task_id the totp code is for . It can be the task_id of the task that the TOTP code is for .
workflow_id : typing . Optional [ str ]
The workflow ID the TOTP code is for . It can be the workflow ID of the workflow that the TOTP code is for .
workflow_run_id : typing . Optional [ str ]
The workflow run id that the TOTP code is for . It can be the workflow run id of the workflow run that the TOTP code is for .
source : typing . Optional [ str ]
An optional field . The source of the TOTP code . e . g . email , sms , etc .
expired_at : typing . Optional [ dt . datetime ]
The timestamp when the TOTP code expires
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
TotpCode
2025-05-27 23:38:14 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . send_totp_code (
totp_identifier = " john.doe@example.com " ,
content = " Hello, your verification code is 123456 " ,
2025-05-27 23:38:14 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . send_totp_code (
totp_identifier = totp_identifier ,
content = content ,
task_id = task_id ,
workflow_id = workflow_id ,
workflow_run_id = workflow_run_id ,
source = source ,
expired_at = expired_at ,
2025-05-27 23:38:14 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-10-21 14:25:45 -07:00
async def get_credentials (
self ,
* ,
page : typing . Optional [ int ] = None ,
page_size : typing . Optional [ int ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > typing . List [ CredentialResponse ] :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Retrieves a paginated list of credentials for the current organization
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
page : typing . Optional [ int ]
Page number for pagination
page_size : typing . Optional [ int ]
Number of items per page
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . List [ CredentialResponse ]
Successful Response
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_credentials (
page = 1 ,
page_size = 10 ,
)
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_credentials (
page = page , page_size = page_size , request_options = request_options
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def create_credential (
self ,
* ,
name : str ,
credential_type : SkyvernForgeSdkSchemasCredentialsCredentialType ,
credential : CreateCredentialRequestCredential ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > CredentialResponse :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Creates a new credential for the current organization
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
name : str
Name of the credential
credential_type : SkyvernForgeSdkSchemasCredentialsCredentialType
Type of credential to create
credential : CreateCredentialRequestCredential
The credential data to store
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
CredentialResponse
Successful Response
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
2025-10-21 14:25:45 -07:00
from skyvern import AsyncSkyvern , NonEmptyPasswordCredential
2025-05-27 23:38:14 -07:00
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . create_credential (
name = " My Credential " ,
credential_type = " password " ,
credential = NonEmptyPasswordCredential (
password = " securepassword123 " ,
username = " user@example.com " ,
totp = " JBSWY3DPEHPK3PXP " ,
) ,
)
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . create_credential (
name = name , credential_type = credential_type , credential = credential , request_options = request_options
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def delete_credential (
self , credential_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > None :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Deletes a specific credential by its ID
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
credential_id : str
The unique identifier of the credential to delete
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
None
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . delete_credential (
credential_id = " cred_1234567890 " ,
2025-05-27 23:38:14 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . delete_credential ( credential_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def get_credential (
self , credential_id : str , * , request_options : typing . Optional [ RequestOptions ] = None
) - > CredentialResponse :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Retrieves a specific credential by its ID
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
credential_id : str
The unique identifier of the credential
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
CredentialResponse
Successful Response
2025-05-27 23:38:14 -07:00
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_credential (
credential_id = " cred_1234567890 " ,
2025-05-27 23:38:14 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_credential ( credential_id , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def login (
2025-05-27 23:38:14 -07:00
self ,
* ,
2025-10-21 14:25:45 -07:00
credential_type : SkyvernSchemasRunBlocksCredentialType ,
url : typing . Optional [ str ] = OMIT ,
webhook_url : typing . Optional [ str ] = OMIT ,
proxy_location : typing . Optional [ ProxyLocation ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
2025-11-21 19:13:42 -07:00
browser_profile_id : typing . Optional [ str ] = OMIT ,
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ] = OMIT ,
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
max_screenshot_scrolling_times : typing . Optional [ int ] = OMIT ,
2025-12-04 10:50:29 -07:00
prompt : typing . Optional [ str ] = OMIT ,
2025-10-21 14:25:45 -07:00
credential_id : typing . Optional [ str ] = OMIT ,
bitwarden_collection_id : typing . Optional [ str ] = OMIT ,
bitwarden_item_id : typing . Optional [ str ] = OMIT ,
onepassword_vault_id : typing . Optional [ str ] = OMIT ,
onepassword_item_id : typing . Optional [ str ] = OMIT ,
azure_vault_name : typing . Optional [ str ] = OMIT ,
azure_vault_username_key : typing . Optional [ str ] = OMIT ,
azure_vault_password_key : typing . Optional [ str ] = OMIT ,
azure_vault_totp_secret_key : typing . Optional [ str ] = OMIT ,
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-10-21 14:25:45 -07:00
) - > WorkflowRunResponse :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Log in to a website using either credential stored in Skyvern , Bitwarden , 1 Password , or Azure Vault
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
credential_type : SkyvernSchemasRunBlocksCredentialType
Where to get the credential from
url : typing . Optional [ str ]
2025-12-04 10:50:29 -07:00
Website URL
2025-10-21 14:25:45 -07:00
webhook_url : typing . Optional [ str ]
2025-12-04 10:50:29 -07:00
Webhook URL to send status updates
2025-10-21 14:25:45 -07:00
proxy_location : typing . Optional [ ProxyLocation ]
Proxy location to use
totp_identifier : typing . Optional [ str ]
Identifier for TOTP ( Time - based One - Time Password ) if required
totp_url : typing . Optional [ str ]
TOTP URL to fetch one - time passwords
browser_session_id : typing . Optional [ str ]
ID of the browser session to use , which is prefixed by ` pbs_ ` e . g . ` pbs_123456 `
2025-11-21 19:13:42 -07:00
browser_profile_id : typing . Optional [ str ]
ID of a browser profile to reuse for this run
2025-10-21 14:25:45 -07:00
browser_address : typing . Optional [ str ]
The CDP address for the task .
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
Additional HTTP headers to include in requests
max_screenshot_scrolling_times : typing . Optional [ int ]
Maximum number of times to scroll for screenshots
2025-12-04 10:50:29 -07:00
prompt : typing . Optional [ str ]
Login instructions . Skyvern has default prompt / instruction for login if this field is not provided .
2025-10-21 14:25:45 -07:00
credential_id : typing . Optional [ str ]
ID of the Skyvern credential to use for login .
bitwarden_collection_id : typing . Optional [ str ]
Bitwarden collection ID . You can find it in the Bitwarden collection URL . e . g . ` https : / / vault . bitwarden . com / vaults / collection_id / items `
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
bitwarden_item_id : typing . Optional [ str ]
Bitwarden item ID
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
onepassword_vault_id : typing . Optional [ str ]
1 Password vault ID
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
onepassword_item_id : typing . Optional [ str ]
1 Password item ID
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
azure_vault_name : typing . Optional [ str ]
Azure Vault Name
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
azure_vault_username_key : typing . Optional [ str ]
Azure Vault username key
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
azure_vault_password_key : typing . Optional [ str ]
Azure Vault password key
azure_vault_totp_secret_key : typing . Optional [ str ]
Azure Vault TOTP secret key
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
WorkflowRunResponse
2025-05-27 23:38:14 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . login (
credential_type = " skyvern " ,
2025-05-27 23:38:14 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . login (
credential_type = credential_type ,
url = url ,
webhook_url = webhook_url ,
proxy_location = proxy_location ,
totp_identifier = totp_identifier ,
totp_url = totp_url ,
browser_session_id = browser_session_id ,
2025-11-21 19:13:42 -07:00
browser_profile_id = browser_profile_id ,
2025-10-27 16:26:37 -06:00
browser_address = browser_address ,
extra_http_headers = extra_http_headers ,
max_screenshot_scrolling_times = max_screenshot_scrolling_times ,
2025-12-04 10:50:29 -07:00
prompt = prompt ,
2025-10-27 16:26:37 -06:00
credential_id = credential_id ,
bitwarden_collection_id = bitwarden_collection_id ,
bitwarden_item_id = bitwarden_item_id ,
onepassword_vault_id = onepassword_vault_id ,
onepassword_item_id = onepassword_item_id ,
azure_vault_name = azure_vault_name ,
azure_vault_username_key = azure_vault_username_key ,
azure_vault_password_key = azure_vault_password_key ,
azure_vault_totp_secret_key = azure_vault_totp_secret_key ,
2025-05-27 23:38:14 -07:00
request_options = request_options ,
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-12-04 13:44:47 -07:00
async def download_files (
2025-12-04 10:50:29 -07:00
self ,
* ,
navigation_goal : str ,
url : typing . Optional [ str ] = OMIT ,
webhook_url : typing . Optional [ str ] = OMIT ,
proxy_location : typing . Optional [ ProxyLocation ] = OMIT ,
totp_identifier : typing . Optional [ str ] = OMIT ,
totp_url : typing . Optional [ str ] = OMIT ,
browser_session_id : typing . Optional [ str ] = OMIT ,
browser_profile_id : typing . Optional [ str ] = OMIT ,
browser_address : typing . Optional [ str ] = OMIT ,
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ] = OMIT ,
max_screenshot_scrolling_times : typing . Optional [ int ] = OMIT ,
download_suffix : typing . Optional [ str ] = OMIT ,
download_timeout : typing . Optional [ float ] = OMIT ,
max_steps_per_run : typing . Optional [ int ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > WorkflowRunResponse :
"""
Download a file from a website by navigating and clicking download buttons
Parameters
- - - - - - - - - -
navigation_goal : str
Instructions for navigating to and downloading the file
url : typing . Optional [ str ]
Website URL
webhook_url : typing . Optional [ str ]
Webhook URL to send status updates
proxy_location : typing . Optional [ ProxyLocation ]
Proxy location to use
totp_identifier : typing . Optional [ str ]
Identifier for TOTP ( Time - based One - Time Password ) if required
totp_url : typing . Optional [ str ]
TOTP URL to fetch one - time passwords
browser_session_id : typing . Optional [ str ]
ID of the browser session to use , which is prefixed by ` pbs_ ` e . g . ` pbs_123456 `
browser_profile_id : typing . Optional [ str ]
ID of a browser profile to reuse for this run
browser_address : typing . Optional [ str ]
The CDP address for the task .
extra_http_headers : typing . Optional [ typing . Dict [ str , typing . Optional [ str ] ] ]
Additional HTTP headers to include in requests
max_screenshot_scrolling_times : typing . Optional [ int ]
Maximum number of times to scroll for screenshots
download_suffix : typing . Optional [ str ]
Suffix or complete filename for the downloaded file
download_timeout : typing . Optional [ float ]
Timeout in seconds for the download operation
max_steps_per_run : typing . Optional [ int ]
Maximum number of steps to execute
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
WorkflowRunResponse
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-12-04 13:44:47 -07:00
await client . download_files (
2025-12-04 10:50:29 -07:00
navigation_goal = " navigation_goal " ,
)
asyncio . run ( main ( ) )
"""
2025-12-04 13:44:47 -07:00
_response = await self . _raw_client . download_files (
2025-12-04 10:50:29 -07:00
navigation_goal = navigation_goal ,
url = url ,
webhook_url = webhook_url ,
proxy_location = proxy_location ,
totp_identifier = totp_identifier ,
totp_url = totp_url ,
browser_session_id = browser_session_id ,
browser_profile_id = browser_profile_id ,
browser_address = browser_address ,
extra_http_headers = extra_http_headers ,
max_screenshot_scrolling_times = max_screenshot_scrolling_times ,
download_suffix = download_suffix ,
download_timeout = download_timeout ,
max_steps_per_run = max_steps_per_run ,
request_options = request_options ,
)
return _response . data
2025-10-21 14:25:45 -07:00
async def get_scripts (
2025-05-27 23:38:14 -07:00
self ,
* ,
page : typing . Optional [ int ] = None ,
page_size : typing . Optional [ int ] = None ,
request_options : typing . Optional [ RequestOptions ] = None ,
2025-10-21 14:25:45 -07:00
) - > typing . List [ Script ] :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Retrieves a paginated list of scripts for the current organization
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
page : typing . Optional [ int ]
Page number for pagination
page_size : typing . Optional [ int ]
Number of items per page
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
typing . List [ Script ]
2025-05-27 23:38:14 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_scripts (
2025-07-15 02:01:23 -07:00
page = 1 ,
page_size = 10 ,
)
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_scripts ( page = page , page_size = page_size , request_options = request_options )
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def create_script (
2025-05-27 23:38:14 -07:00
self ,
* ,
2025-10-21 14:25:45 -07:00
workflow_id : typing . Optional [ str ] = OMIT ,
run_id : typing . Optional [ str ] = OMIT ,
files : typing . Optional [ typing . Sequence [ ScriptFileCreate ] ] = OMIT ,
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-10-21 14:25:45 -07:00
) - > CreateScriptResponse :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Create a new script with optional files and metadata
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
workflow_id : typing . Optional [ str ]
Associated workflow ID
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
run_id : typing . Optional [ str ]
Associated run ID
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
files : typing . Optional [ typing . Sequence [ ScriptFileCreate ] ]
Array of files to include in the script
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
CreateScriptResponse
2025-05-27 23:38:14 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
2025-10-21 14:25:45 -07:00
from skyvern import AsyncSkyvern
2025-05-27 23:38:14 -07:00
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . create_script ( )
2025-05-27 23:38:14 -07:00
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . create_script (
workflow_id = workflow_id , run_id = run_id , files = files , request_options = request_options
2025-05-27 23:38:14 -07:00
)
2025-10-27 16:26:37 -06:00
return _response . data
2025-05-27 23:38:14 -07:00
2025-10-21 14:25:45 -07:00
async def get_script ( self , script_id : str , * , request_options : typing . Optional [ RequestOptions ] = None ) - > Script :
2025-05-27 23:38:14 -07:00
"""
2025-10-21 14:25:45 -07:00
Retrieves a specific script by its ID
2025-05-27 23:38:14 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
script_id : str
The unique identifier of the script
2025-05-27 23:38:14 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
Script
2025-05-27 23:38:14 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . get_script (
script_id = " s_abc123 " ,
2025-05-27 23:38:14 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . get_script ( script_id , request_options = request_options )
return _response . data
2025-07-22 07:21:45 -07:00
2025-10-21 14:25:45 -07:00
async def deploy_script (
2025-07-22 08:25:06 -07:00
self ,
2025-10-21 14:25:45 -07:00
script_id : str ,
2025-07-22 08:25:06 -07:00
* ,
2025-10-21 14:25:45 -07:00
files : typing . Sequence [ ScriptFileCreate ] ,
2025-07-22 08:25:06 -07:00
request_options : typing . Optional [ RequestOptions ] = None ,
2025-10-21 14:25:45 -07:00
) - > CreateScriptResponse :
2025-07-22 07:21:45 -07:00
"""
2025-10-21 14:25:45 -07:00
Deploy a script with updated files , creating a new version
2025-07-22 07:21:45 -07:00
Parameters
- - - - - - - - - -
2025-10-21 14:25:45 -07:00
script_id : str
The unique identifier of the script
2025-07-22 08:25:06 -07:00
2025-10-21 14:25:45 -07:00
files : typing . Sequence [ ScriptFileCreate ]
Array of files to include in the script
2025-07-22 07:21:45 -07:00
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
2025-10-21 14:25:45 -07:00
CreateScriptResponse
2025-07-22 07:21:45 -07:00
Successful Response
Examples
- - - - - - - -
import asyncio
2025-10-21 14:25:45 -07:00
from skyvern import AsyncSkyvern , ScriptFileCreate
2025-07-22 07:21:45 -07:00
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
2025-10-21 14:25:45 -07:00
await client . deploy_script (
script_id = " s_abc123 " ,
files = [
ScriptFileCreate (
path = " src/main.py " ,
content = " content " ,
)
] ,
2025-07-22 07:21:45 -07:00
)
asyncio . run ( main ( ) )
"""
2025-10-27 16:26:37 -06:00
_response = await self . _raw_client . deploy_script ( script_id , files = files , request_options = request_options )
return _response . data
2025-10-29 11:54:57 -06:00
async def run_sdk_action (
self ,
* ,
url : str ,
2025-11-06 11:26:37 -07:00
action : RunSdkActionRequestAction ,
2025-10-29 11:54:57 -06:00
browser_session_id : typing . Optional [ str ] = OMIT ,
browser_address : typing . Optional [ str ] = OMIT ,
workflow_run_id : typing . Optional [ str ] = OMIT ,
request_options : typing . Optional [ RequestOptions ] = None ,
) - > RunSdkActionResponse :
"""
Execute a single SDK action with the specified parameters
Parameters
- - - - - - - - - -
url : str
The URL where the action should be executed
2025-11-06 11:26:37 -07:00
action : RunSdkActionRequestAction
2025-10-29 11:54:57 -06:00
The action to execute with its specific parameters
browser_session_id : typing . Optional [ str ]
The browser session ID
browser_address : typing . Optional [ str ]
The browser address
workflow_run_id : typing . Optional [ str ]
Optional workflow run ID to continue an existing workflow run
request_options : typing . Optional [ RequestOptions ]
Request - specific configuration .
Returns
- - - - - - -
RunSdkActionResponse
2025-11-06 11:26:37 -07:00
Successful Response
2025-10-29 11:54:57 -06:00
Examples
- - - - - - - -
import asyncio
2025-11-06 11:26:37 -07:00
from skyvern import AsyncSkyvern , RunSdkActionRequestAction_AiAct
2025-10-29 11:54:57 -06:00
client = AsyncSkyvern (
api_key = " YOUR_API_KEY " ,
)
async def main ( ) - > None :
await client . run_sdk_action (
url = " url " ,
2025-11-06 11:26:37 -07:00
action = RunSdkActionRequestAction_AiAct ( ) ,
2025-10-29 11:54:57 -06:00
)
asyncio . run ( main ( ) )
"""
_response = await self . _raw_client . run_sdk_action (
url = url ,
action = action ,
browser_session_id = browser_session_id ,
browser_address = browser_address ,
workflow_run_id = workflow_run_id ,
request_options = request_options ,
)
return _response . data
2025-10-27 16:26:37 -06:00
@property
def scripts ( self ) :
if self . _scripts is None :
from . scripts . client import AsyncScriptsClient # noqa: E402
self . _scripts = AsyncScriptsClient ( client_wrapper = self . _client_wrapper )
return self . _scripts
2025-02-19 00:58:48 +08:00
def _get_base_url ( * , base_url : typing . Optional [ str ] = None , environment : SkyvernEnvironment ) - > str :
if base_url is not None :
return base_url
2025-06-05 07:01:46 -07:00
elif environment is not None :
2025-02-19 00:58:48 +08:00
return environment . value
2025-06-05 07:01:46 -07:00
else :
raise Exception ( " Please pass in either base_url or environment to construct the client " )