Skip to main content
Mercur’s product workflows emit 4 events as products are created and reviewed. The names are exported as ProductWorkflowEvents from @mercurjs/core/workflows. Subscribe to them to notify stores, sync external systems, or reindex search.

Product events

Each event is emitted once per product. Payloads come from the emitEventStep calls in packages/core/src/workflows/product/workflows.
Mercur’s createProductsWorkflow runs Medusa’s createProductsWorkflow as a step, which also emits product.created with { id }. Expect 2 product.created events per product and make handlers idempotent.

Subscribe to an event

Write a subscriber that listens for one of the events. This one logs the rejection reason for each rejected product.
src/subscribers/product-rejected.ts
Medusa calls the handler once per rejected product with the payload above.

Events from Medusa

Medusa’s own product workflows emit their events alongside Mercur’s. These matter for the catalog:
  • product.updated: from Medusa’s updateProductsWorkflow, which assignProductsToCategoryWorkflow and the admin product update both run
  • product.deleted: from Medusa’s deleteProductsWorkflow
  • product-variant.created: from createProductVariantsWorkflow, which Mercur’s create workflow runs for variants
See the Medusa events reference for the full list. Edits that stores submit through the product edit pipeline emit product-change.* events, listed in the product edit events.