Context
- Some Workflow Plugins need to call
Math.random() or workflow.uuid4().
- If the workflow code also use these methods, then the plugin and the workflow code both pull values out of the same PRNG sequence.
- That may result in NDEs if a workflow is replayed after adding/removing a Plugin.
Describe the solution you'd like
Add the following to the Workflow API:
- API to create a distinct deterministic PRNG instance
- Possibility of generating UUIDs from that distinct PRNG instances (i.e. rather than only from the workflow’s global PRNG).
- Possibility of activating a given PRNG instance as the “global” one within a given execution scope. This is required to ensure that third-party, non-Temporal libraries used by Temporal plugins don’t disrupt the workflow’s actual PRNG sequence.