Agent skill

Convex Cron Jobs

by waynesutton in waynesutton/builder-skills

Schedules work in Convex: cron jobs in convex/crons.ts, one off scheduled functions with runAfter and runAt, batching large jobs, and cancelling or inspecting the queue.

Apache-2.0Auto-check passedProductivity & Automation

Install Convex Cron Jobs

skills CLI
$ npx skills add waynesutton/builder-skills --skill convex-cron-jobs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install waynesutton/builder-skills convex-cron-jobs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/waynesutton/builder-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/convex-cron-jobs .claude/skills/convex-cron-jobs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
convex-cron-jobs
GitHub stars
406
Token cost
~2k tokens
SKILL.md length
821 words
Files
6 (incl. references, assets)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Schedules work in Convex: cron jobs in convex/crons.ts, one off scheduled functions with runAfter and runAt, batching large jobs, and cancelling or inspecting the queue.

  • Works in 5 steps: The file is exactly convex/crons.ts and… → npx convex dev is running and the last… → The target is internal.* and the args… → …
  • Something needs to run on a timer
  • SKILL.md covers When to reach for this, crons.ts skeleton, Targets are internal functions and One batched job, plus 6 more sections
  • Calls npx

What it does

Convex Cron Jobs is an agent skill from waynesutton/builder-skills. Schedules work in Convex: cron jobs in convex/crons.ts, one off scheduled functions with runAfter and runAt, batching large jobs, and cancelling or inspecting the queue. Use when something needs to run on a timer, later, or in the background, or when a cron is not firing.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files and assets (for example `agents/openai.yaml`, `references/cron-recipes.md` and `references/scheduling-patterns.md`).

It sits in Productivity & Automation, covering Scheduled and recurring tasks. The repository describes itself as: Builder skills for Convex apps. Convex patterns plus a PRD, task.md, changelog, and files.md workflow for Claude Code, Codex, Cursor, and OpenCode. The licence is Apache-2.0.

When your agent uses it

  • Something needs to run on a timer
  • In the background
  • A cron is not firing

Example prompts

  • “Use the convex-cron-jobs skill to schedule work in Convex: cron jobs in convex/crons.ts, one off scheduled functions with runAfter and runAt…”
  • “/convex-cron-jobs”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. The file is exactly convex/crons.ts and ends with export default crons.
  2. npx convex dev is running and the last push succeeded. Cron changes only apply on push.
  3. The target is internal.* and the args match its validator. A mismatch fails at push time.
  4. The expression is UTC. Convert your local hour before comparing.
  5. Check Logs for a thrown error. A job that throws every run looks like a job that never runs.

What it can do on your machine

Read from SKILL.md and the folder at commit 82d1ce2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.convex.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Convex Cron Jobs loads about 2k tokens when it runs, and up to ~6.4k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 821 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from waynesutton/builder-skills at commit 82d1ce2, republished under its Apache-2.0 licence (© waynesutton). 821 words, ~1,959 tokens.

Download SKILL.mdSave it as .claude/skills/convex-cron-jobs/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
convex-cron-jobs
description
Schedules work in Convex: cron jobs in convex/crons.ts, one off scheduled functions with runAfter and runAt, batching large jobs, and cancelling or inspecting the queue. Use when something needs to run on a timer, later, or in the background, or when a cron is not firing.

Convex cron jobs and scheduling

Recurring work lives in convex/crons.ts. One off work is scheduled from inside a function with ctx.scheduler. Both must target internal.* functions, never api.*.

When to reach for this

  • Something needs to run every N minutes or at a fixed time of day
  • A mutation needs to kick off follow up work after it commits
  • A job touches more rows than one mutation should handle
  • A cron shows in the dashboard but never runs, or runs at the wrong hour
  • A pending job needs to be cancelled, debounced, or inspected

Deeper material lives in two reference files:

crons.ts skeleton

One file, one default export. crons.interval for "every N", crons.cron for calendar times. crons.daily, crons.hourly, and crons.weekly are deprecated helpers. Do not use them.

typescript
// convex/crons.ts
import { cronJobs } from "convex/server";
import { internal } from "./_generated/api";

const crons = cronJobs();

// Every hour
crons.interval(
  "expire sessions",
  { hours: 1 },
  internal.sessions.expireBatch,
  {},
);

// Every day at 09:00 UTC. Cron expressions are always UTC.
crons.cron("daily digest", "0 9 * * *", internal.digest.send, {});

export default crons;

Rules for every entry:

  • Names are unique within the file. The dashboard lists jobs by this name.
  • Import internal from ./_generated/api, even when the target is defined in crons.ts.
  • Args are static and must satisfy the target function's args validator.
  • Interval units are { seconds }, { minutes }, or { hours }.

Cron expression quick reference (minute hour day-of-month month day-of-week):

ExpressionRuns
*/15 * * * *every 15 minutes
0 * * * *every hour at :00
0 0 * * *daily at 00:00 UTC
0 8 * * 1Mondays at 08:00 UTC
0 0 1 * *first of each month
0 9-17 * * 1-5hourly, 09:00 to 17:00 UTC, weekdays

Targets are internal functions

Public functions expect a client, an auth identity, and untrusted input. Cron and scheduler calls have none of that. A public target skips the auth checks you wrote and exposes the job to anyone who can reach the deployment. Register targets with internalMutation, internalAction, or internalQuery.

One batched job

A mutation is one transaction with read and write limits. Deleting fifty thousand rows in a loop hits them. Take a fixed slice, reschedule yourself with runAfter(0, ...), and let the chain finish on its own.

typescript
// convex/sessions.ts
import { internalMutation } from "./_generated/server";
import { internal } from "./_generated/api";
import { v } from "convex/values";

const BATCH = 100;

export const expireBatch = internalMutation({
  args: {},
  returns: v.null(),
  handler: async (ctx) => {
    // Date.now() is fine in a mutation. Never call it in a query.
    const now = Date.now();
    const expired = await ctx.db
      .query("sessions")
      .withIndex("by_expiresAt", (q) => q.lt("expiresAt", now))
      .take(BATCH);

    await Promise.all(expired.map((s) => ctx.db.delete(s._id)));

    // A full batch means more may remain. Chain the next one.
    if (expired.length === BATCH) {
      await ctx.scheduler.runAfter(0, internal.sessions.expireBatch, {});
    }
    return null;
  },
});

This shape works because each delete removes the row from the index range. If the job updates rows without moving them out of the range, use a pagination cursor instead. See the reference file.

runAfter vs runAt

typescript
// Relative: 5 minutes from now
const jobId = await ctx.scheduler.runAfter(
  5 * 60 * 1000,
  internal.reminders.send,
  { taskId: args.taskId },
);

// Absolute: a timestamp you already store (ms since epoch or a Date)
await ctx.scheduler.runAt(trial.endsAt, internal.billing.endTrial, {
  userId: trial.userId,
});
MethodUse for
runAfter(delayMs, fn, args)retries, follow ups, "in ten minutes"
runAt(timestamp, fn, args)trial ends, send dates, anything with a stored time

Both return an Id<"_scheduled_functions">. Store it on a document if you may need to cancel.

Two behaviors to remember:

  • Scheduling inside a mutation is transactional. If the mutation throws, nothing is scheduled. Scheduling inside an action happens right away, even if the action fails later.
  • Scheduled mutations run exactly once. Scheduled actions may fail without retry, so add retry logic to actions or use a retry component.
Show full SKILL.md (348 more words)Show less

Seeing runs in the dashboard

  • Schedules, Cron Jobs tab: every entry from crons.ts, with last run and next run.
  • Schedules, Scheduled Functions tab: pending runAfter and runAt jobs.
  • Logs, filtered by function name: each execution, its duration, and any thrown error.
  • From the CLI: npx convex logs streams the same log lines.
  • From code: ctx.db.system.get(jobId) returns the job document with state.kind set to pending, inProgress, success, failed, or canceled.

When a cron is not firing

  1. The file is exactly convex/crons.ts and ends with export default crons.
  2. npx convex dev is running and the last push succeeded. Cron changes only apply on push.
  3. The target is internal.* and the args match its validator. A mismatch fails at push time.
  4. The expression is UTC. Convert your local hour before comparing.
  5. Check Logs for a thrown error. A job that throws every run looks like a job that never runs.

Common mistakes

MistakeWhy it breaksDo instead
crons.daily(...)deprecated helpercrons.cron("...", "0 0 * * *", ...)
Target is api.tasks.cleanupskips auth, publicly callableregister as internalMutation, use internal.tasks.cleanup
.collect() then loop over thousandshits transaction limitstake(BATCH) and reschedule
.withIndex("by_x").filter(...)filter scans the whole indexput the range in withIndex
Date.now() in an internalQuerybreaks caching and reactivitypass now as an arg from the caller
Cron at "0 9 * * *" for 9am Pacificruns at 9am UTCuse UTC, or run hourly and check local hour
Missing await on runAfterjob may not be scheduledalways await ctx.scheduler.*
Two crons with the same namepush failsunique names per file

Checklist

  • convex/crons.ts uses only crons.interval and crons.cron, ends with export default crons
  • Every cron and scheduler target is internal.*
  • Every target has args and returns validators
  • Jobs that touch many rows take a batch and reschedule with runAfter(0, ...)
  • Range conditions live in withIndex, not .filter
  • No Date.now() inside queries
  • Every ctx.scheduler.* call is awaited
  • Cron hours are written in UTC
  • Job ids are stored on documents when cancel or debounce is needed
  • Ran npx convex dev and saw the job listed under Schedules

Docs

© waynesutton, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references, assets) in skills/convex-cron-jobs of waynesutton/builder-skills.

  • SKILL.md
  • agents/openai.yaml
  • assets/large-logo.png
  • assets/small-logo.svg
  • references/cron-recipes.md
  • references/scheduling-patterns.md

Open the folder on GitHubat commit 82d1ce2

Compare with similar skills

Convex Cron Jobs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Convex Cron Jobs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Convex Cron Jobs this skillwaynesutton/builder-skills406—~2kAutomated safety check: PassApache-2.0
ScheduleTinyAGI/tinyagi3.6k—~1.4kAutomated safety check: PassMIT
Send User MessageTinyAGI/tinyagi3.6k—~829Automated safety check: PassMIT
Cron Opsczl9707/build-your-own-openclaw1.9k—~593Automated safety check: PassMIT
X Bookmarkssharbelxyz/x-bookmarks289—~2kAutomated safety check: NotesNone
Wp Wpcli And OpsAutomattic/agent-skills2112 repos~988Automated safety check: PassNone

Similar skills

  • Schedule

    TinyAGI/tinyagi

    Create, list, and delete scheduled tasks (recurring or one-time) that send messages to agents.

    3.6k GitHub stars~1.4k tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check passed
  • Send User Message

    TinyAGI/tinyagi

    Send a proactive message to a paired user via their channel (Discord, Telegram, or WhatsApp).

    3.6k GitHub stars~829 tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check passed
  • Cron Ops

    czl9707/build-your-own-openclaw

    Create, list, and delete scheduled cron jobs. An agent skill from czl9707/build-your-own-openclaw.

    1.9k GitHub stars~593 tokensUpdated 3 mo ago
    Productivity & AutomationAuto-check passed
  • X Bookmarks

    sharbelxyz/x-bookmarks

    Fetch, summarize, and manage X/Twitter bookmarks via bird CLI or X API v2.

    289 GitHub stars~2k tokensUpdated 7 mo ago
    Productivity & AutomationAuto-check: notes
  • Wp Wpcli And Ops

    Automattic/agent-skills

    A skill your agent uses when working with WP-CLI (wp) for WordPress operations: safe search-replace, db export/import, plugin/theme/user/content management, cron, cache flushing, multisite, and…

    211 GitHub starsUsed in 2 repos~988 tokens
    Productivity & AutomationAuto-check passed
  • Ohdear

    ohdearapp/ohdear-cli

    Manage Oh Dear website monitoring using the ohdear CLI. An agent skill from ohdearapp/ohdear-cli.

    141 GitHub stars~1.1k tokensUpdated 1 mo ago
    Productivity & AutomationAuto-check passed

More from waynesutton/builder-skills

All 17 skills in this repo
  • Convex Agents

    waynesutton/builder-skills

    Builds AI agents on the Convex agent component: threads, messages, tools that call queries and mutations, streaming, RAG with vector search, and workflows for multi step jobs.

    406 GitHub stars~2.2k tokensUpdated 13 days ago
    Auto-check passed
  • Convex Best Practices

    waynesutton/builder-skills

    Production patterns for Convex apps and the rules the @convex-dev/eslint-plugin enforces: validators, indexes, idempotent mutations, avoiding OCC conflicts, thin function wrappers, error handling.

    406 GitHub stars~2.6k tokensUpdated 13 days ago
    Auto-check passed
  • Convex Component Authoring

    waynesutton/builder-skills

    Creates reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an npm publish setup.

    406 GitHub stars~2.6k tokensUpdated 13 days ago
    Auto-check passed
  • Convex HTTP Actions

    waynesutton/builder-skills

    Adds HTTP endpoints in convex/http.ts: webhook receivers with signature checks, REST style routes, CORS, auth headers, streaming responses, and file uploads over HTTP.

    406 GitHub stars~2.6k tokensUpdated 13 days ago
    Auto-check passed
  • Convex Migrations

    waynesutton/builder-skills

    Changes a live Convex schema without downtime: make a field optional, backfill in batches, flip the validator, then clean up.

    406 GitHub stars~2.1k tokensUpdated 13 days ago
    Auto-check passed
  • Convex Security Audit

    waynesutton/builder-skills

    Deep security review of a Convex app: authorization model, data access paths per table, HTTP action exposure, rate limiting, file storage access, scheduled function trust, and a written findings…

    406 GitHub stars~2.6k tokensUpdated 13 days ago
    Auto-check passed

Questions about Convex Cron Jobs

What does Convex Cron Jobs do?

Schedules work in Convex: cron jobs in convex/crons.ts, one off scheduled functions with runAfter and runAt, batching large jobs, and cancelling or inspecting the queue. Convex Cron Jobs is an agent skill from waynesutton/builder-skills.ts, one off scheduled functions with runAfter and runAt, batching large jobs, and cancelling or inspecting the queue.

When should I use Convex Cron Jobs?

Convex Cron Jobs fits situations like: something needs to run on a timer; in the background; A cron is not firing.

How do I install Convex Cron Jobs in Claude Code?

Run `npx skills add waynesutton/builder-skills --skill convex-cron-jobs -a claude-code`. Or copy the skill folder (skills/convex-cron-jobs in waynesutton/builder-skills) into .claude/skills/convex-cron-jobs in your project. Claude Code loads it when a task matches its description.

How do I install Convex Cron Jobs in Codex?

Run `npx skills add waynesutton/builder-skills --skill convex-cron-jobs -a codex`. Or copy the skill folder (skills/convex-cron-jobs in waynesutton/builder-skills) into .agents/skills/convex-cron-jobs in your project. Codex loads it when a task matches its description.

Can I use Convex Cron Jobs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add waynesutton/builder-skills --skill convex-cron-jobs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/convex-cron-jobs, .gemini/skills/convex-cron-jobs, .github/skills/convex-cron-jobs and .opencode/skills/convex-cron-jobs in your project.

What does Convex Cron Jobs need to run?

Going by SKILL.md and its folder, Convex Cron Jobs needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does Convex Cron Jobs access the network?

SKILL.md names 1 domain. As links in the text: docs.convex.dev. This is read from the text; nothing was executed.

Is Convex Cron Jobs safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Convex Cron Jobs use?

Convex Cron Jobs is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Convex Cron Jobs use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.5k tokens, read only when the agent opens those files.

What are the alternatives to Convex Cron Jobs?

Skills that share tags, products or a category with Convex Cron Jobs: Schedule (TinyAGI/tinyagi, 3.6k stars), Send User Message (TinyAGI/tinyagi, 3.6k stars), Cron Ops (czl9707/build-your-own-openclaw, 1.9k stars) and X Bookmarks (sharbelxyz/x-bookmarks, 289 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Convex Cron Jobs?

waynesutton (a GitHub user) maintains it in waynesutton/builder-skills, which has 406 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on September 28, 2026.

Source: waynesutton/builder-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.