Skip to main content
Update an existing workflow’s definition.
updated = await client.update_workflow(
    "wpid_abc123",
    json_definition={
        "title": "Extract Products",
        "workflow_definition": {
            "blocks": [
                {
                    "block_type": "task",
                    "label": "extract_data",
                    "prompt": "Extract the top 5 products",
                    "url": "https://example.com/products",
                }
            ],
            "parameters": [],
        },
    },
)
print(f"Updated to v{updated.version}")

Parameters

ParameterTypeRequiredDescription
workflow_idstrYesThe workflow’s permanent ID (wpid_...).
json_definitionWorkflowCreateYamlRequestNoUpdated definition as a JSON object.
yaml_definitionstrNoUpdated definition as a YAML string.
request_optionsRequestOptionsNoPer-request configuration (see below).

Returns Workflow

Creates a new version of the workflow.

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.