vercel-schedules
БесплатноБез исполняемых скриптовНе проверенVercel Schedules guidance — run a private function, route, or Vercel Queues topic on a cron cadence or once at a set time. Covers static schedules in…
от vercel★ 356 звёзд на GitHubОб этом скилле
Vercel Schedules
You are an expert in Vercel Schedules, which runs code on a recurring cron cadence or once at a specific time.
Choose static or dynamic
| Static | Dynamic | |
|---|---|---|
| Defined in | vercel.json schedules (or Build Output API config.json) |
@vercel/schedules SDK or vercel schedules CLI |
| Takes effect | When the deployment becomes current for its environment/branch | Immediately |
| Targets | function, path, or topic |
topic only |
| One-time runs | No | Yes |
| Payload / namespace | No / always default |
Optional JSON (≤ 16 KB; 8 KB with --local) / any namespace |
| Update or delete | Edit config and redeploy | SDK or CLI |
Use static for jobs that belong to the app (nightly cleanup, hourly sync). Use dynamic for jobs the app creates for users (a reminder per customer, a report at 09:00 in each tenant's timezone).
Choose a target
| Target | Use when | Retries |
|---|---|---|
function (default) |
Any new static schedule. The handler has no public URL, and only Vercel's scheduler can invoke it, so there's no secret to manage. | No |
topic |
Failed runs must be retried, you need a payload, or the schedule is dynamic. | Yes, via Queues |
path |
Only when migrating an existing Cron Job and you don't want to change any code. | No |
Prefer function over path. A path target exposes your handler to the public internet, and its only protection is a static CRON_SECRET that you have to store, check on every request, and rotate. A function target has neither problem. Don't pick path for new schedules, and don't pick it because a route "already exists". Wrapping the route in handleSchedule and adding the trigger is a small change.
If a failed run must be retried, target a queue topic.
Quickstart: private function on a static schedule
npm i @vercel/schedules
// api/cleanup.ts
import { handleSchedule } from '@vercel/schedules';
export const POST = handleSchedule(async (metadata) => {
console.log(`${metadata.name} run ${metadata.executionId} for ${metadata.scheduledAt.toISOString()}`);
await deleteExpiredRecords();
});
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"functions": {
"api/cleanup.ts": {
"experimentalTriggers": [{ "type": "schedule/v1beta" }]
}
},
"schedules": {
"cleanup": {
"schedule": "0 * * * *",
"function": "api/cleanup"
}
}
}
Test locally, then deploy:
vercel dev # starts a local scheduler
vercel schedules invoke cleanup --local # second terminal: run it now
vercel deploy --prod
vercel schedules invoke cleanup # run once in production
Rules that break deployments
functionis the build output path relative to.vercel/output/functions, without.func— not the source filename.api/jobs/report.ts→api/jobs/report. When unsure, runvercel buildand look in.vercel/output/functions.- The target function must declare
{ "type": "schedule/v1beta" }, and it must be its only trigger. It can't also have aqueue/v2betatrigger. - Don't add routes or rewrites to a
schedule/v1betafunction. It is private by design. - For a function in a service, set
serviceplusfunctionrelative to.vercel/output/services/<name>/functions.vercel devcan't run these yet (DEV_SCHEDULE_SERVICE_FUNCTION_UNSUPPORTED). - Set exactly one of
function,path, ortopic. - A framework's Build Output API schedules and
vercel.jsonschedules with the same name fail withSCHEDULE_NAME_CONFLICT.
Static schedule properties
| Property | Notes |
|---|---|
schedule |
Required. Five-field cron, evaluated in timezone. |
timezone |
IANA name such as America/New_York. Defaults to UTC. Follows DST. |
jitter |
Minutes, 1–15. Defaults to 1 on Pro/Enterprise. Hobby is always 15. |
function / service |
Private function target (see rules above). |
path / requestMethod |
Public route target, for code-free Cron Jobs migration only. Path must start with /. Method defaults to POST. |
topic |
Vercel Queues topic. Letters, digits, _, -. |
The object key is the schedule name: 1–256 chars of ASCII letters, digits, ., _, -, starting with a letter or digit. Keep names stable. Renaming deletes the schedule and creates a new one with fresh state and history. On Hobby, a deployment can declare up to 100 static schedules. On every plan, the CLI rejects a vercel.json with more than 500 schedules entries (Vercel CLI 65.11+; older CLIs cap it at 100).
Cron syntax: digits, *, ,, -, / only. No MON/JAN names, and don't set both day-of-month and day-of-week.
Path targets (Cron Jobs migration only)
Use a path target only to move an existing Cron Job over without touching its route code. For anything else, use a function target.
Установить vercel-schedules в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл vercel-schedules?
Vercel Schedules guidance — run a private function, route, or Vercel Queues topic on a cron cadence or once at a set time. Covers static schedules in vercel.json, dynamic per-user schedules with @vercel/schedules, handleSchedule, the vercel schedules CLI, environments, jitter, and migrating from Cron Jobs. Use when adding scheduled or recurring work, one-time reminders, or replacing `crons`.
Как установить скилл vercel-schedules?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vercel-schedules запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic