Documentation Index Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
Use this file to discover all available pages before exploring further.
Steps
emitMultipleEventsStep
Emits multiple events to the event bus in parallel. This step is commonly used to notify other systems (like search indexes or notification services) about changes to data. It’s a shared utility step used across various workflows in the codebase.
Source code
Examples
Create Service Zones
Delete Service Zones
packages/modules/b2c-core/src/workflows/fulfillment-set/create-vendor-service-zone.ts
import { IntermediateEvents } from "@mercurjs/framework" ;
import { emitMultipleEventsStep } from "../common/steps" ;
// ... inside createVendorServiceZonesWorkflow
const events = transform ( zones , ( zones ) =>
zones . map (( z ) => ({
name: IntermediateEvents . SERVICE_ZONE_CHANGED ,
data: { id: z . id },
}))
);
createRemoteLinkStep ( links );
emitMultipleEventsStep ( events );
packages/modules/b2c-core/src/workflows/fulfillment-set/delete-vendor-service-zone.ts
import { IntermediateEvents } from "@mercurjs/framework" ;
import { emitMultipleEventsStep } from "../common/steps" ;
// ... inside deleteVendorServiceZonesWorkflow
const events = transform ( ids , ( ids ) =>
ids . map (( id ) => ({
name: IntermediateEvents . SERVICE_ZONE_CHANGED ,
data: { id },
}))
);
dismissRemoteLinkStep ( links );
emitMultipleEventsStep ( events );
Array of events to emit. The name of the event to emit (e.g., “service_zone.changed”, “product.updated”).
data
Record<string, any>
required
The event payload data. Typically includes an ID or other identifying information.
Output
This step does not return a value.