Skip to main content
Several Encore OS edge functions run on a schedule via pg_cron (+ pg_net) in Supabase. This guide covers all of them in one place: what each job does, the scheduling SQL, and how to verify, pause, and troubleshoot.

Prerequisites

Enable extensions in the Supabase Dashboard → Extensions:
  • pg_cron
  • pg_net
For the workflow and webhook jobs, ensure util.invoke_edge_function is available and app.settings.service_role_key is configured in Vault.
Run the SQL below in the Supabase SQL Editor, not as a migration — it depends on project-specific Vault settings, URLs, and keys. Replace YOUR_SERVICE_ROLE_KEY with the service role key from Settings → API. Never commit service role keys to code.

Job catalog

Scheduling SQL

If second-level pg_cron scheduling is available, use */10 * * * * * (every 10 seconds) for lower latency.
The FW-26 process-scheduled-workflows function is the time-based companion to the worker. Each minute it finds active fw_workflow_schedules whose next_execution_at is due, enqueues a fw_workflow_executions row into the same workflow_execution_queue (so workflow-executor-worker runs them), and re-arms each schedule — advancing a cron schedule to its next run, or deactivating a one-time schedule that has fired. Conflicting runs honor the schedule’s conflict_resolution (skip / delay / error).Schedule it alongside the worker (run it before the worker each minute so freshly queued runs are picked up in the same tick):
The dispatcher is idempotent against concurrent ticks: it claims each due row with a compare-and-swap on next_execution_at before enqueuing, so an overlapping run can’t double-dispatch. An optional {"batch_size": N} body caps rows per tick (default 200).

Verify a job

Manage jobs

Troubleshooting