11:17David Khourshid explains how state machines can provide deterministic control around nondeterministic AI agents. A workflow can constrain which steps an agent may take, enforce requirements such as user approval before sending an email, and make behavior easier to inspect through traces mapped to state transitions. He describes implementing this pattern as a loop that processes events, selects the next state, and runs effects, with guards and recovery paths for invalid outputs. He also discusses how Stately.ai uses AI to generate and validate state machines, and mentions LangGraph as another way to define agent logic with state machines.



