convex-cron-jobs

Implements scheduled Convex functions using interval and cron expression patterns.

1|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/Rocktown-Labs/rivercitymd --skill convex-cron-jobs-rocktown-labs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-cron-jobs
Source: https://github.com/Rocktown-Labs/rivercitymd/tree/main/.cursor/skills/convex-cron-jobs
Command: npx skills add https://github.com/Rocktown-Labs/rivercitymd --skill convex-cron-jobs-rocktown-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Automating recurring background tasks in Convex applications—such as data cleanup, external API syncing, and report generation—requires correct cron configuration, internal function security, and error handling that developers often get wrong. ## Core Features & Use Cases - Interval and Cron Scheduling: Configure recurring jobs with crons.interval for simple frequencies or crons.cron for precise cron expressions in UTC. - Secure Internal Functions: Patterns for calling internal mutations and actions from cron jobs, including batching large datasets and external API calls via Node actions. - Monitoring and Logging: Schema and code patterns for tracking job execution, duration, processed counts, and failure states. - Use Case: A SaaS app needs to delete expired sessions hourly, sync third-party data every 15 minutes, and email a weekly summary every Monday—this Skill provides the complete crons.ts setup and supporting functions. ## Quick Start Set up a Convex cron job that runs a cleanup mutation every hour and a daily report at midnight UTC.

Frequently Asked Questions about convex-cron-jobs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule a cron job in Convex?▼

Create a convex/crons.ts file, call cronJobs() from convex/server, and register jobs with crons.interval for simple frequencies or crons.cron for cron expressions. Each job references an internal function and optional static arguments.

How to run a Convex function every day at a specific time?▼

Use crons.cron with a cron expression like "0 9 * * *" for 9 AM daily. All cron expressions in Convex are interpreted in UTC, so convert your local target time accordingly.

Can Convex cron jobs call public functions?▼

Cron jobs should call internal functions only, not public ones. Define the work as an internalMutation or internalAction and import it via the internal object from _generated/api, even for functions in the same file.

How do Convex cron jobs handle large datasets without timing out?▼

Process records in batches using paginate with a cursor, then schedule the next batch with ctx.scheduler.runAfter. This chains mutations so each run stays within execution limits.

Can Convex cron jobs call external APIs?▼

Yes, but the work must run in an internalAction with "use node" since mutations cannot make network requests. Fetch the external data in the action, then persist results through a separate internal mutation.

What timezone do Convex cron expressions use?▼

Convex cron expressions always use UTC. There is no per-job timezone setting, so convert local schedules to UTC when writing expressions like "0 9 * * 1" for Monday 9 AM UTC.