The Lightning Scheduler module is a content scheduler component of the Lightning Workflow suite. This collection of modules enables you to extend the Workflows and Content Moderation modules (packaged with Drupal 8 core) to build and customize workflows supporting your organization’s custom content types and publication needs.
With Lightning Scheduler, you can schedule workflow state transitions to take place systematically at a future date and time.
To learn more about the concepts in a Drupal 8 workflow, see Workflows for Drupal 8: Content, Revisions, and Moderation.
Lightning Workflow’s components, such as Lightning Scheduler, are disabled by default, but can be installed with Composer like any other Drupal modules.
To install Lightning Scheduler in your Drupal code base, use the following Composer commands:
composer config repositories.drupal composer https://packages.drupal.org/8
composer require drupal/lightning_workflow
Note
Acquia Lightning enables Lightning Scheduler by default on the Landing page and Basic page content types packaged with Acquia Lightning, and on any content type with a workflow moderation state applied to it.
To use Lightning Scheduler to create a scheduled transition for newly created content, you must perform the following steps:
The entity will change moderation state on the date and at the time you have specified.
The following workflow factors determine the options displayed in the moderation list:
Which transitions are available from the current state: Workflow defines available transitions, and the default state. In Acquia Lightning, for example, the default editorial workflow uses Draft as the default state, but the default state varies by workflow.
Which transitions you have permissions to use: Content moderation defines editorial transition permissions at People > Permissions > Content moderation where Use <transition-name> transition denotes the permission, for example: Use Create New Draft transition, or Use Send to review transition.
More than one workflow can define transitions with the same name. The name of the workflow prefixes the relevant permission, for example: Editorial workflow: Use Create New Draft transition, but you can also create a new workflow (Admin > Configuration > Workflow > Workflows) called Tech Review using the same transition name, Tech Review workflow: Use Create New Draft transition.
The following image displays scheduling a piece of content to be published, and then archived, click the following image to learn more about the React-based content Scheduler:
To use Lightning Scheduler to schedule future transition states for existing content, you must perform the following steps:
The entity will change moderation state on the dates and at the times you have specified.
When creating or editing a scheduled transition, your Scheduler permissions determine the options available from the transition list, for example: Editorial workflow: Schedule Create New Draft transition, or Schedule Send to review transition. The workflow name also prefixes the relevant Scheduler permission.
Scheduler permissions are a separate collection of permissions derived from the workflow permissions discussed in Creating a new scheduled transition.
Important
A scheduled transition is a request, not a promise. To ensure a successful
content transition, you must ensure you configure content to the correct
state allowing a transition to the desired target state.
Lightning Workflow determines the Scheduler transition process. If the transition fails, the
Database logging module, logs the failure on
your website at /admin/reports/dblog
.
Lightning Scheduler transitions are processed during cron runs. For more information about cron, see Using scheduled jobs to support your application.
Lightning Scheduler deletes transitions occurring in the past, and shows you transitions scheduled for the future. After a scheduled transition’s date and time passes, the system deletes the transition, but a record remains because Lightning Scheduler creates a new revision. By viewing the content’s revision history, you can see when Scheduler changed the moderation state.