# The Human Is an Async API — Melanie Warrick, Temporal

## Executive summary

This talk addresses the challenge of building durable, stateful AI agents that must interact with humans, who are inherently asynchronous and non-deterministic. The speaker demonstrates how Temporal's primitives—specifically Wait Conditions and Signals—allow multi-agent systems (like those built with Google ADK and LangGraph) to pause, wait for human input (which can take minutes or weeks), and resume execution without losing state or failing, even if the underlying worker service is temporarily killed and restarted.

## Key takeaways

- Human Interaction as an Async API: Because humans are not tools, treating human input as a synchronous function call (a blocking call) will cause the entire system to fail or lose state. The solution is to treat the human as an asynchronous API.
- Durability Belongs in the Harness: For complex multi-agent systems, durability must be managed by the agent harness (e.g., Temporal) to ensure the system remains operational and stateful, regardless of external failures or long waits.
- Core Primitives for State Management: Temporal provides three main primitives: the Worker (runs the code), the Workflow (tracks the steps/logic), and the Activity (handles external interactions, like model or tool calls). This structure ensures state is tracked deterministically.
- Non-Blocking Human-in-the-Loop: To handle human input, use a combination of a Wait Condition (to pause the workflow and store the state) and a Signal (to inject the human's response back into the running workflow) without blocking the entire system.

## Technical details

- Agent Orchestration Demo: The demo uses multiple agents (Fleet, Customer, Dispatch) coordinating an ice cream delivery. Google ADK and Temporal are integrated to track the state of the delivery process, demonstrating durable execution even when an order change requires human approval.
- Temporal Primitives: Temporal standardizes failure handling and state management using three primitives: Worker (executes code), Workflow (manages the sequence of steps), and Activity (integrates with external services, including model/tool calls).
- Agent Framework Integration: The system is designed to be framework agnostic. For agent logic, the speaker demonstrated integrating Temporal with Google ADK and LangChain/LangGraph. Model calls and tool calls are wrapped as Activities, while the overall process flow is managed by the Workflow.
- Recovery and Resilience: The system demonstrated durability by being taken offline (killing the worker) while waiting for human input, and then successfully recovering and replaying the event log upon restart, ensuring no work was lost.

## Practical implications

- When designing agentic systems, always assess the 'cost of being wrong' (e.g., security, financial loss) to determine if human intervention is necessary.
- Be mindful of 'alert fatigue' when designing human-in-the-loop systems; the goal is to balance necessary oversight with minimizing unnecessary interruptions.
- Use durable execution frameworks (like Temporal) to isolate human interaction points, ensuring the system state persists and can resume even if the service crashes during the wait period.

## Topics

Multi-Agent Systems, Durable Execution, Asynchronous Programming, AI Agent Orchestration, State Management, Temporal, Temporal (GitHub), Temporal + Google ADK, Temporal + LangGraph

Source: https://www.youtube.com/watch?v=jc3kbZkuHTo
