HumanReview groups all HITL settings into a single object instead of passing them as separate parameters. All workflow primitives accept human_review=HumanReview(...): Step, Loop, Router, Condition, Steps, and Parallel.
human_review and flat parameters are provided, human_review takes priority.
All Fields
| Field | Type | Default | Description |
|---|---|---|---|
requires_confirmation | bool | False | Pause for user confirmation before execution |
confirmation_message | str | None | Message shown during confirmation |
requires_user_input | bool | False | Pause to collect user input before execution |
user_input_message | str | None | Message shown when collecting input |
user_input_schema | List[UserInputField] | None | Schema defining expected input fields |
requires_output_review | bool | False | Pause after execution for output review |
output_review_message | str | None | Message shown during output review |
requires_iteration_review | bool | False | Pause after each loop iteration for review |
iteration_review_message | str | None | Message shown during iteration review |
on_reject | OnReject | OnReject.skip | Action when user rejects |
on_error | OnError | None | Action when step errors |
max_retries | int | 3 | Max retries on rejection (when on_reject=OnReject.retry) |
timeout | int | None | Seconds to wait for user response |
on_timeout | OnTimeout | None | Action when timeout expires |
Supported Fields by Component
Not every field works on every component. Passing an unsupported field raises aValueError at construction time.
| Field | Step | Loop | Router | Condition | Steps | Parallel |
|---|---|---|---|---|---|---|
requires_confirmation | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
requires_user_input | ✓ | - | ✓ | - | - | - |
requires_output_review | ✓ | - | ✓ | - | - | - |
requires_iteration_review | - | ✓ | - | - | - | - |
on_reject | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
on_error | ✓ | - | - | - | - | - |
max_retries | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
timeout | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
on_timeout | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
requires_confirmation. Passing unsupported fields raises a clear error:
Validation Rules
requires_output_reviewandrequires_iteration_reviewcannot both beTruein the same config.- Each component validates at construction time. You get a clear error if a field is unsupported.
HITL Modes
Pre-execution: Confirmation
Pause before a step runs. The user approves or rejects.Pre-execution: User Input
Collect parameters from the user before execution.Post-execution: Output Review
Pause after a step completes so the user can review the output. Supported on Step and Router.Per-iteration: Iteration Review
Pause after each loop iteration for review. Supported on Loop only.Timeout
Set a timeout for how long to wait for a user response. If the timeout expires,on_timeout determines what happens.
OnTimeout Value | Behavior |
|---|---|
OnTimeout.approve | Automatically approve and continue |
OnTimeout.reject | Automatically reject |
OnTimeout.cancel | Cancel the workflow |
Serialization
HumanReview serializes to a single "human_review" key in the workflow state. Deserialization reads "human_review" first, then falls back to flat keys for backward compatibility with existing persisted data.