Defer entity webhooks until after the response#
Enable Send entity webhooks after the response under Configuration > Web services > Webhooks >
Settings (/admin/config/services/webhook/settings) to avoid sending entity
notifications before their database transaction commits. The option is disabled
by default, including after an upgrade.
When enabled, entity create, update and delete hooks prepare and sign a separate request for each matching outgoing subscription. They persist the request in the existing database outbox using the entity operation's database connection. A rollback removes both the entity change and its pending delivery. Each operation captures its own entity and acting-user snapshot, including data needed for a delete notification; entities are not reloaded at the end of the request.
After the HTTP response, the terminate subscriber attempts at most ten of this request's deliveries. It makes no attempts while a database transaction remains open. Rolled-back deliveries no longer exist and cannot be claimed. Other pending asynchronous deliveries are left for cron. The worker retains the existing subscription activation checks, claim leases, signed bytes, delivery identity, retry limits and transient-error backoff.
Run Drupal cron regularly. It handles failed attempts, deliveries beyond the post-response limit, interrupted requests and CLI operations that never dispatch the HTTP terminate event. Delivery is at least once, so receivers should handle duplicates using the delivery ID. A queued request means accepted for delivery; it does not mean that the receiver has successfully processed it.
This option applies only to automatic entity notifications. With it disabled, entity webhooks follow the existing delivery setting. Send all outgoing webhooks through cron still queues every outgoing delivery for cron, independently of the entity-specific deferral option. With both options enabled, entity deliveries can get their first attempt after the response; other deliveries await cron.
Deferral prevents notifications from escaping an uncommitted database transaction. It cannot guarantee immediate visibility through an external cache or a database replica. SEND listeners still run during preparation; they should not perform external side effects that assume the entity transaction has committed.