Solution skill
Scheduled jobs with pg_cron plus Edge Functions: cron triggers, functions do the work
Complete solution
Guide Scheduled jobs with pg_cron plus Edge Functions: cron triggers, functions do the work: TL;DR: Keep the cron body to the single HTTP call. # Scheduled jobs: pg_cron schedules, Edge Functions execute pg_cron is a scheduler, not an application runtime. Use this when you hit exactly this in Scheduled. Not for different errors or different tools.
TL;DR: TL;DR: Keep the cron body to the single HTTP call. # Scheduled jobs: pgcron schedules, Edge Functions execute pgcron is a scheduler, not an application runtime. SQL job bodies are fine for ## Fix 1. Keep the cron body to the single HTTP call.
TL;DR: Keep the cron body to the single HTTP call. # Scheduled jobs: pgcron schedules, Edge Functions execute pgcron is a scheduler, not an application runtime. SQL job bodies are fine for
Fix
Keep the cron body to the single HTTP call. Expected: this specific failure stops.
Then let one scheduled run fire and confirm exactly one execution with the expected result in the function logs. Expected: this specific failure stops.
Details
Scheduled jobs: pgcron schedules, Edge Functions execute pgcron is a scheduler, not an application runtime. SQL job bodies are fine for delete from cleanup; anything involving APIs, secrets, or branching logic belongs in an Edge Function that cron invokes over HTTP. ## Checkable procedure 1. Write the Edge Function first, with its own auth: it should accept only calls bearing a job secret header, since pgcron calls it over HTTP like any client. 2. Deploy the function and store its URL and the job secret in the vault or function secrets, not in the cron job SQL string. 3. Schedule with `cron.schedule('job-name', 'cron-expr', $$ select net.httppost(...) $$) using pg_net to POST to the function URL with the secret header. Name the job for later cleanup. 4. Retries, backoff, and business logic live in the function where you can log and alert properly. 5. Monitor both sides: cron.jobrundetails` A 200 from the schedule with a 500 inside the function is the silent failure mode. ## Ordering constraints Function deployed and tested manually before the cron row exists. Secret rotated in one place (function secrets) rather than in every cron body. ## Verification Invoke the function manually with the secret and confirm the effect.
When to use
You hit exactly this: Scheduled jobs with pg_cron plus Edge Functions: cron triggers, functions do the work in Scheduled.
When not to use
A different error, or the same symptom in a different tool. This page only covers the failure above.
Compatibility
Scheduled.
Edge cases
- for the schedule firing, and the function logs for the execution result.
Evidence
Verified against live Supabase docs 2026-09-26: https://supabase.com/docs/guides/database/extensions/pg_cron, https://supabase.com/docs/guides/functions
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_9_huMHGMXZ_SVxL4wzrTmg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Scheduled jobs with pg_cron plus Edge Functions: cron triggers, functions do the work <span>— Vectle</span></a>