Evaluates enabled connectors for an event and creates dispatch records.
For each connector-eligible event, the planner:
- Checks the global kill switch
- Iterates all registered connectors
- Checks per-workspace enablement
- Checks connector support for the event type
- Checks required signals
- Invokes the global dispatch policy callback
- Creates dispatch records for all eligible connectors
- Emits telemetry for skipped connectors with skip reasons
Custom-event mapping snapshots
For custom events, the enabled mapping is resolved at dispatch-planning
time (immediately after the event commits) and snapshotted into the
dispatch's source_context under the reserved "mapping" key via
EventMapping.to_snapshot/1. That snapshot — not the live mapping — is what
delivery and replay read, so a dispatch's outbound conversion is deterministic
once the dispatch row exists, even if the mapping is later edited or deleted.
The snapshot is authoritative only from dispatch creation onward: the mapping in effect when the event was recorded is not captured on the event, so a mapping change in the (typically sub-second) window between event commit and planning is reflected in the dispatch. Reconciliation likewise gates on the mappings current at reconciliation time within its lookback window.
Summary
Functions
Plans and creates dispatch records for a committed event.
Functions
Plans and creates dispatch records for a committed event.
Returns {:ok, dispatches} with the list of created dispatch records,
or {:skip, :connectors_disabled} if the global kill switch is off.
Parameters
event— the committed event structsignals— normalized connector signals mapsource_context— the event-time source context for payload rebuildsopts— optional keyword list::consent_status— consent status atom (default::consented)