Studio

Scheduled drafts

Scheduled drafts lets you schedule single-document releases for a time in the future.

Sometimes you want to schedule a single draft to go live, but don't need the full power of content releases. Scheduled drafts lets content editors schedule, and lock, a single document. It shows up as a special type of content release and is visible for other editors to see. If you need to schedule many drafts at once, Content Releases may be a better option.

This is a paid feature

This feature is available in the Growth plan.

Prerequisites:

  • Studio v4.14.0 or later is required to use this feature.
  • When using the API to create scheduled drafts, API version v2025-02-19 or later is required.
  • Drafts must be enabled in your studio configuration. This is the default setting, so no changes are needed unless you've previously disabled the drafts feature.

This guide covers common usage, how to disable the feature, and how to interact with scheduled drafts programmatically.

Basic usage

To learn more about scheduling drafts, viewing scheduled drafts, and the workflow within Studio's interface, visit the scheduled drafts user guide.

Referenced documents must be published

Studio validates the draft before letting you schedule it. A strong reference is valid only when the document it points to already exists as a published document. A draft that references an unpublished document fails validation with Referenced document must be published, and the Schedule publish action is disabled with the tooltip Cannot Schedule Draft due to validation errors in the current draft.

In a multi-document release, a version can strongly reference another document that is a version in the same release, because publishing the release publishes both at once. A scheduled draft is a single-document release, and Studio offers no way to add a second document to one, so that option isn't available here. You have three options:

  • Publish the referenced document first, then schedule the draft that points to it.
  • Use a content release instead of a scheduled draft when both documents have to go live at the same time.
  • Make the reference weak. A weak reference publishes without waiting for its target, and resolves once the target is published. See Weak references to unpublished documents.

Configure document actions

Like other document actions, you can control the criteria for when an action is displayed. In the case of scheduled drafts, check against the action's display name: SchedulePublishAction.

Disable by schema type

In this example, documents of type movie don't display the Schedule publish action.

import {defineConfig} from 'sanity'

export default defineConfig({
  // ...
  document: {
    actions: (prev, {schemaType}) => {
      if (schemaType === 'movie'){
        return prev.filter((action) => action.displayName !== 'SchedulePublishAction')
      }
      return prev
    }
  }
})

Restrict to specific user roles

In this example, only administrator users can schedule drafts.

import {defineConfig} from 'sanity'

export default defineConfig({
  // ...
  document: {
    actions: (prev, {currentUser}) => {
      if (!currentUser?.roles.some(({name}) => name === 'administrator')) {
        return prev.filter((action) => action.displayName !== 'SchedulePublishAction')
      }
      return prev
    }
  }
})

Disable scheduled drafts studio-wide

If you'd like to disable the ability for editors to create scheduled drafts, modify your sanity.config.ts file to include the following.

import {defineConfig} from 'sanity'

export default defineConfig({
  // ...
  scheduledDrafts: {
    enabled: false
  }
  // ...
})

Query all scheduled drafts

Scheduled drafts are essentially single-document content releases. You can query them in GROQ with the following query:

releases::all()[metadata.cardinality == "one" && state == "scheduled"]{
  "scheduledDraftDocs": *[
    sanity::partOfRelease(string::split(^._id, ".")[2])
  ]
}.scheduledDraftDocs[]

Schedule drafts programmatically

The scheduled drafts feature is a part of Content Releases. It uses the actions API to create releases and version documents, then schedule them for publishing.

To mimic the way Studio creates scheduled drafts:

  • Create a release with the metadata of releaseType: 'scheduled', cardinality: 'one', and an intendedPublishAt time in the future.
  • Create a version document on the release associated with the draft document's ID.
  • Schedule the release.

You must already have a draft of the document, or create one first. Here's an example using the Sanity client.

You can then call the createNewScheduledDraft function with the document's published ID and a publish time to schedule the draft.

import {createClient} from '@sanity/client'

const sanityClient = createClient({
  projectId: '',
  dataset: 'production',
  apiVersion: '2025-02-19',
  token: process.env.SANITY_API_TOKEN,
})

const createNewScheduledDraft = async (documentId: string, publishAt: Date) => {
  const newScheduledDraftRelease = await sanityClient.releases.create({
    metadata: {
      title: 'New Scheduled Draft',
      releaseType: 'scheduled',
      cardinality: 'one', // this marks the release as a scheduled draft
      intendedPublishAt: publishAt.toISOString(),
    },
  })
  const scheduledDraftReleaseId = newScheduledDraftRelease.releaseId

  await sanityClient.createVersion({
    publishedId: documentId,
    // create a new scheduled draft of the current draft
    baseId: `drafts.${documentId}`,
    releaseId: scheduledDraftReleaseId,
  })

  await sanityClient.releases.schedule({
    releaseId: scheduledDraftReleaseId,
    publishAt: publishAt.toISOString(),
  })

  return scheduledDraftReleaseId
}

Replace with your project ID. Set the SANITY_API_TOKEN environment variable to an API token with write access, because the script creates releases and version documents.

Scheduling drafts in bulk

Scheduled drafts publishing flow

Scheduled drafts share a similar state-change flow with Content Releases, where the release document moves through various states. For more details, see the Content Releases release state documentation.

Permissions

Scheduled drafts are built on Content Releases: each scheduled draft is a single-document release. To schedule a draft of a document, your role must have publish permissions on that document type. Roles without publish permissions cannot schedule drafts.

For details on configuring custom roles, restricting access to releases, and the underlying permission model, see Content Releases configuration.

Was this page helpful?

Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change site theme