- Pause 1 (step-level): user sees
confirmation_message, callsreq.confirm(). - Pause 2 (executor-level): agent calls
send_alert, user approves the specific tool call. - Step finishes.
The Active-Requirement Pattern
step_requirements accumulates across pauses within a single run. The first pause adds the step-level requirement. After resolution and continue, a second pause adds the executor-level requirement on top of it. To detect the current pause type, always look at the last entry.
Resolution Loop
Wrap continue calls in awhile is_paused: loop. Each pause resolves one gate; the workflow either pauses again or completes.
Cookbooks
Runnable examples in cookbook/04_workflows/08_human_in_the_loop/dual_level_hitl/:| File | Step-Level Gate | Executor-Level Gate |
|---|---|---|
01_step_confirmation_and_tool_confirmation.py | Step confirmation | Tool confirmation |
02_step_user_input_and_tool_confirmation.py | Step user input | Tool confirmation |
03_condition_and_tool_confirmation.py | Condition confirmation | Tool confirmation |
04_router_selection_and_tool_confirmation.py | Router route selection | Tool confirmation |
05_output_review_and_tool_confirmation.py | Step output review | Tool confirmation |
06_loop_confirmation_and_tool_confirmation.py | Loop start confirmation | Tool confirmation |
07_router_confirmation_and_tool_confirmation.py | Router confirmation | Tool confirmation |
09_multi_step_mixed_hitl.py | Multiple steps with mixed gates | Tool confirmation |