Timers and timeouts in Temporal serve fundamentally different purposes: timers implement business logic (wait, then act), while timeouts detect failures. The post walks through Temporal's four Activity timeout types — Start-To-Close, Schedule-To-Close, Schedule-To-Start, and Heartbeat — explaining when and why to use each. It warns against using Workflow-level timeouts for business logic, since they terminate Workflows server-side with no chance for cleanup code to run. Key practical advice includes always setting Start-To-Close or Schedule-To-Close on Activities, using heartbeating for long-running Activities to avoid zombie Workers, and replacing Workflow timeouts with in-Workflow timers whenever the application needs to react to a time limit. A decision cheat sheet maps common scenarios to the correct tool.

16m read timeFrom temporal.io
Post cover image
Table of contents
The Core Mental Model: Detection vs. Business Logic #Timers: Durable Waiting, for Free #How Activity Timeouts Work #Four Knobs, Each for a Different Purpose #Here There Be Monsters: Workflow Timeouts #A Common Mistake, and How to Fix It #Sleeping Before Beginning: Workflow Delay Start #The Decision You Actually Need to Make #Wrapping Up #
17 Impressions