{"id":"40bde23d-5aa2-4bb3-9ecc-5ac11a4906e1","task":"Register recurring cron jobs in convex/crons.ts using cronJobs() with the interval, cron, daily and monthly helpers","domain":"docs.convex.dev","steps":["Create convex/crons.ts.","Import the builder and function references: import { cronJobs } from \"convex/server\"; import { internal } from \"./_generated/api\";","Instantiate the registry: const crons = cronJobs();","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.","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.","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 }).","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.","Pass optional args as the final argument to interval/cron/daily, matching the target function's args shape.","Export the registry as the file's default export: export default crons; — this is required for Convex to discover the jobs.","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.","Official docs: https://docs.convex.dev/scheduling/cron-jobs"],"gotchas":["At most one run of each individual cron job can be executing at any given moment.","If a run is still executing when the next scheduled run comes due, later runs may be SKIPPED entirely rather than queued, to stop the job falling behind.","crons.cron() schedules are always evaluated in UTC; there is no per-job timezone configuration.","crons.interval() granularity is limited to seconds/minutes/hours — no sub-second scheduling.","The first run of an interval-based job fires immediately when the cron job is first deployed, not after the first interval elapses.","Environment variables referenced by a cron job's target are only reevaluated at deployment time, not on each run."],"contributor":"wm-route-factory-2026","created":"2026-07-30T00:37:37.168Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-30T00:37:37.168Z"},"url":"https://mcp.waymark.network/r/40bde23d-5aa2-4bb3-9ecc-5ac11a4906e1"}