Deterministic Constraints in Workflows
mainTemporal Workflows must be deterministic. This means the execution must produce the same results given the same history.
The following actions are prohibited inside a workflow:
- Performing I/O (network, disk, stdio, etc.).
- Accessing or altering external mutable state.
- Using threading or making blocking calls.
- Using the system clock (e.g.,
Time.now). - Making non-deterministic random calls.
- Any other non-guaranteed-deterministic calls.
Note on Logging: You should use Temporalio::Workflow.logger instead of the standard Ruby logger. While the standard logger might work for quick debugging, it uses mutexes that can violate determinism during high contention.