convex-cron-jobs

Implements scheduled recurring functions in Convex using interval and cron expression patterns.

Updated May 28, 2026
One-click install
npx skills add https://github.com/mrisoli/pokerhouse --skill convex-cron-jobs-mrisoli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-cron-jobs
Source: https://github.com/mrisoli/pokerhouse/tree/main/.agents/skills/convex-cron-jobs
Command: npx skills add https://github.com/mrisoli/pokerhouse --skill convex-cron-jobs-mrisoli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Automating recurring backend tasks like cleanup jobs, data syncing, and report generation in Convex applications requires correct scheduling patterns, and mistakes like calling public functions or running unbatched mutations cause failures and security issues. ## Core Features & Use Cases - Interval and Cron Scheduling: Configure recurring jobs with crons.interval for fixed periods or crons.cron for precise UTC cron expressions. - Secure Internal Functions: Patterns for calling internal mutations and actions from cron jobs, including external API sync via Node actions. - Batching and Monitoring: Pagination-based batch processing for large datasets and structured cron execution logging with a schema for job history. - Use Case: Set up a daily job that deletes expired sessions, a 15-minute external API sync, and a weekly report generator, all with execution logs queryable in the Convex dashboard. ## Quick Start Ask the AI to create 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 fixed periods or crons.cron for cron expressions. Each job points to an internal function and optional static arguments.

What is the difference between crons.interval and crons.cron in Convex?▼

crons.interval runs a function every fixed period such as minutes or hours, while crons.cron accepts a standard five-field cron expression for precise times like weekdays at 9 AM. Both schedule internal functions and all cron expressions use UTC.

Can Convex cron jobs call public functions?▼

No, cron jobs should call internal functions only, such as internalMutation or internalAction, for security. Import internal from _generated/api even when referencing functions defined in the same file.

How do I process large datasets in a Convex cron job without timeouts?▼

Use pagination with a cursor to process records in batches, then schedule the next batch with ctx.scheduler.runAfter passing the continueCursor. This chains mutations until all items are processed without hitting execution limits.

Can Convex cron jobs call external APIs?▼

Yes, schedule an internalAction with the "use node" directive to fetch from external APIs, then persist results via ctx.runMutation. Store API keys in environment variables rather than in code.

What timezone do Convex cron expressions use?▼

All Convex cron expressions run in UTC. Convert local-time schedules to UTC when writing expressions, and account for daylight saving shifts manually since cron expressions do not adjust automatically.