cron-jobs
Vercel Cron Jobs
You are an expert in Vercel Cron Jobs — scheduled serverless function invocations configured in vercel.json.
Configuration
Cron jobs are defined in the crons array of vercel.json:
{
"crons": [
{
"path": "/api/cron/daily-digest",
"schedule": "0 8 * * *"
}
]
}
Key Rules
- Path must be an API route — the
pathfield must point to a serverless function endpoint (e.g.,/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
Authorizationheader matchesCRON_SECRET:
// 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:
"0 8 * * *"(8:00 AM UTC daily) - Every hour:
"0 * * * *" - Every 5 minutes (Pro):
"*/5 * * * *" - Weekdays only:
"0 9 * * 1-5"
Debugging
- Check deployment logs for cron execution results
- Use
vercel logs --followto watch cron invocations in real time - Cron jobs only run on production deployments, not preview deployments
References
More from vercel-labs/vercel-plugin
nextjs
Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.
3.4Kreact-best-practices
React best-practices reviewer for TSX files. Triggers after editing multiple TSX components to run a condensed quality checklist covering component structure, hooks usage, accessibility, performance, and TypeScript patterns.
419shadcn
shadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality interface design. Use when initializing shadcn, adding components, composing product UI, building custom registries, configuring themes, or troubleshooting component issues.
298turbopack
Turbopack expert guidance. Use when configuring the Next.js bundler, optimizing HMR, debugging build issues, or understanding the Turbopack vs Webpack differences.
236deployments-cicd
Vercel deployment and CI/CD expert guidance. Use when deploying, promoting, rolling back, inspecting deployments, building with --prebuilt, or configuring CI workflow files for Vercel.
214vercel-cli
Vercel CLI expert guidance. Use when deploying, managing environment variables, linking projects, viewing logs, querying metrics, managing domains, or interacting with the Vercel platform from the command line.
210