Emits pub/sub events to the event bus, allowing workflows to broadcast
messages to external subscribers. Each entry in the events map is
published as a separate message on the corresponding topic.
By default (config.once = true), events are emitted exactly once per
workflow execution — the isSideEffectAllowed guard prevents re-emission
on replay. Set config.once = false to emit on every re-execution
(rarely needed).
Examples
import { Durable } from'@hotmeshio/hotmesh';
// Emit a domain event when an order is processed exportasyncfunctionorderWorkflow(orderId: string): Promise<void> { const { processOrder } = Durable.workflow.proxyActivities<typeofactivities>(); constresult = awaitprocessOrder(orderId);
Emits pub/sub events to the event bus, allowing workflows to broadcast messages to external subscribers. Each entry in the
eventsmap is published as a separate message on the corresponding topic.By default (
config.once = true), events are emitted exactly once per workflow execution — theisSideEffectAllowedguard prevents re-emission on replay. Setconfig.once = falseto emit on every re-execution (rarely needed).Examples