Problem
At claim time, claimNextDueFlow overwrites nextRunAt with resolveNextRunAt(flow), which returns null for flows without a cronExpression. This null is persisted in the same updateMany that acquires the lease, before the run is created. If the process crashes between claim and run creation, the one-shot schedule is lost.
Location
apps/web/src/lib/services/flow-leases.ts:71-88 (caller: apps/web/src/lib/flows/scheduler.ts:91-98)
Impact
A crash window for non-cron scheduled flows silently abandons the execution with no reschedule path.
Suggested fix
Only advance/null nextRunAt after the run has been durably created, so a pre-run crash leaves the flow re-claimable.
Source: code investigation.
Problem
At claim time,
claimNextDueFlowoverwritesnextRunAtwithresolveNextRunAt(flow), which returnsnullfor flows without acronExpression. This null is persisted in the sameupdateManythat acquires the lease, before the run is created. If the process crashes between claim and run creation, the one-shot schedule is lost.Location
apps/web/src/lib/services/flow-leases.ts:71-88(caller:apps/web/src/lib/flows/scheduler.ts:91-98)Impact
A crash window for non-cron scheduled flows silently abandons the execution with no reschedule path.
Suggested fix
Only advance/null
nextRunAtafter the run has been durably created, so a pre-run crash leaves the flow re-claimable.Source: code investigation.