Skip to main content
Create a new workflow from a JSON or YAML definition.

Retry policy

Add retry_policy inside workflow_definition to retry eligible top-level runs. Omit the field, or set it to null, to disable retries. A rule matches when the run status matches and any listed error code matches. Omit error_codes, or use an empty list, to match any error code for that status. Rules use OR logic. Canceled runs never retry in the current runtime, including explicit API/UI cancels. The policy applies only to top-level runs. Each retry keeps the same workflow_run_id. Each attempt uses credits. The maximum elapsed time limit resets for each attempt, so the total run duration can exceed that limit.

Parameters

You must provide either json_definition or yaml_definition.

Returns Workflow


Request options

Override timeout, retries, or headers for this call by passing request_options (Python) or a second options argument (TypeScript).