sm_entity_scheduler
SM Entity Scheduler hides (unpublishes), reveals, or deletes content entities once a date field on them has passed — driven by configuration and run on the Symfony Messenger Scheduler engine (sm + sm_scheduler).
Unlike form-driven schedulers, it triggers off an existing date field already on the entity (for example one populated by an import), re-evaluated on every run, and works with any content entity type — including Commerce product variations.
Features
- Config-driven "schedule" entities: target entity type and bundles, the date field to watch, semantics, enforcement strategy, cron expression and batch size.
- Pluggable enforcement strategies: status (unpublish via the core published flag), visibility_field (a dedicated boolean plus an entity-access veto) and delete — add your own.
- A shared, reusable expiry-rule service (date-granular, UTC) so imports and other code apply identical "is it past?" semantics.
- Messenger-native runner: a recurring scan fans expired entities out as batched messages to a consumer, so it scales to large catalogs without cron timeouts.
Post-Installation
Enable the module, add (or reuse) a date field on the target entity bundle, then create a schedule config entity pointing at that field and choosing an enforcement strategy. Run a Symfony Messenger consumer (for example bin/sm messenger:consume) so the recurring scan and batches are processed.
Additional Requirements
- Drupal 11.3+ (uses plugin constructor autowiring).
- Symfony Messenger + Drupal (sm) and Message Scheduler (sm_scheduler).
- A running Messenger consumer.
Similar projects
Unlike Scheduler (editor-set publish/unpublish dates per node) or Scheduled Transitions (content-moderation revisions), this module triggers off an existing arbitrary date field on any entity type, re-evaluates it every run, and runs on Symfony Messenger rather than hook_cron.