Skip to main content
A workflow chains multiple steps (blocks) into a single automation. Workflows support loops, conditionals, data passing between steps, and code-based re-execution. For conceptual background, see Build a Workflow.
Python uses snake_case (e.g., run_workflow); TypeScript uses camelCase (e.g., runWorkflow) and wraps request params in a body object. Parameter tables show Python names. TypeScript names are the camelCase equivalents.
Execute a workflow by its permanent ID. Skyvern opens a cloud browser and runs each block in sequence.
result = await client.run_workflow(
    workflow_id="wpid_abc123",
    wait_for_completion=True,
)
print(result.output)

Parameters

ParameterTypeRequiredDefaultDescription
workflow_idstrYes-The workflow’s permanent ID (wpid_...).
parametersdictNoNoneInput parameters defined in the workflow. Keys must match parameter names.
wait_for_completionboolNoFalseBlock until the workflow finishes.
timeoutfloatNo1800Max wait time in seconds when wait_for_completion=True.
run_withstrNoNoneForce execution mode: "code" (use cached Playwright code) or "agent" (use AI).
ai_fallbackboolNoNoneFall back to AI if the cached code fails.
browser_session_idstrNoNoneRun inside an existing browser session.
browser_profile_idstrNoNoneLoad a browser profile (cookies, storage) into the session.
proxy_locationProxyLocationNoNoneRoute the browser through a geographic proxy.
max_steps_overrideintNoNoneCap total AI steps across all blocks.
webhook_urlstrNoNoneURL to receive a POST when the run finishes.
titlestrNoNoneDisplay name for this run in the dashboard.
totp_identifierstrNoNoneIdentifier for TOTP verification.
totp_urlstrNoNoneURL to receive TOTP codes.
templateboolNoNoneRun a template workflow.
user_agentstrNoNoneCustom User-Agent header for the browser.
extra_http_headersdict[str, str]NoNoneAdditional HTTP headers injected into every browser request.
max_screenshot_scrollsintNoNoneNumber of scrolls for post-action screenshots.
browser_addressstrNoNoneConnect to a browser at this CDP address.
request_optionsRequestOptionsNo-Per-request configuration (see below).

Returns WorkflowRunResponse

FieldTypeDescription
run_idstrUnique identifier. Starts with wr_ for workflow runs.
statusstrcreated, queued, running, completed, failed, terminated, timed_out, or canceled.
outputdict | NoneExtracted data from the workflow’s output block.
downloaded_fileslist[FileInfo] | NoneFiles downloaded during the run.
recording_urlstr | NoneURL to the session recording.
failure_reasonstr | NoneError description if the run failed.
app_urlstr | NoneLink to view this run in the Cloud UI.
step_countint | NoneTotal AI steps taken across all blocks.
run_withstr | NoneWhether the run used "code" or "agent".
ai_fallbackbool | NoneWhether AI fallback was configured.
script_runScriptRunResponse | NoneCode execution result. Contains ai_fallback_triggered if code was used.

Examples

Pass parameters to a workflow:
result = await client.run_workflow(
    workflow_id="wpid_invoice_extraction",
    parameters={
        "company_name": "Acme Corp",
        "date_range": "2025-01-01 to 2025-12-31",
    },
    wait_for_completion=True,
)
Run with cached code (skip AI, use generated Playwright scripts):
result = await client.run_workflow(
    workflow_id="wpid_daily_report",
    run_with="code",
    ai_fallback=True,  # Fall back to AI if code fails
    wait_for_completion=True,
)
Run with a browser profile (skip login):
result = await client.run_workflow(
    workflow_id="wpid_daily_report",
    browser_profile_id="bpf_abc123",
    wait_for_completion=True,
)

Request options

Override timeout, retries, or headers for this call by passing request_options (Python) or a second options argument (TypeScript).
from skyvern.client.core import RequestOptions

request_options=RequestOptions(
    timeout_in_seconds=120,
    max_retries=3,
    additional_headers={"x-custom-header": "value"},
)
Option (Python)Option (TypeScript)TypeDescription
timeout_in_secondstimeoutInSecondsint / numberHTTP timeout in seconds.
max_retriesmaxRetriesint / numberRetry count.
additional_headersheadersdict / Record<string, string>Extra headers.
additional_query_parameters-dictExtra query parameters.
additional_body_parameters-dictExtra body parameters.
-abortSignalAbortSignalSignal to cancel the request.
-apiKeystringOverride API key.