Short answer: For periodic database cleanup in a Node.js backend, use a cron setup that claims one durable run, processes bounded batches with stable idempotency keys, and leaves retryable work visible; the scheduler is a trigger, not the source of truth.
A nightly payment reconciliation job should be boring: one bounded window, one durable run record, and a retry that cannot charge or delete the same business fact twice. For a property-management backend, my least complex default is a single scheduler that claims a run in the database, processes records with an idempotency key, and leaves retryable work visible when the process disappears.
That distinction matters during cleanup. A timer can fire twice, a deployment can interrupt it, and a payment provider can answer after the caller has timed out. If the cleanup code assumes one invocation, a harmless retention task can remove evidence needed to reconcile a resident payment.…