Why Scheduled Jobs Are Hard in Next.js

Next.js is a great framework for full-stack web apps, but it doesn't include a built-in scheduler. On serverless hosts like Vercel, there's no persistent process to run scheduled tasks — you have to use external cron services that hit your API routes, or third-party job queues that add cost and complexity.

On SupaDeploy, scheduled jobs are a first-class feature. You define your cron schedule, write your job code, and SupaDeploy runs it on the right cadence — no external services, no extra billing, no configuration overhead.

Common Scheduled Job Use Cases in Next.js

  • Daily digest emails — Send a summary email to users each morning based on their activity
  • Database cleanup — Archive or delete old records on a schedule to keep your Supabase database lean
  • External API sync — Pull data from third-party APIs (analytics, CRMs, payment processors) on a schedule
  • Subscription renewals — Check and process recurring billing events at the right times
  • Report generation — Pre-compute expensive reports overnight so they're fast when users open them
  • Cache warming — Pre-fetch and cache data before peak traffic hours
  • Health checks — Ping external services and alert on failures

Options for Scheduled Jobs in Next.js

SupaDeploy (recommended)

Built-in scheduler. Define cron expressions in your project config. No external services, no extra cost, runs reliably.

Vercel Cron Jobs

Available on Pro+ plans only. Limited to API route calls. 60-second timeout. Usage counts toward function invocations.

Inngest / Trigger.dev

Third-party services with their own pricing. Add complexity and cost. Good for complex workflows but overkill for simple jobs.

External cron + API routes

Use a cron service to hit your API endpoints on a schedule. Fragile, stateless, and subject to serverless timeouts.

How to Set Up Scheduled Jobs on SupaDeploy

1

Write your job function

Create a standard JavaScript or TypeScript module that exports your job's logic. It can import from your app, connect to Supabase, send emails, or call external APIs.

2

Define the schedule

In SupaDeploy's project settings, create a new job and set the cron expression. Standard cron syntax is supported — "0 9 * * *" for daily at 9am, "*/15 * * * *" for every 15 minutes, etc.

3

Access shared environment

Jobs run in the same environment as your app — Supabase credentials, API keys, and SMTP settings are all available automatically.

4

Monitor execution

View the job run history and logs in the SupaDeploy dashboard. Get alerts if a job fails so you can respond quickly.

Cron Expression Quick Reference

SupaDeploy uses standard cron syntax: minute hour day-of-month month day-of-week

  • 0 * * * * — Every hour at minute 0
  • 0 9 * * * — Daily at 9:00 AM UTC
  • 0 9 * * 1 — Every Monday at 9:00 AM UTC
  • 0 0 1 * * — First day of every month at midnight
  • */5 * * * * — Every 5 minutes
  • 0 8,17 * * 1-5 — Weekdays at 8 AM and 5 PM