Menu

Fintech Webhook Cleanup with Node.js Cron: Recovery Boundaries for Retries
📰

Fintech Webhook Cleanup with Node.js Cron: Recovery Boundaries for Retries

DEV Community: node·Faelvorn538072·9 days ago
#NIRQDuml
#devtonodejs#devto#dev#cron#queue
Reading 0:00
15s threshold

A periodic database cleanup in a Node.js backend should start with the least complex shape that meets the recovery requirement: a cron request to a short, idempotent HTTP cleanup handler. That is the right default for deleting expired webhook attempts, compacting delivery records, or marking old failures as terminal. You do not need a queue consumer merely because the word “retry” appears in the design.

The boundary changes when one run can exceed 900 seconds, when the database work needs fan-out, or when an operator needs durable replay. Then use cron as the clock and a queue plus workers as the execution layer. The scheduler remains boring. The recovery path becomes explicit.

The page arrives before the cleanup does

The alert an on-call engineer sees is usually not “cron failed.” It is a webhook delivery table whose pending rows have crossed their age threshold, followed by duplicate outbound attempts after a manual retry.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.