Skip to main content
HITL timeouts set a deadline for human responses. When the timeout expires, the workflow auto-resolves the pending requirement based on the on_timeout policy.
from agno.workflow import Workflow
from agno.workflow.step import Step
from agno.workflow.types import OnTimeout
from agno.db.sqlite import SqliteDb

workflow = Workflow(
    name="timeout_workflow",
    db=SqliteDb(db_file="workflow.db"),
    steps=[
        Step(
            name="draft_email",
            agent=draft_agent,
            requires_output_review=True,
            output_review_message="Review the draft (auto-approves in 5 minutes)",
            hitl_timeout=300,
            on_timeout=OnTimeout.approve,
        ),
        Step(name="send_email", agent=send_agent),
    ],
)
Timeout is checked at continue_run() time. There is no background timer. If the timeout has elapsed when continue_run() is called, the requirement is auto-resolved.

Parameters

ParameterTypeDefaultDescription
hitl_timeoutintNoneSeconds before auto-resolving. None = no timeout
on_timeoutOnTimeoutNoneAction when timeout expires

OnTimeout Options

ValueBehavior
OnTimeout.approveAuto-confirm the output
OnTimeout.skipSkip the step
OnTimeout.cancelCancel the workflow

Timeout Flow

run_output = workflow.run("Draft an email about the team lunch")

if run_output.is_paused:
    for req in run_output.steps_requiring_output_review:
        print(f"Draft: {req.step_output.content}")
        print(f"Timeout at: {req.timeout_at}")
        print(f"On timeout: {req.on_timeout}")

    # If called after timeout expires, auto-resolves based on on_timeout
    run_output = workflow.continue_run(run_output)
The timeout_at datetime is available on the StepRequirement for frontend countdown display.

With Output Review

Timeout is most useful with output review. If a reviewer doesn’t respond in time, the workflow proceeds automatically.
Step(
    name="generate_report",
    agent=report_agent,
    requires_output_review=True,
    output_review_message="Review the report",
    hitl_timeout=600,           # 10 minutes
    on_timeout=OnTimeout.approve,  # Auto-approve after 10 minutes
)

With Confirmation

Timeout also works with pre-execution confirmation:
Step(
    name="deploy",
    agent=deploy_agent,
    requires_confirmation=True,
    confirmation_message="Deploy to production?",
    hitl_timeout=120,            # 2 minutes
    on_timeout=OnTimeout.cancel,  # Cancel if no response
)

Choosing an OnTimeout Policy

PolicyUse When
approveOutput is low-risk and delays are costly. The step’s output is likely acceptable
skipThe step is optional. Skipping doesn’t break the workflow
cancelThe step is critical. Proceeding without review is unacceptable

Developer Resources