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 (Step.requires_confirmation) instead.

Requirements

HITL workflows require a database to persist state between pauses:

HITL Types

Supported Primitives

HITL is supported on all workflow 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"].

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:

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

Step HITL

Confirmation and user input on individual steps

Router HITL

User-driven route selection and confirmation

Condition HITL

User-controlled branching decisions

Loop HITL

Confirm before starting iterative execution

Steps HITL

Confirm before executing a pipeline

Error Handling

Retry or skip failed steps

Developer Resources