Building an AI agent that can reason and act is one thing; building one that doesn't crash when a human takes three days to click 'approve' is another entirely.
The Simple Version
Imagine you are running a high-speed pizza delivery service. Most of your processes are automated: the oven heats up, the dough rises, and the driver grabs the box in seconds.
But suddenly, a customer calls to change their toppings. If your entire kitchen staff freezes and stops working just because they are waiting for that one customer to decide between pepperoni or mushrooms, your business collapses.
In AI agent development, we often treat "asking a human" as a simple function call. However, as Melanie Warrick explains, humans don't respond in 200 milliseconds. If your agent's code is literally "waiting" on a single thread for a human, a simple server restart or a network hiccup can cause the agent to lose its memory and fail the entire task.
How It Actually Works
The Agent Harness and Durability
When we talk about an "agent harness," we are talking about the infrastructure that surrounds the LLM to make it production-ready. This includes memory, tools, guardrails, and—most importantly—durability.
Durability means that if the power goes out or the server reboots, the agent knows exactly where it left off. Without this, an agent performing a multi-step task (like coordinating an ice cream delivery) might forget it already checked the inventory just because it was waiting for a dispatch signal.
The Three Primitives of Temporal
To achieve this durability, Temporal provides three core building blocks that structure how code is executed:
- Workers: The processes that actually run your code.
- Workflows: The orchestration layer that keeps track of the steps and the overall state of the system.
- Activities: The individual tasks that interact with the outside world, such as making a model call to GPT-4 or using a Google Maps tool.
Technical Deep Dive
The technical breakthrough in handling human interaction lies in moving away from blocking calls and moving toward asynchronous primitives. In a standard programming model, a function waits for a return value. In an agentic workflow, this is dangerous because it holds resources hostage.
Wait Conditions and Signals
As Warrick demonstrates, the correct way to implement "Human-in-the-loop" is through two specific mechanisms: wait conditions and signals.
Instead of a function that says result = ask_human(), you implement a workflow that hits a wait_condition. This tells the Temporal engine: "Pause this specific workflow, save its entire state to the database, and release the worker to do other tasks." The workflow is now parked.
When the human finally responds, they trigger a signal. This signal is an external event injected into the running workflow. As Warrick notes, "The workflow will be taken off of your memory or taken off of your system and put in parked if it's not running anything at that point." Once the signal arrives, the workflow resumes exactly where it left off.
Integration with LangGraph and Google ADK
In the demonstration, this is applied to a multi-agent system using Google ADK for fleet and customer agents, and LangGraph for the dispatch agent. In a LangGraph setup, the interrupt function is used to signal that the graph needs human input. This interrupt is then mapped to a Temporal wait condition.
This architecture allows for deterministic workflows and non-deterministic activities. The logic of the agent (the workflow) is deterministic and can be replayed to recover state, while the actual LLM calls (the activities) are non-deterministic and handled separately. This is why, in the demo, when Warrick kills the worker mid-approval, the system recovers perfectly upon restart. The event history is replayed, the state is reconstructed, and the agent continues without losing a single bit of progress.
Why This Matters
This approach solves the fundamental tension in AI development: the gap between the speed of silicon and the speed of biology. As we move toward more autonomous agents, we have to decide when a human *should* be in the loop.
Warrick suggests two main criteria: the cost of being wrong and alert fatigue. If an agent is managing a $10,000 transaction, the cost of an error is high, so a human must approve it. However, if you ask for human approval for every single minor task, your human operators will experience alert fatigue and start clicking "approve" blindly just to clear the queue.
By treating humans as an asynchronous API, we build systems that are resilient to the inherent unpredictability of both the internet and human beings. We stop building fragile scripts and start building robust, industrial-grade agentic systems.