convex-crons

Define recurring scheduled cron jobs in Convex targeting internal functions.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/Tehzeeb07/CodeRush --skill convex-crons-tehzeeb07
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-crons
Source: https://github.com/Tehzeeb07/CodeRush/tree/main/.agents/skills/convex-crons
Command: npx skills add https://github.com/Tehzeeb07/CodeRush --skill convex-crons-tehzeeb07

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up recurring background tasks in a Convex app requires knowing where to define cron jobs, which functions are safe to schedule, and how to keep handlers reliable. This Skill guides you through creating convex/crons.ts correctly so scheduled jobs run safely and predictably. ## Core Features & Use Cases - Cron Definition: Create convex/crons.ts using cronJobs() to register recurring scheduled jobs. - Safe Scheduling Rules: Enforces scheduling internal.* functions only, never public api.* endpoints. - Idempotent Handlers: Ensures each cron handler is small and safe to re-run without side effects. - Use Case: You need a nightly job that cleans up expired sessions in your Convex database. This Skill walks you through defining the cron, pointing it at an internal mutation, and verifying it appears in the dashboard schedule. ## Quick Start Add a cron job to my Convex app that runs an internal cleanup function every night.

Frequently Asked Questions about convex-crons

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

FAQPage Schema
How do I add a cron job to a Convex app?▼

Create a convex/crons.ts file that calls cronJobs() and registers your recurring jobs with an interval. Schedule an internal function as the handler, then deploy and confirm the job appears in the Convex dashboard schedule.

How to schedule recurring functions in Convex?▼

Use the cronJobs() API in convex/crons.ts to register jobs at your chosen interval. Each job should target an internal mutation or action, keeping the handler small and idempotent so re-runs are safe.

Can Convex crons call public API functions?▼

No, cron jobs should only schedule internal.* functions, never public api.* endpoints. Internal functions are not exposed to clients, which keeps scheduled work secure and separated from your public API surface.

Why should Convex cron handlers be idempotent?▼

Cron handlers must be idempotent because jobs may be retried or re-run, and non-idempotent logic could duplicate writes or corrupt state. Keeping each run small and safe to repeat prevents data inconsistencies.

When should I use subscriptions instead of Convex crons?▼

Use subscriptions when clients need real-time updates pushed as data changes, rather than polling on a tight cron interval. Crons are better for periodic background work like cleanup or aggregation, not live data delivery.