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. If it fails again, the workflow pauses again
  3. You can retry indefinitely or skip after some attempts
Track attempts in your resolution loop to cap retries:

Skip Behavior

When you call req.skip():
  1. The failed step produces no output and is not re-executed
  2. The workflow continues with the next step
  3. The next step’s step_input.previous_step_content comes from the last successful step, or is None if there is none

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