Skip to main content
Steps can pause when they encounter errors, letting users decide to retry or skip the failed step.

Error Pause Mode

Set on_error=OnError.pause to pause when a step fails:

OnError Options

ErrorRequirement Properties

When a step fails with on_error=OnError.pause, an ErrorRequirement is created:

ErrorRequirement Methods

Retry Behavior

When you call req.retry():
  1. The step executes again with the same input
  2. retry_count increments
  3. If it fails again, the workflow pauses again
  4. You can retry indefinitely or skip after some attempts

Skip Behavior

When you call req.skip():
  1. The step is marked as skipped (not failed)
  2. The workflow continues with the next step
  3. step_input.previous_step_content will be None for the next step

Combining with Confirmation

A step can have both error handling and confirmation:
The confirmation happens first. If confirmed and the step fails, the error pause activates.

Streaming

Handle error HITL in streaming workflows:

Error Types

Common error scenarios and handling:

Developer Resources