Skip to main content
Human-in-the-Loop (HITL) in Workflows enables you to pause execution at any step to collect user confirmation, input, or decisions. The workflow state is persisted, allowing you to resume execution after the user responds.
User input is currently supported for Step (to collect parameters) and Router (to select routes). Other primitives (Condition, Loop, Steps) support confirmation only.
Agent tool-level HITL (e.g., @tool(requires_confirmation=True)) is not propagated to the workflow. If an agent inside a step has tool-level HITL, the workflow will continue but the paused tool may not execute. Use workflow-level HITL instead.

Requirements

HITL workflows require a database to persist state between pauses:

HumanReview Config

All HITL settings are grouped into a single HumanReview object:
Flat parameters (requires_confirmation=True, confirmation_message="...") still work for backward compatibility. See the HumanReview Config page for all fields and validation rules.

HITL Types

Supported Primitives

Run Output Properties

When a workflow pauses, check these properties on WorkflowRunOutput:

Confirmation

Pause before executing a step. User confirms to proceed or rejects to skip/cancel.
Handle in your code:

User Input

Collect parameters from the user before step execution.
Handle in your code:
User input is available in the custom function step via step_input.additional_data["user_input"].

Output Review

Pause after a step executes so the user can review the output. Supported on Step and Router. See the dedicated Output Review page for full details.
When rejected with on_reject=OnReject.retry, the step re-executes up to max_retries times. Pair with reject(feedback=...) to send feedback to the agent.

Iteration Review

Pause after each loop iteration for review. Supported on Loop only.

Route Selection

Let users choose which path(s) a Router executes.
Handle in your code:

Error Handling

Pause when a step fails, letting the user retry or skip. This is only at the Step level.
Handle in your code:

OnReject Behavior

The on_reject parameter controls what happens when a user rejects a step:

Timeout

Set a timeout for HITL pauses. If the user does not respond in time, on_timeout determines the action. See the dedicated Timeout page for full details.

Streaming

HITL works with streaming workflows. Check for pauses in the event stream:

The @pause Decorator

Mark custom function steps with HITL configuration using the @pause decorator:

Guides

HumanReview Config

All HITL settings in a single config object

Step HITL

Confirmation, user input, and output review on steps

Output Review

Review, edit, or reject output after step execution

Router HITL

Route selection, confirmation, and output review

Condition HITL

User-controlled branching decisions

Loop HITL

Start confirmation and per-iteration review

Steps HITL

Confirm before executing a pipeline

Timeout

Auto-resolve HITL pauses after a deadline

Error Handling

Retry or skip failed steps

Developer Resources