Skip to main content
Real-time interaction lets users shape agent behavior as it happens. This capability is critical in high-stakes, safety-sensitive, or creative workflows where user intent can change quickly. Whether refining a draft, validating a medical suggestion, or steering a research assistant, immediate feedback improves trust, engagement, and final output quality. Human-in-the-loop (HITL) treats the user as an active collaborator throughout the workflow — not only at the start or finish. In LangGraph, that can mean pausing execution for approval, waiting for clarifying input, or asking for an edit before continuing. The runtime supports conditional edges, streaming interfaces, and custom input gates so agents and humans can collaborate in real time.
The image is a flowchart illustrating the "Human-in-the-Loop" (HILT) process, showing how tasks are managed with human intervention for clarification and approval.
Use case metaphor: imagine Ravi delivering a package. He knocks and waits. The recipient instructs, “Leave it by the garage.” Ravi adapts in real time. Similarly, LangGraph workflows can pause and accept instructions from users mid-execution. Common real-time HITL patterns
  • Pause nodes that wait for user confirmation, edits, or approvals.
  • Streaming tokens that reveal generation as it happens so users can react mid-stream.
  • Escape hatches to cancel, reroute, or change execution flow.
The image outlines "Real-Time Feedback Patterns," featuring a circular diagram with sections on pause nodes for user interaction, streaming tokens for mid-generation response, and escape hatches for execution control.
Pausing execution for human input LangGraph’s runtime provides an interrupt mechanism to pause a graph, persist state, surface a payload to an external UI or API, and then resume once the human responds. The payload displayed to the user can include a question, editable text, or UI controls. When the human replies, the runtime resumes the same node and returns the response as the result of the interrupt call. Example: a simple interrupt node in Python
How it works
  • Hitting interrupt stops graph execution and persists the current node’s state.
  • The runtime surfaces the interrupt payload to the UI or API.
  • When the human responds, the graph resumes from the same node and the interrupt call returns the human response.
  • Use cases: clarification requests, manual approvals, content edits, or safety checks.
Streaming model responses Most LLM calls return a complete response after generation finishes. Streaming changes that: the model emits tokens incrementally, which reduces perceived latency and enables mid-generation interactions (like cancelling or adjusting prompts). Streaming is especially valuable for long outputs or interactive scenarios. Example: enabling streaming with a typing-effect and accumulating the final answer
Why streaming matters
  • Users see progress as it happens instead of waiting for the full reply.
  • Long responses feel faster and more interactive.
  • Enables mid-generation interaction: users can interrupt, accept partial results, or steer the completion.
Collecting and recording user feedback Feedback gathered during a LangGraph workflow can be treated as regular state and persisted for analytics, fine-tuning, or adaptive behavior. Use the same interrupt pattern to ask for feedback and then log or process it downstream. Example: collect feedback then log it
Design best practices for human-in-the-loop interfaces
  • Set clear expectations: show when and why a user will be asked to act.
  • Keep interactions focused: present one decision or edit at a time.
  • Offer undo and retry flows so users can explore alternatives safely.
  • Surface enough context for users to make informed decisions (previous messages, provenance, or rationale).
  • Log interactions and metadata for auditing, analytics, and model improvement.
The image showcases three best practices for real-time user experience: setting clear expectations, avoiding overwhelming users with options, and allowing undo and retry flows. Each point is accompanied by an icon and a brief description.
When designing human-in-the-loop steps, avoid surprising users. Explain what control they have, what will happen next, and how they can undo or retry actions.
Conclusion Human-in-the-loop is a deliberate collaboration strategy, not a fallback. By combining pause points, streaming, escape hatches, and feedback collection, LangGraph enables interactive workflows where humans actively correct, guide, and validate agent behavior. These primitives help teams build safer, more transparent, and more effective AI-powered experiences. Links and references

Watch Video