Skip to main content
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.

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)