Appearance
Workflows & Temporal
A Workflow (or Saga/Process Manager) coordinates long-running business processes that span multiple aggregates (e.g., placing an order, waiting for payment, and instructing shipping).
Because workflows are inherently stateful and frequently require durable timers ("if payment isn't confirmed in 10 minutes, cancel the order"), they are notoriously complex to build reliably.
Temporal Integration
flux perfectly integrates with Temporal to handle these durable executions. The most robust architecture combines EventStore Tailing with EventBus Signals:
- A Temporal Workflow tails the
fluxEventStore using an Activity loop. - It executes state mutations transactionally.
- Once caught up to the live stream, it blocks using a
workflow.Selectorwaiting for aWakeUpSignal. - Your application's
flux.EventBussimply sends aWakeUpSignalto Temporal whenever a new event occurs.
This completely eliminates database hammering during live operation while maximizing throughput during replays!
