releases.shpreview

Supabase Cron

$npx -y @buildinternet/releases show rel__E8IP-8xB62PJBClS39Jg

Release Date: 04 Dec 2024

Today we're releasing Supabase Cron, a new Postgres Module that makes recurring Jobs simple and intuitive inside your database.

It's designed to work seamlessly with the entire Supabase platform. Create recurring Jobs to run SQL snippets and call database functions, Supabase Edge Functions, and even remote webhooks.

Supabase Cron is built on the powerful pg_cron extension by the team at Citus Data.

What's a Cron?

Cron is a tool for scheduling recurring tasks that run at specified intervals. These periodic tasks are called "Cron Jobs". Common use-cases include:

  • Maintenance: delete or archive old data
  • Reporting and analytics: save daily or weekly reports for analysis
  • Automation: send periodic emails, like newsletters or reminders
  • Monitoring: perform health checks on your database and log the results
  • Performance: automate vacuuming tables and rebuilding indexes

Supabase Cron stores the scheduling logic within Postgres and integrates with the rest of the Supabase primitives - Dashboard, Edge Functions, and AI Assistant.

How Do You Use Supabase Cron?

You can create Jobs either via the Dashboard or SQL. Within the Dashboard you can define schedules using standard cron syntax, the special pg_cron seconds syntax for sub-minute schedules, or use natural language.

Natural language scheduling

Job Types

You can choose between four types of Jobs based on what you need to execute:

Job types

SQL Snippets

Create an inline SQL query or command to run on your database periodically. Use this for:

  • Generating reports
  • Cleaning up stale data
  • Refreshing Materialized Views

Database Functions

Call a Postgres function. This is useful for workflows such as:

  • Batch processing operations
  • Running periodic maintenance tasks
  • Performing multi-step updates using transactions

HTTP Requests (webhooks)

Trigger an external HTTP endpoint. Use this for:

  • Starting external workflows
  • Syncing data with third-party APIs
  • Sending notifications to external systems

Supabase Edge Functions

Run a serverless function to execute custom logic. Examples include:

  • Creating embeddings
  • Sending automated email updates
  • Fetching external data and storing it in your database

Observe and Debug Jobs

View the history of all Jobs and their logs in the Dashboard. You can see when a Job started, how long it took, and what the result was.

View Job history

Observe and debug Jobs

For deeper analysis, view Jobs in the Logs Explorer.

View cron logs

Getting Started

Getting started is easy:

  1. Visit the Integrations page in your project
  2. Enable the Cron Postgres Module
  3. Create your first scheduled Job

Integrations page

Create a new Job

Fetched March 31, 2026