Two patterns
One-shot delayed
ctx.scheduler.runAfter(60_000, api.foo.bar, args) — runs once, after 60 seconds.Recurring (cron)
crons.cron("0 0 * * *", api.foo.dailyCleanup, args) — runs daily at midnight UTC.Common uses
Reminder emails
“Send a reminder 24 hours before the booking” — schedule from the booking creation mutation.
Cleanup jobs
Delete soft-deleted rows after 30 days; clear old presence records hourly.
Nightly reports
Aggregate yesterday’s data into a
dailyMetrics table for fast dashboard queries.Renewals
“Mark subscription as ‘renewing’ 24 hours before period end.”
Tips
Related
Convex scheduled functions
Full reference.
Background jobs
For longer / chunked work.
Inngest
For complex workflows.
