Schedule Publication

Enable automatic scheduled publishing of draft documents in Payload v3, triggered by a cron-pinged Bearer-protected endpoint.

Community 16 260/wk MIT v1.3.0

Installation

pnpm add @focus-reactive/payload-plugin-scheduling

About

This plugin turns on Payload's built-in `schedulePublish` drafts feature for the collections and globals you choose, so editors can pick a future publish date in the admin sidebar and the document goes live on its own. It does not reimplement publishing. It enables the native feature, routes the resulting jobs into a dedicated queue, and exposes an HTTP endpoint that a cron drains on a schedule. Integration happens in `payload.config.ts`. You pass an array of collection slugs (and optionally global slugs) plus a secret string. The plugin merges `versions.drafts.schedulePublish: true` into each configured config, preserving any existing versions and drafts settings rather than overwriting them. A `beforeChange` hook on the jobs collection tags any job whose `taskSlug` is `schedulePublish` with the configured queue name (default `scheduled-publish`), keeping those jobs isolated from other background work. The plugin registers `GET /api/scheduled-publish/run`. When hit with a matching `Authorization: Bearer <secret>` header, the handler calls `payload.jobs.run({ queue })` and returns `{ ok: true }`. Wrong or missing tokens get a 401. You are responsible for calling this endpoint as often as your finest scheduling granularity. The README documents Vercel crons (via `vercel.json`, where Vercel auto-sends `CRON_SECRET` as the bearer header), plain `curl`, and `node-cron`. If the `secret` option is empty or missing, the plugin disables itself and logs a warning rather than registering the endpoint, so a missing environment variable will not break the build. A `schedulePublish` option lets you pass a `SchedulePublish` config (such as `timeIntervals`) to align the date picker with your cron cadence. The queue name is configurable if it collides with another queue.

Package info

Package name
@focus-reactive/payload-plugin-scheduling
Latest version
1.3.0
Unpacked size
24 kB
License
MIT
Weekly downloads
260
Last publish
Jun 18, 2026

More from focusreactive

View profile

Similar plugins

More in Content