Long-horizon agents and durable execution · Kiran Prakash, Director of Data and AI, Thoughtworks · martinfowler.com, November 10, 2026
Temporal and Cloudflare split on a rule change under a waiting agent
Prakash built Stock Replenisher, an agent that gets supplier quotes, waits days for a manager to approve a price, and follows the order to delivery, on both Temporal and Cloudflare Workflows. Durable execution records the result of each external step, so after a crash the loop replays without asking for new quotes or a second approval. A section titled "Durable is not the same as correct" covers what replay does not fix. A lost order acknowledgement looks like a failure, so the agent orders again from another supplier; his answer is a cancel_order tool. Approvals go stale while the agent waits, so the manager approves a price up to 5% above the quote and the place_order tool re-reads the quote before it commits.
His clearest result came from a deploy. While a task that had drafted a purchase order from three quotes waited for approval, he shipped a rule requiring four. "On Temporal, SKU-123 silently continued with the order as per the old rule, which the new rule doesn't permit." On Cloudflare, where his loop re-checks recorded decisions against current rules, the order stayed a draft. His fix records a rules version in the task's state and branches on it. Both behaviors are reported from the author's own build.
Why it matters: In a harness that suspends tasks for days, every deploy is a migration against in-flight work, and the runtime decides whether the old rule wins quietly or the task stops. Test which one yours does before shipping a rule change. Prakash also keeps the business rules in tool code rather than the prompt, so a supplier email claiming approval "approves nothing."