$crond.io
integrations / supabase

Supabase Cron (pg_cron) Monitoring

Supabase Cron schedules recurring jobs right inside Postgres with pg_cron — but if a job errors or the schedule silently stops, nothing pages you. crond.io watches the schedule and alerts you when a run is late. You ping it from the job itself using pg_net.

How it works

Create a crond.io monitor with the same schedule as your cron job (pg_cron runs in UTC). At the end of the job's SQL, call the crond.io ping URL with net.http_get. If the job errors, the transaction aborts before the ping runs — so crond.io sees a missing ping and alerts you. That's the failure signal, for free.

1. Enable the extensions

In the Supabase dashboard under Database → Extensions (or via SQL) enable both:

create extension if not exists pg_cron;
create extension if not exists pg_net;

2. Ping crond.io from your job

Add the ping as the last statement of your scheduled job. pg_net is asynchronous, so it queues the request and returns immediately:

select cron.schedule(
  'nightly-rollup',
  '0 3 * * *',
  $$
    -- ... your job runs first ...
    call do_nightly_rollup();

    -- then tell crond.io it completed (only reached if the job didn't error)
    select net.http_get('https://api.crond.io/ping/YOUR_PING_KEY');
  $$
);

Prefer explicit failure alerts? Wrap the body in a begin ... exception block and net.http_post to /fail in the handler. For most jobs the missing-ping detection above is enough.

Managing the job

List and unschedule jobs the usual pg_cron way:

select * from cron.job;                 -- list scheduled jobs
select cron.unschedule('nightly-rollup'); -- remove one