Enables Payload's built-in schedulePublish drafts feature on selected collections and globals, routes the resulting jobs into an isolated queue, and adds a Bearer-token-protected endpoint that a cron calls to run due jobs. Each scheduled publish runs with the rights of the user who scheduled it, rechecked at run time. Requires Payload 3.90 or later, the companion guard plugin, and a config wrapped in withAccessPolicy.
Schedule publication plugin for Payload CMS
Installation
npm i @focus-reactive/payload-plugin-scheduling37
Stars
5
Forks
33
Open Issues
Today
Last Updated
385
Weekly Downloads
v2.0.1
npm Version
39.8 KB
Unpacked Size
1
Dependencies
37+22 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 37 |
| Dec 5, 2026 | 37 |
| Dec 4, 2026 | 37 |
| Dec 3, 2026 | 37 |
| Dec 2, 2026 | 37 |
| Dec 1, 2026 | 36 |
| Nov 30, 2026 | 35 |
| Nov 29, 2026 | 35 |
| Nov 28, 2026 | 34 |
| Nov 27, 2026 | 34 |
| Nov 26, 2026 | 34 |
| Nov 25, 2026 | 34 |
| Nov 24, 2026 | 34 |
| Nov 23, 2026 | 34 |
| Nov 22, 2026 | 34 |
| Nov 21, 2026 | 34 |
| Nov 20, 2026 | 33 |
| Nov 19, 2026 | 32 |
| Nov 18, 2026 | 32 |
| Nov 17, 2026 | 32 |
| Nov 16, 2026 | 32 |
| Nov 15, 2026 | 32 |
| Nov 14, 2026 | 32 |
| Nov 13, 2026 | 32 |
| Nov 12, 2026 | 32 |
| Nov 11, 2026 | 32 |
| Nov 10, 2026 | 32 |
| Nov 9, 2026 | 31 |
| Nov 8, 2026 | 31 |
| Nov 7, 2026 | 31 |
| Nov 6, 2026 | 31 |
| Nov 5, 2026 | 31 |
| Nov 4, 2026 | 30 |
| Nov 3, 2026 | 30 |
| Nov 2, 2026 | 30 |
| Nov 1, 2026 | 30 |
| Oct 31, 2026 | 30 |
| Oct 30, 2026 | 30 |
| Oct 29, 2026 | 30 |
| Oct 28, 2026 | 30 |
| Oct 27, 2026 | 30 |
| Oct 26, 2026 | 30 |
| Oct 25, 2026 | 30 |
| Oct 24, 2026 | 29 |
| Oct 23, 2026 | 29 |
| Oct 22, 2026 | 29 |
| Oct 21, 2026 | 29 |
| Oct 20, 2026 | 29 |
| Oct 19, 2026 | 29 |
| Oct 18, 2026 | 29 |
| Oct 17, 2026 | 27 |
| Oct 16, 2026 | 26 |
| Oct 15, 2026 | 26 |
| Oct 14, 2026 | 26 |
| Oct 13, 2026 | 25 |
| Oct 12, 2026 | 25 |
| Oct 11, 2026 | 25 |
| Oct 10, 2026 | 25 |
| Oct 9, 2026 | 25 |
| Oct 8, 2026 | 25 |
| Oct 7, 2026 | 25 |
| Oct 6, 2026 | 24 |
| Oct 5, 2026 | 24 |
| Oct 4, 2026 | 24 |
| Oct 3, 2026 | 23 |
| Oct 2, 2026 | 22 |
| Oct 1, 2026 | 22 |
| Sep 30, 2026 | 20 |
| Sep 29, 2026 | 20 |
| Sep 28, 2026 | 20 |
| Sep 27, 2026 | 20 |
| Sep 26, 2026 | 19 |
| Sep 25, 2026 | 18 |
| Sep 24, 2026 | 18 |
| Sep 23, 2026 | 18 |
| Sep 22, 2026 | 18 |
| Sep 21, 2026 | 18 |
| Sep 20, 2026 | 18 |
| Sep 19, 2026 | 18 |
| Sep 18, 2026 | 18 |
| Sep 17, 2026 | 18 |
| Sep 16, 2026 | 18 |
| Sep 15, 2026 | 18 |
| Sep 14, 2026 | 18 |
| Sep 13, 2026 | 17 |
| Sep 12, 2026 | 17 |
| Sep 11, 2026 | 17 |
| Sep 10, 2026 | 16 |
| Sep 9, 2026 | 16 |
| Sep 8, 2026 | 16 |
| Sep 7, 2026 | 15 |
Shared by 15 plugins in focusreactive/payload-plugins.
385+210 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 385 |
| Dec 5, 2026 | 388 |
| Dec 4, 2026 | 361 |
| Dec 3, 2026 | 377 |
| Dec 2, 2026 | 349 |
| Dec 1, 2026 | 327 |
| Nov 30, 2026 | 336 |
| Nov 29, 2026 | 322 |
| Nov 28, 2026 | 321 |
| Nov 27, 2026 | 439 |
| Nov 26, 2026 | 522 |
| Nov 25, 2026 | 588 |
| Nov 24, 2026 | 613 |
| Nov 23, 2026 | 677 |
| Nov 22, 2026 | 754 |
| Nov 21, 2026 | 733 |
| Nov 20, 2026 | 665 |
| Nov 19, 2026 | 621 |
| Nov 18, 2026 | 695 |
| Nov 17, 2026 | 687 |
| Nov 16, 2026 | 626 |
| Nov 15, 2026 | 659 |
| Nov 14, 2026 | 766 |
| Nov 13, 2026 | 801 |
| Nov 12, 2026 | 814 |
| Nov 11, 2026 | 887 |
| Nov 10, 2026 | 902 |
| Nov 9, 2026 | 994 |
| Nov 8, 2026 | 933 |
| Nov 7, 2026 | 901 |
| Nov 6, 2026 | 847 |
| Nov 5, 2026 | 864 |
| Nov 4, 2026 | 659 |
| Nov 3, 2026 | 635 |
| Nov 2, 2026 | 673 |
| Nov 1, 2026 | 681 |
| Oct 31, 2026 | 605 |
| Oct 30, 2026 | 612 |
| Oct 29, 2026 | 475 |
| Oct 28, 2026 | 416 |
| Oct 27, 2026 | 424 |
| Oct 26, 2026 | 287 |
| Oct 25, 2026 | 218 |
| Oct 24, 2026 | 208 |
| Oct 23, 2026 | 125 |
| Oct 22, 2026 | 168 |
| Oct 21, 2026 | 251 |
| Oct 20, 2026 | 241 |
| Oct 19, 2026 | 244 |
| Oct 18, 2026 | 280 |
| Oct 17, 2026 | 283 |
| Oct 16, 2026 | 405 |
| Oct 15, 2026 | 427 |
| Oct 14, 2026 | 416 |
| Oct 13, 2026 | 415 |
| Oct 12, 2026 | 404 |
| Oct 11, 2026 | 467 |
| Oct 10, 2026 | 470 |
| Oct 9, 2026 | 369 |
| Oct 8, 2026 | 348 |
| Oct 7, 2026 | 372 |
| Oct 6, 2026 | 391 |
| Oct 5, 2026 | 709 |
| Oct 4, 2026 | 660 |
| Oct 3, 2026 | 723 |
| Oct 2, 2026 | 734 |
| Oct 1, 2026 | 760 |
| Sep 30, 2026 | 728 |
| Sep 29, 2026 | 732 |
| Sep 28, 2026 | 418 |
| Sep 27, 2026 | 371 |
| Sep 26, 2026 | 262 |
| Sep 25, 2026 | 245 |
| Sep 24, 2026 | 192 |
| Sep 23, 2026 | 142 |
| Sep 22, 2026 | 153 |
| Sep 21, 2026 | 154 |
| Sep 20, 2026 | 148 |
| Sep 19, 2026 | 243 |
| Sep 18, 2026 | 265 |
| Sep 17, 2026 | 359 |
| Sep 16, 2026 | 462 |
| Sep 15, 2026 | 516 |
| Sep 14, 2026 | 578 |
| Sep 13, 2026 | 579 |
| Sep 12, 2026 | 507 |
| Sep 11, 2026 | 503 |
| Sep 10, 2026 | 420 |
| Sep 9, 2026 | 339 |
| Sep 8, 2026 | 245 |
| Sep 7, 2026 | 175 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1177993877-payload-plugin-scheduling)<a href="https://payloaddirectory.dev/plugins/1177993877-payload-plugin-scheduling"><img src="https://payloaddirectory.dev/badge/1177993877-payload-plugin-scheduling.svg" alt="Payload Directory"></a>README
Scheduled publication plugin for Payload CMS v3. Set a future publish date on any draft document and it goes live automatically, with no manual publishing.
The plugin enables Payload's built-in schedulePublish drafts feature on selected collections and globals, routes the resulting jobs through an isolated queue, and exposes a Bearer-token-protected endpoint that your cron calls to run the queue.
A scheduled publish runs with the rights of the user who scheduled it, checked again when it runs.
The plugin is built on @focus-reactive/payload-plugin-guard.
Requirements: Payload ^3.90.0, @focus-reactive/payload-plugin-guard, and a config wrapped in withAccessPolicy.
Copy and paste this prompt into your AI assistant (Cursor, Claude, etc.) to integrate the plugin into an existing Payload project.
I want to add scheduled publication to my Payload CMS v3 project using
@focus-reactive/payload-plugin-scheduling. Follow these steps in order, and stop to ask me where a step says so.
## Rules you must follow
- Never write an access rule that admits every logged-in user: no `Boolean(req.user)`, no `() => true`,
no `({ req }) => !!req.user`. A rule names a role, or it is `nobody`.
- Do not invent roles. Ask me which roles may publish each collection and global.
- Write every policy entry by hand in `src/access.policy.ts`, and grant each capability and each
collection right explicitly to the roles I name. Nothing is open by default.
- When the boot or a request fails, fix the cause or ask me. Never use `anyone`, a looser gate,
`overrideAccess` or a removed or disabled check to make an error go away.
- Do not add `overrideAccess: true` anywhere.
- The cron secret goes only into the server's environment, never into a `NEXT_PUBLIC_` variable.
## How it works
The plugin turns on Payload's "Schedule Publish" date picker on the collections and globals I list.
Scheduling creates a job that remembers the user who scheduled it. The job only runs if that user still
may use the admin and still may update the document; otherwise it fails and the document stays a draft.
Only users who may update a document can cancel its pending schedules.
A cron calls `GET /api/scheduled-publish/run` with `Authorization: Bearer <secret>` to run due jobs.
The plugin declares no capabilities: who may publish comes from the `update` rule of each collection or
global in the access policy.
## Step 1: install
pnpm add @focus-reactive/payload-plugin-scheduling @focus-reactive/payload-plugin-guard
Check that `payload` is 3.90 or later; if it is not, upgrade it first.
## Step 2: ask me about roles
Ask me which collections and globals should get scheduled publishing.
For each of them, look at its `update` rule in the access policy; if it has none, ask me which roles may
publish it. Ask me which roles may run Payload's job queue by hand (`jobs.run`); the safe answer is
admins only.
## Step 3: the access policy file
Open `src/access.policy.ts`, or create it if the project has none, following the guard README
(`defineAccessPolicy`, `gate`, `filter`, `nobody`, checked with `satisfies AccessPolicy<Config>`).
If you create it, every collection and global of the config needs an entry: move each existing
`access` of the project into the file, and ask me for every rule you cannot read from the code.
Make sure it has these entries:
collections: {
"payload-jobs": "payload-default",
},
jobs: { run: <gate from step 2>, queue: <gate from step 2>, cancel: <gate from step 2> },
plugins: {
"scheduled-publish": {},
},
## Step 4: register the plugin and wrap the config
// payload.config.ts
import { buildConfig } from 'payload'
import { withAccessPolicy } from '@focus-reactive/payload-plugin-guard'
import { schedulePublicationPlugin } from '@focus-reactive/payload-plugin-scheduling'
import { accessPolicy } from './access.policy'
export default withAccessPolicy(
accessPolicy,
buildConfig({
// ...the existing config
plugins: [
schedulePublicationPlugin({
collections: ['pages'],
globals: [],
secret: process.env.CRON_SECRET,
access: accessPolicy.plugins['scheduled-publish'],
}),
],
})
)
Add `CRON_SECRET` to `.env` with a long random placeholder and tell me to replace it.
Add a cron that calls `GET /api/scheduled-publish/run` with `Authorization: Bearer <CRON_SECRET>`
(on Vercel, a `crons` entry in `vercel.json`; Vercel sends `CRON_SECRET` itself).
Start the app. A missing or wrong policy entry stops the boot with a list of what to fix.
Fix each item; never loosen a rule to make an error go away.
## Step 5: verify, and show me the output
With the app running, send each request and show me the status code.
Every one of them must be refused. If one succeeds, the setup is wrong: stop and tell me.
1. No secret, expect 401:
curl -i http://localhost:3000/api/scheduled-publish/run
2. A wrong secret, expect 401:
curl -i http://localhost:3000/api/scheduled-publish/run -H 'Authorization: Bearer wrong'
3. An admin session without the secret, expect 401:
curl -i http://localhost:3000/api/scheduled-publish/run -H 'Cookie: <admin cookie>'
4. Creating a job over REST as an admin, expect 403:
curl -i -X POST http://localhost:3000/api/payload-jobs -H 'Content-Type: application/json' -H 'Cookie: <admin cookie>' -d '{}'
Then, as a user who may update a page, schedule a publish one minute ahead, call the endpoint with the
secret after that minute, and check that the page is published.
Editor sets "Schedule Publish" date in Payload Admin
↓
Payload creates a schedulePublish job that names the editor
↓
The plugin checks the editor may update the document, and routes the job to the "scheduled-publish" queue
↓
Cron calls GET /api/scheduled-publish/run with the secret
↓
For each due job, the plugin checks again that the editor may use the admin and update the document
↓
Payload publishes the document as the editor
The plugin hooks into Payload's own schedulePublish task; it does not implement its own publish logic.
It leaves jobs.runHooks as your config sets it.
Keep it off on Payload 3.90: with it on, Payload fails every job of the app after its handler has run, because the job's log entry does not pass validation.
pnpm add @focus-reactive/payload-plugin-scheduling @focus-reactive/payload-plugin-guard
Peer dependencies: payload ^3.90.0
The plugin declares no capabilities, but the guard needs an entry for it.
Who may publish a document is the update rule of its collection or global.
// src/access.policy.ts
export const accessPolicy = defineAccessPolicy({
collections: {
// ...your collections
"payload-jobs": "payload-default",
},
globals: {
// ...your globals
},
jobs: { run: isAdmin, queue: isAdmin, cancel: isAdmin },
plugins: {
"scheduled-publish": {},
},
}) satisfies AccessPolicy<Config>;
jobs.run decides who may run Payload's own /api/payload-jobs/run; keep it to admins.
Every scheduled publish is checked against its scheduler whichever way the queue runs.
// payload.config.ts
import { buildConfig } from "payload";
import { withAccessPolicy } from "@focus-reactive/payload-plugin-guard";
import { schedulePublicationPlugin } from "@focus-reactive/payload-plugin-scheduling";
import { accessPolicy } from "./access.policy";
export default withAccessPolicy(
accessPolicy,
buildConfig({
plugins: [
schedulePublicationPlugin({
collections: ["pages"],
secret: process.env.CRON_SECRET,
access: accessPolicy.plugins["scheduled-publish"],
}),
],
})
);
The plugin injects into every configured collection and global versions.drafts.schedulePublish: true, which enables the "Schedule Publish" date picker in the admin sidebar.
The endpoint GET /api/scheduled-publish/run must be called at least as often as your finest scheduling granularity.
It runs all due jobs in the queue and returns { "ok": true }.
{
"crons": [
{
"path": "/api/scheduled-publish/run",
"schedule": "* * * * *"
}
]
}
Vercel sends CRON_SECRET as Authorization: Bearer $CRON_SECRET when it triggers a cron.
Set CRON_SECRET in the Vercel project settings and pass it to the plugin's secret option.
curl -X GET https://your-cms.com/api/scheduled-publish/run \
-H "Authorization: Bearer YOUR_SECRET"
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
access | accessPolicy.plugins["scheduled-publish"] | Yes | none | The plugin's entry from your access policy |
secret | string | undefined | Yes | none | Bearer token for the run endpoint; when empty the endpoint is not added |
collections | string[] | No | [] | Collection slugs to enable scheduled publishing on |
globals | string[] | No | [] | Global slugs to enable scheduled publishing on |
queue | string | No | "scheduled-publish" | Queue name for scheduled publish jobs |
schedulePublish | SchedulePublish | No | true | Options for the date picker, such as timeIntervals to match your cron |
GET /api/scheduled-publish/run needs Authorization: Bearer <secret>; the secret is compared in constant time.
A session cookie is not enough, whatever the user's role.
Without a secret the endpoint is not registered and the server logs a warning.The endpoint answers:
| Status | When |
|---|---|
200 | { "ok": true }, due jobs were run |
401 | missing or wrong secret |
500 | the jobs runner threw |
versions config, the plugin adds { drafts: { schedulePublish: true } }.versions is true or has drafts: true, the plugin replaces drafts with { schedulePublish: true }.versions.drafts is an object, the plugin merges schedulePublish: true into it and keeps other draft options such as autosave.2.0 moves the plugin onto @focus-reactive/payload-plugin-guard; Upgrading to the guard explains the model all the plugins share, with a complete example.
Every access rule is now written by hand in your project's src/access.policy.ts, and nothing is open by default: an entry you leave out stops the boot, and a capability you do not grant is refused for everyone.
@payloadcms/* package 3.90 or later, with the React and Next versions Payload 3.90 requires, Node 22.22 or later, and @focus-reactive/payload-plugin-guard installed next to the plugin.access is a required option; the plugin declares no capabilities, so it is the empty scheduled-publish entry of the policy.user are refused; schedule from the admin, or queue the job with a user who may update the document.jobs.runHooks, which made every job of the app fail after it ran.
Hooks your project added to the jobs collection now run when a job is queued or run only if you set jobs.runHooks yourself.secret may be empty: the run endpoint is then not registered, instead of answering every request with 401.Upgrade payload and every @payloadcms/* package to 3.90 or later, run the server on Node 22.22 or later, and install the guard:
pnpm add @focus-reactive/payload-plugin-guard @focus-reactive/payload-plugin-scheduling.
Add the plugin's entries to src/access.policy.ts, with gates for your own roles; if the project has no policy file yet, write it first as the guide describes.
// src/access.policy.ts, inside defineAccessPolicy({ ... })
collections: {
"payload-jobs": "payload-default",
},
jobs: { run: isAdmin, queue: isAdmin, cancel: isAdmin },
plugins: {
"scheduled-publish": {},
},
update rule of the document's collection or global; there is no capability of its own.jobs.run decides who may call Payload's own /api/payload-jobs/run; keep it to admins.Pass access: accessPolicy.plugins["scheduled-publish"] to schedulePublicationPlugin, and export the config wrapped: export default withAccessPolicy(accessPolicy, buildConfig({ ... })).
Database: no migration; the plugin adds no fields.
Re-test: GET /api/scheduled-publish/run without the bearer secret answers 401, also with an admin's session cookie; schedule a publish as an editor and check that it runs; remove that editor's update right and check that the next due job fails and leaves the document as it was.
| Import path | Exports |
|---|---|
@focus-reactive/payload-plugin-scheduling | schedulePublicationPlugin, SchedulePublicationPluginConfig |
Topics
Tags
payload plugin comments
Document-level and field-level comments with mentions, resolution and email notifications for Payload admin
757.0k/wk37v3
payload plugin html preview
Live preview and click-to-edit in the Payload admin for any frontend that renders HTML, no framework needed
74451/wk37v3
payload plugin workflows
Code-defined editorial workflows with stages, actions, transitions and publish guards for editors and AI agents
73797/wk37v3
payload plugin netlify deploy
Deploy button in the Payload admin that builds a Netlify site, streams the log, and publishes a preview
72370/wk37v3
payload plugin presets
Save and apply reusable block configurations as presets from the Payload admin blocks drawer
786.7k/wk37v3
payload plugin audit log
Append-only audit log of document, global and auth changes with CSV and NDJSON export
72394/wk37v3