Drupal is a registered trademark of Dries Buytaert

Entity Registry provides a generic entity tracking infrastructure for Drupal. It automatically detects when content is created, updated, or deleted and dispatches those changes to consumer plugins that you define — such as search indexes, audit systems, or external API syncs.

If you need a reliable, centralized way to keep external systems or internal indexes in sync with your Drupal content, Entity Registry gives you the framework so you only write the processing logic.

Features

  • Consumer plugin system — Define what happens when content changes by creating a simple PHP class with a #[EntityRegistryConsumer] attribute. Implement two methods: processItem() and deleteItem().
  • Automatic entity tracking — Every insert, update, and delete on tracked entity types is captured per translation, with no manual wiring needed.
  • Three processing modes — Choose per consumer: sync (process immediately on save), async (queue for cron), or both.
  • Full status lifecycle — Each tracked item moves through PENDING → PROCESSING → PROCESSED or FAILED, with automatic retry up to a configurable limit.
  • Multilingual support — Each translation is tracked and processed independently.
  • Admin bundle configuration — Administrators can restrict which entity types and bundles a consumer tracks via a per-consumer configuration form, without modifying plugin code.
  • Bulk operations — Populate (create initial tracking records for existing content), Reindex (reset all records to pending), and Retry Failed — all via the admin UI with Batch API support for large datasets.
  • Concurrency safety — Optimistic locking via atomic claim queries and distributed locks prevent double-processing.
  • Admin dashboard — Overview page showing all consumers, their tracked types, processing mode, and live status counts (pending, processing, processed, failed).

When to use this module: Use Entity Registry when you have one or more systems that need to react to Drupal entity changes — search engines, analytics pipelines, content audits, external API synchronization, cache warming, or any scenario where you need reliable, trackable processing of entity lifecycle events.

Post-Installation

  1. Navigate to Administration → Configuration → System → Entity Registry (/admin/config/system/entity-registry).
  2. The overview page lists all registered consumers. If no consumer modules are installed yet, the table will be empty — you need at least one consumer plugin (see below).
  3. Click Settings to configure global options:
    • Enable cron processing — Whether async items are processed on cron (default: enabled).
    • Batch size — Number of items processed per consumer per cron run (default: 50).
    • Chunk size — Size of database operation chunks for bulk inserts (default: 1000).
  4. For each consumer, use Configure to restrict which bundles are tracked, Populate to create tracking records for existing content, and Reindex to re-queue all items.

Creating a consumer plugin: In your custom module, create a class extending EntityRegistryConsumerBase with the #[EntityRegistryConsumer]
attribute:

 namespace Drupal\my_module\Plugin\EntityRegistryConsumer;

 use Drupal\entity_registry\Attribute\EntityRegistryConsumer;
 use Drupal\entity_registry\Plugin\EntityRegistryConsumerBase;
 use Drupal\Core\StringTranslation\TranslatableMarkup;

 #[EntityRegistryConsumer(
 id: 'my_consumer',
 label: new TranslatableMarkup('My Consumer'),
 entity_types: ['node' => ['article', 'page']],
 processing_mode: 'async',
 max_retries: 3,
 )]
 final class MyConsumer extends EntityRegistryConsumerBase {

 public function processItem(string $entity_type, int $entity_id, string $langcode): bool {
 // Your processing logic here.
 return TRUE;
 }

 public function deleteItem(string $entity_type, int $entity_id, string $langcode): bool {
 // Clean up when entity is deleted.
 return TRUE;
 }

 }
 

Clear caches after creating your plugin. It will appear automatically on the Entity Registry overview page.

Additional Requirements

Entity Registry requires Drupal 11 (core only — no contributed module dependencies). PHP 8.1 or higher is required for the attribute-based plugin discovery.

  • Ultimate Cron — For fine-grained control over cron frequency if you use async processing mode and need more frequent processing than the default Drupal cron interval.

Similar projects

  • Search API — A full search framework with indexing, backends (Solr, Elasticsearch, database), and Views integration. Entity Registry is lower-level and more generic: it tracks entity changes and dispatches them to arbitrary consumer plugins, not just search backends. Use Search API if you need search; use Entity Registry if you need a lightweight, general-purpose entity change tracking and processing pipeline.
  • Hook Event Dispatcher — Converts Drupal hooks to Symfony events. It dispatches events but does not provide tracking, status management, retry logic, or async queuing. Entity Registry adds the persistence and reliability layer on top of entity lifecycle events.

Supporting this Module

Entity Registry is maintained by Metadrop. If you find this module useful, consider:

  • Contributing bug reports and feature requests in the issue queue
  • Submitting patches or merge requests
  • Writing and sharing your own consumer plugins

Community Documentation

Documentation is available in the project's issue queue. Contributions to documentation — walkthroughs, tutorials, and example consumer plugins — are welcome.

Activity

Total releases
1
First release
Mar 2026
Latest release
1 day ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.x-dev Dev Mar 13, 2026