Skip to content

Skyvern: Retry a run

Skyvern runs.retryWorkflowRun: arguments, response, policy and SDK examples.

← Runs operations · Get started

Operation skyvern.retry_workflow_run_v1_workflows_runs_workflow_run_id_retry_post

Provider route: POST /v1/agents/runs/{workflow_run_id}/retry. Alter supplies the connection’s credentials and routing.

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

import { App } from "@alter-ai/sdk";
import { SkyvernIntegration } from "@alter-ai/skyvern";
async function execute(input: Parameters<SkyvernIntegration["runs"]["retryWorkflowRun"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new SkyvernIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.runs.retryWorkflowRun(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_skyvern import SkyvernIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SkyvernIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.runs.retry_workflow_run(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.workflow_run_idstringRequired within parentThe id of the workflow run to retry.
headersobjectOptionalAdditional keys: not allowed
headers.x-max-steps-overrideJSONOptional
headers.x-max-steps-override (anyOf 1)integerAlternative
headers.x-max-steps-override (anyOf 2)nullAlternative
headers.x-user-agentJSONOptional
headers.x-user-agent (anyOf 1)stringAlternative
headers.x-user-agent (anyOf 2)nullAlternative

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Login Task — response body

Referenced models: Login Task — response body

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

Login Task — response body
FieldTypePresenceDescription and constraints
$objectRoot
ai_fallbackJSONOptionalWhether to fallback to AI if code run fails.
ai_fallback (anyOf 1)booleanAlternative
ai_fallback (anyOf 2)nullAlternative
app_urlJSONOptionalURL to the application UI where the run can be viewed
app_url (anyOf 1)stringAlternative
app_url (anyOf 2)nullAlternative
attemptJSONOptional
attempt (anyOf 1)integerAlternativeOne-based number of the current workflow run attempt
Default: 1
attempt (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
attemptsarrayOptionalAttempts recorded for this workflow run
attempts[]ModelEach itemExpand Login Task — response body — attempts item
browser_profile_idJSONOptionalID of the browser profile used for this run
browser_profile_id (anyOf 1)stringAlternative
browser_profile_id (anyOf 2)nullAlternative
browser_seed_sourceJSONOptionalWhich layer of the seed-precedence chain seeded this run's browser (provenance).
browser_seed_source (anyOf 1)ModelAlternativeExpand Login Task — response body — browser seed source string
browser_seed_source (anyOf 2)nullAlternative
browser_session_idJSONOptionalID of the Skyvern persistent browser session used for this run
browser_session_id (anyOf 1)stringAlternative
browser_session_id (anyOf 2)nullAlternative
browser_settings_receiptJSONOptionalThe timezone the run's browser reported against the one its workflow version requested. Null when the version requests no browser settings or the browser has not been measured yet.
browser_settings_receipt (anyOf 1)ModelAlternativeExpand Login Task — response body — browser_settings_receipt / source: workflow version, session request, existing session, status: verified, mismatch, unapplied, unknown
browser_settings_receipt (anyOf 2)nullAlternative
created_atstringRequired within parentTimestamp when this run was created
Format: date-time
downloaded_filesJSONOptionalList of files downloaded during the run
downloaded_files (anyOf 1)arrayAlternative
downloaded_files (anyOf 1)[]ModelEach itemExpand Get a session — response body — recordings array item
downloaded_files (anyOf 2)nullAlternative
errorsJSONOptionalThe errors for the run
errors (anyOf 1)arrayAlternative
errors (anyOf 1)[]objectEach itemAdditional keys: allowed
errors (anyOf 2)nullAlternative
failure_reasonJSONOptionalReason for failure if the run failed or terminated
failure_reason (anyOf 1)stringAlternative
failure_reason (anyOf 2)nullAlternative
finished_atJSONOptionalTimestamp when this run finished
finished_at (anyOf 1)stringAlternativeFormat: date-time
finished_at (anyOf 2)nullAlternative
max_screenshot_scrollsJSONOptionalThe maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot
max_screenshot_scrolls (anyOf 1)JSONAlternative
max_screenshot_scrolls (anyOf 1) (anyOf 1)integerAlternative
max_screenshot_scrolls (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
max_screenshot_scrolls (anyOf 2)nullAlternative
modified_atstringRequired within parentTimestamp when this run was last modified
Format: date-time
next_attempt_atJSONOptionalTimestamp when the next workflow run attempt is scheduled
next_attempt_at (anyOf 1)stringAlternativeFormat: date-time
next_attempt_at (anyOf 2)nullAlternative
outputJSONOptionalOutput data from the run, if any. Format/schema depends on the data extracted by the run.
output (anyOf 1)objectAlternativeAdditional keys: allowed
output (anyOf 2)arrayAlternative
output (anyOf 2)[]JSONEach item
output (anyOf 3)stringAlternative
output (anyOf 4)nullAlternative
queued_atJSONOptionalTimestamp when this run was queued
queued_at (anyOf 1)stringAlternativeFormat: date-time
queued_at (anyOf 2)nullAlternative
recording_archivedbooleanOptionalTrue when the recording exists but has been archived to cold storage and is not currently accessible.
Default: false
recording_urlJSONOptionalURL to the recording of the run
recording_url (anyOf 1)stringAlternative
recording_url (anyOf 2)nullAlternative
retry_pendingbooleanOptionalWhether another attempt is scheduled for this workflow run
Default: false
run_idstringRequired within parentUnique identifier for this run. Run ID starts with `tsk_` for task runs and `wr_` for workflow runs.
run_requestJSONOptionalThe original request parameters used to start this workflow run
run_request (anyOf 1)ModelAlternativeExpand Login Task — response body — run request ai fallback, browser address, browser profile id, browser session id, browser type, cdp connect headers, extra http headers, file ids, max elapsed time minutes, max screenshot scrolls, parameters, proxy location, reuse browser session, run metadata, run with, start fresh browser, title, totp identifier, totp url, webhook url, workflow id
run_request (anyOf 2)nullAlternative
run_typestringRequired within parentType of run - always workflow_run for workflow runs
Must equal: workflow_run
run_withstringOptionalWhether the workflow run was executed with agent or code
Default: agent
screenshot_urlsJSONOptionalList of last n screenshot URLs in reverse chronological order - the first one the list is the latest screenshot.
screenshot_urls (anyOf 1)arrayAlternative
screenshot_urls (anyOf 1)[]stringEach item
screenshot_urls (anyOf 2)nullAlternative
script_idJSONOptionalID of the cached script used for this workflow run, if any.
script_id (anyOf 1)stringAlternative
script_id (anyOf 2)nullAlternative
script_runJSONOptionalThe script run result
script_run (anyOf 1)ModelAlternativeExpand Login Task — response body — script run ai fallback triggered, script id, script revision id
script_run (anyOf 2)nullAlternative
started_atJSONOptionalTimestamp when this run started execution
started_at (anyOf 1)stringAlternativeFormat: date-time
started_at (anyOf 2)nullAlternative
statusstringRequired within parentCurrent status of the run
Known values: created, queued, running, paused, timed_out, failed, terminated, completed, canceled
step_countJSONOptionalTotal number of steps executed in this run
step_count (anyOf 1)JSONAlternative
step_count (anyOf 1) (anyOf 1)integerAlternative
step_count (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
step_count (anyOf 2)nullAlternative

Referenced models: Login Task — response body — browser seed source string, Login Task — response body — browser_settings_receipt / source: workflow version, session request, existing session, status: verified, mismatch, unapplied, unknown, Get a session — response body — recordings array item, Login Task — response body — script run ai fallback triggered, script id, script revision id, Login Task — response body — attempts item, Login Task — response body — run request ai fallback, browser address, browser profile id, browser session id, browser type, cdp connect headers, extra http headers, file ids, max elapsed time minutes, max screenshot scrolls, parameters, proxy location, reuse browser session, run metadata, run with, start fresh browser, title, totp identifier, totp url, webhook url, workflow id

Login Task — response body — browser seed source string
FieldTypePresenceDescription and constraints
$stringRootWhich layer of the seed-precedence chain seeded a run's browser (provenance).

Resolved once at run setup, before any browser creation, for all run types (C-semantics).
- override: explicit request browser_profile_id (one-run-only pick via API)
- picked: the workflow's explicit profile pick (workflows.browser_profile_id) — "always start here"
- own_memory: the workflow's own auto-profile (no pick + persist_browser_session)
- credential: the run's selected credential's profile (rotation-aware; also the empty-own boot)
- fresh: no seed profile
- degraded_fresh: a resolved profile failed to load; ran fresh
Known values: override, picked, own_memory, credential, fresh, degraded_fresh
Login Task — response body — script run ai fallback triggered, script id, script revision id
FieldTypePresenceDescription and constraints
$objectRoot
ai_fallback_triggeredbooleanOptionalDefault: false
script_idJSONOptional
script_id (anyOf 1)stringAlternative
script_id (anyOf 2)nullAlternative
script_revision_idJSONOptional
script_revision_id (anyOf 1)stringAlternative
script_revision_id (anyOf 2)nullAlternative

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

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

Official provider source

Report an issue with this page

Necessary

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

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

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

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