convex-crons

Define recurring scheduled jobs in Convex using cronJobs and internal functions.

9.4k|1.5k|Updated Jan 3, 2026
One-click install
npx skills add https://github.com/openclaw/clawhub --skill convex-crons
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-crons
Source: https://github.com/openclaw/clawhub/tree/main/.agents/skills/convex-crons
Command: npx skills add https://github.com/openclaw/clawhub --skill convex-crons

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting up recurring background tasks in a Convex backend requires knowing the correct conventions: where to define crons, which functions are safe to schedule, and how to keep handlers reliable. This Skill provides the exact workflow and rules for adding scheduled jobs to a Convex app without misconfiguring public endpoints or creating fragile handlers.

Core Features & Use Cases

  • Cron Definition Workflow: Guides creation of convex/crons.ts using the cronJobs() API to register recurring jobs.
  • Safe Scheduling Rules: Enforces scheduling internal.* functions only, never public api.* endpoints, and choosing sane intervals.
  • Idempotent Handler Guidance: Ensures each cron run is small and safe to re-run, avoiding duplicate side effects.
  • Use Case: You need a nightly cleanup job that purges expired sessions in your Convex app. Follow the workflow to create convex/crons.ts, schedule an internal mutation at a daily interval, and verify it appears in the dashboard schedule.

Quick Start

Add a daily cron job to my Convex app that calls an internal function to clean up expired sessions.

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 uses the cronJobs() API to register recurring jobs. Schedule internal functions at the desired interval, then verify the job appears in the Convex dashboard schedule.

How to schedule recurring background tasks in Convex?

Define the schedule in convex/crons.ts using cronJobs() and point each entry at an internal function. Keep the handler small and idempotent so repeated runs are safe.

Can Convex crons call public api functions?

No, cron jobs should schedule internal.* functions only, never public api.* endpoints. Internal functions are not exposed to clients, making them the safe target for scheduled work.

Why should Convex cron handlers be idempotent?

Cron handlers must be idempotent because jobs can be retried or re-run, and non-idempotent logic could cause duplicate side effects. Keeping each run small and safe to repeat prevents data corruption.

When should I use a subscription instead of a Convex cron job?

Use a subscription when clients need real-time updates pushed to them, rather than polling with a tight cron interval. Crons are for recurring background work, not live data delivery.