Skip to content

Scheduling

AI Context Items integrate with the Scheduler module to support scheduled publishing and unpublishing of context items.

Scheduling is an optional feature. The Scheduler modules are not required to install AI Context, and the scheduling fields stay hidden until you turn them on, even when Scheduler is installed.

How it works

Once scheduling is enabled (see Requirements and Configuration), the Scheduling options section appears in the sidebar when editing a context item. You can set:

  • Publish on -- a future date/time when the item should be published
  • Unpublish on -- a future date/time when the item should be unpublished

When cron runs and the scheduled time has passed, Scheduler automatically changes the item's moderation state.

Requirements

Scheduling requires these optional modules:

Install both with Composer and enable them:

composer require drupal/scheduler drupal/scheduler_content_moderation_integration
drush pm:install scheduler scheduler_content_moderation_integration

Enabling Scheduler seeds the AI Context scheduling settings automatically. The date fields remain hidden on the context item form until you turn scheduling on.

Configuration

Scheduling is off by default, even when Scheduler is installed. Enable it on Scheduler's settings form for context items at /admin/config/content/scheduler/ai_context_item.

When Scheduler is installed, the Context item settings page at /admin/config/ai/context/settings/items shows the current scheduling status and links to that Scheduler form.

Scheduler owns this setting and manages both the configuration and the Publish on / Unpublish on fields on the context item form. Use it to control:

  • Whether publishing scheduling is enabled
  • Whether unpublishing scheduling is enabled
  • Default scheduling behavior

Context item settings at /admin/config/ai/context/settings/items also configure publishing defaults (default_status, new_revision).

Permissions

The Schedule publishing of AI Context Items permission controls who can set scheduled dates. The View scheduled AI Context Item permission controls who can see items that are scheduled but not yet published.

Use cases

  • Seasonal content: Schedule product-specific context to publish at the start of a sales season and unpublish when it ends
  • Policy updates: Prepare updated compliance context in advance and schedule it to go live on the effective date
  • Temporary context: Publish event-related context for a limited time window