Events

Events are published through a fire-and-forget publish decorator. In real (non-in-memory) mode they are delivered to the configured EventBridge bus (EVENT_BUS_NAME) in the configured region (AWS_REGION). In in-memory mode a local stub captures them. If EventBridge registration fails, publishing becomes a no-op (events are silently dropped — flag).

Each event carries a type and a data payload; the event source and detail-type are applied by the shared event-bus integration on delivery.

Published event types

Event type Trigger data payload highlights
promotion.created Create promotion instanceId, promotionId, name
promotion.published Publish (create path + workflow publish) instanceId, identifier/entityType, name
promotion.updated Update promotion instanceId, promotionId, name
promotion.deleted Delete promotion instanceId, promotionId
group.created Create group instanceId, group id, name
group.published Publish group instanceId, group id
group.updated Update group instanceId, group id
group.deleted Delete group instanceId, group id
group.cloned Clone group instanceId, source + new group id
group.members_assigned Bulk-assign promotions to a group instanceId, group id, promotion ids
group.member_unassigned Unassign a promotion from a group instanceId, group id, promotionId
display.published Publish display instanceId, display id
display.item_added Add item to a display instanceId, display id, item
display.item_removed Remove item from a display instanceId, display id, itemId
promocode.list_published Promocode list published (create path) instanceId, list id
promocode.list_status_changed Promocode list paused / archived / renamed instanceId, list id, status
promocode.list_exhausted No available code left when redeeming from a list instanceId, list id
promocode.redeemed Redeem code instanceId, code, cart/customer
promocode.blocked Block/reserve code instanceId, code
promocode.unblocked Unblock code instanceId, code
promocode.assigned Assign code instanceId, code, customer
promocode.unassigned Unassign code instanceId, code
promocode.reversed Reverse redemption instanceId, code
batch.execution.completed Batch job success runRequestId, jobId, batchId, instanceId, summary
batch.execution.failed Batch job failure runRequestId, jobId, batchId, error
batch.execution.progress Batch job progress runRequestId, jobId, progress

Consumed events

Source / detail-type Behaviour
Marketplace Service source, app.* detail-type App lifecycle (registered/updated/enabled/disabled), handled via the shared marketplace integration. Routed only in the Lambda entry point. Unrecognised events are logged and skipped.

Internal MongoDB change stream (not EventBridge)

An optional MongoDB change stream watches the promotions and promotion_groups collections and syncs the in-memory orchestrator. Gated by PROMO_CHANGE_STREAM_ENABLED=true (and requires a replica set / DocumentDB); skipped under in-memory mode. Disabled by default.


Revision History
2026-08-05 | JP – Created the page and added the content.