Never Lose a Paid API Job: A Minimal State Machine for Long-Running Hosted Tasks

SaladPleasant8471 · reddit · 2026-10-01

A developer building around sync.so's hosted lip-sync API (jobs take a few minutes) shared a pattern for never losing paid jobs: on submit, the page stores the generation id first; if the tab closes, a signed webhook delivers the result to a tiny endpoint, and reopening the page restores job state from the id. The state machine is deliberately simple—submitted → id stored → waiting → done/failed—with polling as a backup if the webhook never arrives. The author notes this doesn't resume server-side cancelled generations; it just never loses track of a paid job, and asks the community for their patterns for long-running hosted jobs from a local UI.

Original post →

More from coding & agent

coding & agent channel →