POLARIS FIELD GUIDE / 4 MIN READ
Replay Workflow Events in the Right Order
A workflow replay reconstructs state from events under fixed ordering and an observation boundary. Use occurrence time, explicit tie-breakers and a defined duplicate rule. Preserve late-arriving records, the original decision snapshot and the updated historical view. This gives Polaris RSI experiments a stable starting state and connects every compared outcome to the event sequence and evidence available to that decision.
Distinguish occurrence from arrival
An event occurring at 09:00 and arriving at 10:00 has two relevant timestamps. Occurrence time establishes its place in the business sequence; ingestion time establishes when the workflow received it. Preserve both so resolution, confirmation, closure and reopening retain their intended relationships.
Apache Beam’s programming guide distinguishes event-time windows, processing time and late data. For an operational replay, the practical choice is to define which timestamp determines the business sequence and which timestamp records what the system knew at a particular moment.
Specify deterministic ordering and validity
Choose tie-breakers for events with the same timestamp, such as event identifier and source row identifier. Define recognized event types and the handling of invalid references. Isolate events referring to unknown tickets in a review set with their validation reason and source identifier.
The Polaris support replay orders by event time with event ID and row ID as tie-breakers. It validates IDs, known tickets, event types and event times relative to ticket creation. These choices make the result reproducible on its synthetic event history.
Define transitions with a small state table
Specify the effect of every event on the current state. This abbreviated table follows the Polaris support replay example and identifies the prerequisites and reset behavior for each transition.
| Event | State effect |
|---|---|
| Resolved | Start resolution and clear prior confirmation and closure |
| Customer confirmed | Recognize confirmation after resolution |
| Closed | Recognize closure after resolution and confirmation |
| Reopened | Clear resolution, confirmation and closure |
| Transferred | Clear the assigned owner |
Set the snapshot and duplicate contract
Choose the evaluation cutoff before replaying. Assign later events to subsequent snapshots. The Polaris support example counts repeated event IDs once. For a source that reuses identifiers for corrections, define a correction contract that identifies the revised event and preserves its earlier history.
In the synthetic Polaris study, 224,260 input events became 222,000 valid unique events after 2,220 duplicates and 40 invalid events were removed. Those counts are useful because they expose the cleaning step before state totals are interpreted.
Evaluate late evidence deliberately
A late event can change the reconstructed business state for an earlier time, while the original operational decision still reflects what was known then. Keep those two views separate: historical truth at event time and the information available to the workflow at decision time.
Store the original decision snapshot and the later reconciliation snapshot. Compare a baseline and candidate using the evidence available at the same decision time. Use the later snapshot to evaluate the eventual outcome and retain its arrival time as part of the comparison evidence.
Use replay outputs as experiment inputs
Freeze the cleaned event set and reconstructed states before comparing candidate policies. Emit record-level states, aggregate counts and a manifest identifying ordering rules and cutoff. Then an RSI experiment can change one decision policy while keeping the starting history fixed.
Add delayed confirmation, duplicate closure and reopening sequences to the regression suite. Give each boundary case its expected state and qualifying event history. Trace every counted outcome in the finished replay to the sequence that produced it.
QUESTIONS & ANSWERS
Details that matter.
Which ordering defines workflow state?
Use the business sequence defined by the event contract, usually occurrence time with deterministic tie-breakers. Preserve ingestion time to explain when evidence became available.
Can late events alter an earlier outcome report?
Late events update the reconstructed historical view. Keep that view and the original decision snapshot as separate records, each with its observation boundary and available evidence.
Why does event replay matter for RSI?
A stable reconstructed state lets the baseline and candidate face the same history. It isolates policy changes from differences in event ordering or data cleaning.
Sources & further reading
- Polaris support closure replay: synthetic event history
- Polaris RSI: process and version checkpoints
- Apache Beam programming guide: event time and late data