I have this understanding:
Temporal workflows must be deterministic, meaning that on replay, they should generate the exact same event history as the original execution.
However, I am confused about how the event history is structured when a workflow receives a signal.
- Suppose, during the first execution of a workflow, a signal is received while the workflow is processing
activity-1
. - The machine crashes, and the workflow replay happens.
- Based on my understanding of determinism, the signal should arrive at the exact same time during replay for it to be placed in the same position in the event history. If the signal comes at a different time, i would assume of above understanding that it will cause non-determinism since the event history might not match the original execution.
However, I have tested this in a PoC, and I don’t get a Non-Deterministic Execution (NDE) error because of this. So what am I missing in my understanding?
Also, I have observed that I don’t need to send the signal again during the second execution (after replay). Why is that? Is Temporal storing and replaying signals as part of the event history to maintain determinism? If yes how ? In what order ?
Would love to get some clarification on how signal processing works within Temporal’s deterministic execution model.