APScheduler integration for Vercel Queues
Actively maintained. Last release 11 days ago. A safe choice.
pip install vercel-apschedulerREADME as published on PyPI with version 0.4.2.
Vercel APScheduler integration
Run APScheduler 3.x schedules through delayed Vercel Queue messages, on a managed job store. No scheduler infrastructure to provision or operate.
Configure the scheduler
Declare an ordinary scheduler; do not configure a job store. The integration injects its managed store and uses it for lifecycle coordination:
from apscheduler.schedulers.blocking import BlockingScheduler
scheduler = BlockingScheduler(timezone="UTC")
@scheduler.scheduled_job(
"cron",
hour=4,
id="cleanup",
)
def cleanup() -> None: ...
Declare that object as a Python subscriber:
[[tool.vercel.subscribers]]
entrypoint = "scheduler:scheduler"
The Vercel Python builder detects APScheduler before importing the subscriber, installs the integration, and extracts its internal Queue subscriptions from the same registry used by Celery and Dramatiq. Topic names, consumer groups, scheduler IDs, and installation hooks are not application configuration.
The scheduler's durable identity derives from the builder-assigned subscriber
id, so renaming variables or moving modules never orphans state. The
scheduler_id integration option pins an identity explicitly.
Job stores under other aliases are treated as source stores — read-only views whose schedules an external system (typically a database) owns.
Automatic activation
Production deployments activate automatically on their first real request. The integration is registered while the application imports, but the durable transition and first Queue send are deferred until the runtime has installed that request's OIDC credentials. Builds never enqueue messages.
Preview deployments are inactive by default. Opt a project into request-driven preview scheduling with:
[tool.vercel.apscheduler.previews]
enabled = true
idle_timeout = "30m"
Each active Function runtime renews the preview's durable activity deadline on incoming requests, throttled to at most once every five minutes (or one third of a shorter timeout). This is not a background timer and it does not emit periodic Queue messages. If no request renews the deadline:
- a queued start or wake becomes stale before it can run;
- an in-flight wake may finish its current work but cannot publish a successor; and
- the next request creates one new generation and skips occurrences from the inactive interval.