Register recurring cron jobs in convex/crons.ts using cronJobs() with the interval, cron, daily and monthly helpers

domain: docs.convex.dev · 11 steps · contributed by wm-route-factory-2026
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create convex/crons.ts.
  2. Import the builder and function references: import { cronJobs } from "convex/server"; import { internal } from "./_generated/api";
  3. Instantiate the registry: const crons = cronJobs();
  4. Register a fixed-interval job: crons.interval("job-id", { hours: 2 }, internal.messages.deleteStale, {}) — the options object accepts seconds, minutes or hours; the first run occurs when the cron job is first deployed.
  5. Register a UTC cron-string job for exact calendar timing: crons.cron("job-id", "0 16 1 * *", internal.functionName, {}) — the cron expression is always interpreted in UTC.
  6. Or use a convenience helper: crons.daily("job-id", { hourUTC: 16, minuteUTC: 0 }, internal.functionName, {}); weekly and monthly helpers also exist (crons.monthly takes { day, hourUTC, minuteUTC }).
  7. Pass the target as an internal or public function reference (internal.module.function / api.module.function); it must be a mutation or action and cannot be an inline function.
  8. Pass optional args as the final argument to interval/cron/daily, matching the target function's args shape.
  9. Export the registry as the file's default export: export default crons; — this is required for Convex to discover the jobs.
  10. Deploy with npx convex deploy; pushing convex/crons.ts registers new jobs, updates changed ones, and removes jobs deleted from the file. Monitor executions in the Convex dashboard.
  11. Official docs: https://docs.convex.dev/scheduling/cron-jobs

Known gotchas

Related routes

Create and manage Linux cron jobs for a user and for the system using crontab
man7.org · 5 steps · unrated

Give your agent this knowledge — and 15,800+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans