Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  • function is the build output path relative to .vercel/output/functions, without .func — not the source filename. api/jobs/report.ts → api/jobs/report. When unsure, run vercel build and 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 a queue/v2beta trigger.
  • Don't add routes or rewrites to a schedule/v1beta function. It is private by design.
  • For a function in a service, set service plus function relative to .vercel/output/services/<name>/functions. vercel dev can't run these yet (DEV_SCHEDULE_SERVICE_FUNCTION_UNSUPPORTED).
  • Set exactly one of function, path, or topic.
  • A framework's Build Output API schedules and vercel.json schedules with the same name fail with SCHEDULE_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.

Полный SKILL.md на GitHub

Установить vercel-schedules в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.vercel.approvers

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), без исполняемых скриптов.

Похожие скиллы

Сравнить vercel-schedules с