cron-jobs
Original:🇺🇸 English
Translated
Vercel Cron Jobs configuration and best practices. Use when adding, editing, or debugging scheduled tasks in vercel.json.
3installs
Added on
NPX Install
npx skill4agent add vercel-labs/vercel-plugin cron-jobsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Vercel Cron Jobs
You are an expert in Vercel Cron Jobs — scheduled serverless function invocations configured in .
vercel.jsonConfiguration
Cron jobs are defined in the array of :
cronsvercel.jsonjson
{
"crons": [
{
"path": "/api/cron/daily-digest",
"schedule": "0 8 * * *"
}
]
}Key Rules
- Path must be an API route — the field must point to a serverless function endpoint (e.g.,
path)/api/cron/... - Schedule uses standard cron syntax — five-field format:
minute hour day-of-month month day-of-week - Verify the request origin — always check the header matches
Authorization:CRON_SECRET
ts
// app/api/cron/route.ts
export async function GET(request: Request) {
const authHeader = request.headers.get("authorization");
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response("Unauthorized", { status: 401 });
}
// ... your scheduled logic
return Response.json({ ok: true });
}- Hobby plan limits — max 2 cron jobs, minimum interval of once per day
- Pro plan — up to 40 cron jobs, minimum interval of once per minute
- Max duration — cron-triggered functions follow normal function duration limits
Common Patterns
- Daily digest: (8:00 AM UTC daily)
"0 8 * * *" - Every hour:
"0 * * * *" - Every 5 minutes (Pro):
"*/5 * * * *" - Weekdays only:
"0 9 * * 1-5"
Debugging
- Check deployment logs for cron execution results
- Use to watch cron invocations in real time
vercel logs --follow - Cron jobs only run on production deployments, not preview deployments