Files
Joel Hooks 1b7c2f0a8c restate-lab: escalating reminder loop + 409 duplicate callback safety
Approval workflow now enters a reminder loop after initial notification:
sleep(interval) → peek promise → if pending, send escalating reminder.
Four tiers: gentle → firm → urgent → critical with configurable intervals.
Lab mode uses 15s/30s/45s/60s; production default 4h/12h/24h/48h.

Uses DurablePromise.peek() to check resolution between sleeps without
blocking — if decision arrived during sleep, skip remaining reminders.

Fixed: resolver handles HTTP 409 (promise already completed) gracefully.
Multiple Telegram messages with buttons for the same workflow is expected —
user may tap any of them. Second resolve gets 409, logged as duplicate.

Proven: initial notification sent, 1st reminder at +15s, Joel tapped approve
on reminder, workflow completed with remindersCount=1 and durationMs=45995.
2026-03-05 07:52:43 -08:00
..