---
title: "Monitor Supabase Cron and pg_cron jobs"
url: "https://cronmissed.com/guides/supabase-pg-cron.md"
canonical_url: "https://cronmissed.com/guides/supabase-pg-cron"
last_updated: "2026-10-22"
type: "how-to"
summary: "pg_cron queues a second run behind a running one and runs nothing on a standby. Ping CronMissed from the job SQL to watch Supabase Cron."
related: ["https://cronmissed.com/guides.md", "https://cronmissed.com/guides/cloudflare-cron-triggers.md", "https://cronmissed.com/learn/dead-mans-switch.md", "https://cronmissed.com/learn/cron-every-30-seconds.md", "https://cronmissed.com/snippets/shell.md"]
---

# Monitor Supabase Cron and pg_cron jobs

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

pg_cron queues a second run behind a running one and runs nothing on a standby. Ping CronMissed from the job SQL to watch Supabase Cron.

Supabase Cron is pg_cron, and pg_cron records each run in a table nobody reads. A failed job writes a row to cron.job_run_details, not an alert. A ping at the end of the job command makes a failed or stuck job visible within minutes.

## How can a scheduled job fail silently on Supabase Cron and pg_cron?

- pg_cron runs several jobs in parallel but only one instance of each job at a time. If a second run is due before the first finishes, it waits in a queue and starts when the first ends, so a slow job drifts later every time.
- pg_cron does not run any jobs while the server is in hot standby mode. It starts again when the server is promoted.
- Supabase recommends no more than 8 jobs running at once and no job running longer than 10 minutes.
- The default time zone is GMT, set with cron.timezone. A schedule written in local time is wrong until the setting matches.
- Job history lives in cron.job_run_details and grows if nobody prunes it.

## What are the limits of Supabase Cron and pg_cron?

| Limit | What the documentation says |
| --- | --- |
| Frequency | Supabase Cron runs jobs anywhere from every second to once a year. |
| Seconds | An interval of 1 to 59 seconds is allowed, but you cannot mix seconds with the other time units. |
| Concurrency | Recommended maximum of 8 jobs at once; each job no more than 10 minutes. |
| Per-job instances | One at a time; a due second run is queued. |
| Time zone | GMT by default; cron.timezone changes it. |
| Run history | cron.job_run_details records the status of every run. |

## How do you add a CronMissed ping to Supabase Cron and pg_cron?

Make the job command call the work and then send the ping. If the work raises an error, the whole command fails before the ping, so a ping means success. The second statement uses the `pg_net` extension on Supabase to send the request.

```sql
select cron.schedule(
  'nightly-cleanup',
  '15 3 * * *',
  $$
    select public.cleanup_old_rows();
    select net.http_get(url := 'https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10');
  $$
);
```

To catch jobs that fail, read the run history once an hour and ping a second check with the result.

```sql
select count(*) filter (where status = 'failed') as failed_last_hour
from cron.job_run_details
where start_time > now() - interval '1 hour';
```

## Which check settings fit Supabase Cron and pg_cron?

Create a cron check with the same expression in GMT. A job that keeps its work short needs only a few minutes of grace; give a job near the 10 minute guidance 15. For a job that runs every few seconds, a heartbeat check is the wrong tool: watch the failed count in cron.job_run_details instead and ping once a minute from a summary job.

## How do you confirm the check works?

1. Run select cron.schedule for a test job every minute, wait for a run, and look at cron.job_run_details.
2. Make the cleanup function raise an exception and confirm that no ping arrives and the check goes down after the grace.
3. Unschedule the job with cron.unschedule and confirm the check goes late.

## Questions

### Does pg_net send the request inside the transaction?

No. pg_net sends requests asynchronously, so a slow CronMissed response cannot hold up your job. A request is queued only if the command reaches that statement, which is why it comes last.

### Can I just check cron.job_run_details?

It tells you what ran. It cannot tell you that nothing ran, for example when the extension is stopped or the database is unreachable. The heartbeat catches both.

## Sources

- [Supabase Docs: Cron](https://supabase.com/docs/guides/cron), read 22 October 2026
- [pg_cron README](https://github.com/citusdata/pg_cron), read 22 October 2026

## Related pages

- [Cloudflare Cron Triggers](https://cronmissed.com/guides/cloudflare-cron-triggers.md)
- [Dead man's switch](https://cronmissed.com/learn/dead-mans-switch.md)
- [Cron every 30 seconds](https://cronmissed.com/learn/cron-every-30-seconds.md)
- [Shell and curl](https://cronmissed.com/snippets/shell.md)

## Related

- [Monitor cron jobs on every platform: 24 guides](https://cronmissed.com/guides.md)
- [Monitor Cloudflare Workers Cron Triggers](https://cronmissed.com/guides/cloudflare-cron-triggers.md)
- [What is a dead man's switch in monitoring?](https://cronmissed.com/learn/dead-mans-switch.md)
- [Run a cron job every 30 seconds](https://cronmissed.com/learn/cron-every-30-seconds.md)
- [Ping CronMissed from a shell script with curl](https://cronmissed.com/snippets/shell.md)
