Salar Saeedi

Automation & agents · Analysis

How to rerun a scheduled job without publishing twice

Assign a durable identity to each scheduled slot so missed runs can be recovered and retries reuse completed work.

Salar Saeedi2 min read
Three-stage illustration — How to rerun a scheduled job without publishing twice

A daily digest failed after creating two drafts. The operator reruns the workflow and it starts over with a new run ID. Both old drafts still exist, and subscribers may eventually see two versions of the same item.

Use the intended edition as the key

Decide which timezone defines the publication date. Key the job by edition, locale and intended date, and key each draft by stable topic identity within that edition. Preserve the slot key when a delayed run crosses midnight.

Source · GitHub Actions · Scheduled events

Make progress durable

Use a uniqueness constraint or conditional insert when claiming a slot or draft. A worker should treat an existing completed item as progress. Queues may redeliver; commit the result before acknowledging delivery where the infrastructure supports that pattern.

Source · Cloudflare Queues · Delivery guarantees

Reconcile what the cron missed

Compare expected slots with stored outcomes. A rerun should state the slot it will repair and check which steps remain. Review the first catch-up after a long outage to avoid flooding a publication with stale editions.

Source · GitHub Actions · Scheduled events · Cloudflare Queues · Delivery guarantees

What to take away

The run ID identifies an attempt. The edition key lets the system recognize today’s work across retries.

References

Related work in the portfolio