Skip to main content

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

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);

Input

input
object[]
required
Array of events to emit.

Output

This step does not return a value.