Introducing Scheduled Functions

Published: May 7, 2026

v2026-05-07

Scheduled Functions are now available. They run on a timer instead of in response to document events. Use them for daily digests, cache expiration, periodic content syncs, or any task that needs to happen on a fixed cadence.

Run code on a schedule

Define a scheduled function with defineScheduledFunction from @sanity/blueprints. Schedules accept either a UNIX cron expression or an explicit object with minute, hour, dayOfWeek, month, and dayOfMonth fields.

Inside the function, the scheduledEventHandler helper from @sanity/functions gives you typed access to the run context.

Get started

Add a scheduled function with the CLI:

Scheduled functions run independently of any single project, so they require an organization-scoped blueprint stack. If your stack is project-scoped, run npx sanity@latest blueprints promote before deploying.

Read the Create a Scheduled Function quickstart for a step-by-step walkthrough, or browse the Functions documentation.

Loading...
Introducing Scheduled Functions | Sanity Docs