AWS Lambda Durable Functions Harbor a Silent Replay Bug in AI Approval Workflows

A developer building a human-in-the-loop AI agent workflow using AWS Lambda durable functions—released in late 2025—discovered that the system executed a different action than the one a human had explicitly approved. The root cause was the replay mechanism central to how durable functions work: when a paused workflow resumes, Lambda reruns the handler from the top and reinjects checkpointed results, which can silently mismatch with runtime state if code is not structured carefully. The workflow was designed to let an AI agent propose an action, pause for human approval, then execute only the approved action—but the replay behavior caused it to execute the wrong one. The bug was not in business logic or a race condition, but in a misunderstood framework feature that can affect any multi-step workflow with external callbacks. A single structural code fix was found to reliably prevent the issue, and the author validated the solution both locally and on a live Lambda deployment.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in