Monitor Railway cron jobs
On this page
Railway skips a scheduled run when the previous one is still active, and a job that does not exit keeps it active forever. One forgotten database connection can silence a cron job for weeks. A ping at the end shows the days with no run.
How can a scheduled job fail silently on Railway cron jobs?
- Railway does not terminate a running deployment. If the previous execution is still running when the next is due, the new run is skipped.
- A cron service must exit when its task is done and leave no open resources, such as database connections. A process that keeps one open stays Active and all later executions are skipped.
- Railway does not guarantee execution to the minute; times can vary by a few minutes.
- Schedules are in UTC, and runs must be at least 5 minutes apart.
What are the limits of Railway cron jobs?
| Limit | What the documentation says |
|---|---|
| Minimum gap | Scheduled runs must be at least 5 minutes apart. |
| Time zone | UTC. |
| Exit | The service is expected to exit as soon as the task is done. |
| Overlap | A new run is skipped while the previous one is Active. |
| Precision | Can vary by a few minutes. |
How do you add a CronMissed ping to Railway cron jobs?
Ping at the end of the task, and make sure the process then exits, closing any connection pool. The Node example below ends with an explicit exit, so a stray handle cannot keep the run alive.
import { pool } from './db.js';
const ping = (suffix = '') =>
fetch('https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10' + suffix, { signal: AbortSignal.timeout(10_000) }).catch(() => undefined);
await ping('/start');
try {
await runTask();
await pool.end();
await ping();
process.exit(0);
} catch (error) {
await ping('/fail');
await pool.end().catch(() => undefined);
process.exit(1);
}Which check settings fit Railway cron jobs?
Create a cron check in UTC with the same expression. Give the grace a margin of at least 5 minutes, since Railway can start a run a few minutes late. A long gap between pings on a job that normally runs often is the sign of a hung run, which is exactly what Railway cannot show you; the start ping makes it explicit.
How do you confirm the check works?
- Deploy the service with a schedule of every 5 minutes for a test and watch two runs arrive in the check.
- Leave a connection open on purpose and confirm that later runs are skipped and the check goes down.
- Fix the exit and confirm the check recovers on the next run.
Sources
- Railway Docs: cron jobs , read 22 October 2026
Questions and answers
- Railway documents that it does not terminate deployments automatically. The skip is a result of that design, so the exit in your code is the only safeguard.
- Yes. It is the shortest gap Railway allows, and the check works for any period of 5 minutes or more.
Why does Railway skip instead of killing the old run?
Is a 5 minute schedule fine for a heartbeat?
Create a check, add the ping to the job, and CronMissed alerts you the first time a run is late or reports a failure.
Start monitoring