Skip to main content
Loops support two HITL modes: start confirmation (pause before the first iteration) and iteration review (pause between iterations for human feedback). All HITL settings are configured via HumanReview.

Start Confirmation

When requires_confirmation=True, the loop pauses before executing:
  • Confirm: Execute the loop iterations
  • Reject: Skip the entire loop

Parameters

Loop Behavior

The confirmation happens once before the loop starts. Individual iterations do not pause for confirmation. For per-iteration pauses, see Iteration Review.

Iteration Review

Set requires_iteration_review=True to pause between loop iterations. After each iteration completes, the workflow pauses for human review. The reviewer can accept the result (stopping the loop) or reject to run another iteration.

Iteration Review Parameters

Iteration Review Behavior

Iteration review requirements appear in run_output.steps_requiring_output_review, the same property used for step output review.
requires_iteration_review is only supported on Loop. Passing it to Step or Router raises a ValueError.

With end_condition

The end_condition function receives the current iteration’s outputs and returns True to stop the loop. Confirmation happens before any iteration:

Timeout

timeout and on_timeout only apply to Step-level pauses. Loop pauses (the start confirmation and iteration review) wait until they are resolved. See Timeout.

Streaming

Handle loop HITL in streaming workflows:

Developer Resources