Agent Skills
› openai/plugins
› cron-jobs
cron-jobs
GitHub指导在vercel.json中配置、编辑和调试Vercel定时任务。涵盖Cron语法、API路由路径要求、CRON_SECRET鉴权验证,以及Hobby/Pro计划的配额限制与常见调度模式。
Trigger Scenarios
添加或修改Vercel定时任务
调试Vercel cron执行问题
配置vercel.json中的crons字段
Install
npx skills add openai/plugins --skill cron-jobs -g -y
SKILL.md
Frontmatter
{
"name": "cron-jobs",
"metadata": {
"docs": [
"https:\/\/vercel.com\/docs\/cron-jobs"
],
"sitemap": "https:\/\/vercel.com\/sitemap\/docs.xml",
"priority": 6,
"bashPatterns": [],
"pathPatterns": [
"vercel.json",
"apps\/*\/vercel.json"
]
},
"description": "Vercel Cron Jobs configuration and best practices. Use when adding, editing, or debugging scheduled tasks in vercel.json."
}
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
Version History
- 11c74d6 Current 2026-07-19 09:51


