> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsonic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Human-in-the-Loop (HITL)

> Control, pause, and resume agent executions with human oversight

Human-in-the-Loop (HITL) enables you to maintain control over agent executions. Pause runs for external processing, recover from errors, or cancel and resume operations as needed.

<CardGroup cols={3}>
  <Card title="Cancel Run" icon="stop" href="/concepts/hitl/cancel-run">
    Cancel running agent executions and resume from the cut-off point.
  </Card>

  <Card title="Durable Execution" icon="rotate" href="/concepts/hitl/durable-execution">
    Automatic recovery from errors with state persistence across restarts.
  </Card>

  <Card title="External Tool Execution" icon="plug" href="/concepts/hitl/external-tool-execution">
    Pause agents for external tool processing and resume with results.
  </Card>

  <Card title="User Confirmation" icon="check-circle" href="/concepts/hitl/user-confirmation">
    Pause for user approval or rejection of tool calls, then resume.
  </Card>

  <Card title="User Input" icon="edit" href="/concepts/hitl/user-input">
    Pause for user-provided field values, then resume with filled inputs.
  </Card>

  <Card title="Dynamic User Input" icon="rectangle-list" href="/concepts/hitl/dynamic-user-input">
    Let the agent request user-provided fields at runtime via get\_user\_input.
  </Card>
</CardGroup>

## Key Concepts

### Run Identification

Every agent execution has a unique `run_id` that enables:

* State persistence across process restarts
* Cross-process resumption with new agent instances
* Tracking and debugging of execution flows

### Continuation Methods

Use `continue_run_async()` to resume paused or errored runs:

* **By `run_id`**: Load state from persistent storage (cross-process safe)
* **By `task`**: Use in-memory context (same-process continuation)

### Important Notes

* HITL continuation (`continue_run_async`) only supports **direct call mode**
* Streaming mode is not supported for continuation
* For cross-process resumption, always use persistent storage (e.g., `SqliteDatabase`)
