Step and Condition can pause when execution fails, letting users decide to retry or skip the failed component.
Error Pause Mode
Seton_error=OnError.pause to pause when a step fails:
Step retries executor failures up to max_retries times before applying on_error. The default, max_retries=3, allows four total execution attempts. Set max_retries=0 to apply the error policy after the first failed attempt.
OnError Options
ErrorRequirement Properties
When aStep or Condition fails with on_error=OnError.pause, an ErrorRequirement is created:
ErrorRequirement Methods
Retry Behavior
When you callreq.retry():
- The component executes again with the same input, including its configured automatic retries.
- If it still fails, the workflow pauses again.
- You can retry again or skip.
Skip Behavior
When you callreq.skip():
- The failed component is not re-executed.
- The workflow continues with the next top-level step.
- The next step’s
step_input.previous_step_contentcomes from the last successful top-level step, or isNoneif there is none.
Combining with Confirmation
A step can have both error handling and confirmation:Condition Errors
Seton_error on a Condition to control failures raised by its selected branch. OnError.pause creates an ErrorRequirement for the Condition after the failing inner Step exhausts its own max_retries.