DEV Community

deltax
deltax

Posted on

Cron should never be the decision layer

Cron is not a scheduler.
Cron is a trigger.

Its only job is to wake the system.
It must never decide whether an execution is valid.

If you put business logic in cron, you are encoding false assumptions: – server time equals business time
– daylight saving never changes
– environments are consistent
– executions won’t duplicate

All of those assumptions are wrong.

Correct architecture is simple: – Server and cron run in UTC
– Cron runs frequently, not “on schedule”
– The application decides if execution should happen
– Idempotency guarantees “at most once”
– Time zones are handled in code, not in crontab

This is not a cron limitation.
Cron is intentionally dumb.

The mistake is treating scheduling as a decision layer instead of a signal.

Same rule applies everywhere: Automation, distributed systems, AI outputs.

Trigger wakes the system.
Context decides.

Top comments (0)