Document replay-safe Workflow APIs per SDK - #5054
Merged
Merged
Conversation
Add a heading per topic under the Workflow logic requirements section so readers can find the replay-safe alternative for what they need. - Ruby and .NET: add Logging, Random/UUIDs, Current time, and Detecting replay sections. Neither page previously named any replacement API. - Go: add the same four sections. Go has no built-in seeded random or UUID helper, so that section shows the Side Effect approach. - Java: add the same four sections, and point the existing "non-deterministic functions" bullet at the new one. - TypeScript: lead the Random/UUIDs section with the SDK's own uuid4() instead of the uuid npm package. Each documented API was run against a dev server and its history replayed through the SDK replayer.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
lennessyy
commented
Aug 6, 2026
lennessyy
left a comment
Contributor
Author
There was a problem hiding this comment.
no need to have bad examples here. we should remove the bad example from python as well
| var value = Workflow.Random.Next(1, 100); | ||
| var uniqueId = Workflow.NewGuid(); | ||
|
|
||
| // Bad - different result on every replay |
Contributor
Author
There was a problem hiding this comment.
No need to include bad references
| int value = Workflow.newRandom().nextInt(100); | ||
| UUID uniqueId = Workflow.randomUUID(); | ||
|
|
||
| // Bad - different result on every replay |
Show only the recommended API. Also removes the pre-existing bad example from the Python page.
| is false instead. That is false during read-only operations like Queries and Update validators. This is what the SDK's | ||
| built-in logger and tracing interceptors use internally. | ||
|
|
||
| ### .NET Task Determinism |
Contributor
There was a problem hiding this comment.
📝 [vale] reported by reviewdog 🐶
[Temporal.Headings] '.NET Task Determinism' should use sentence-style capitalization.
Contributor
📖 Docs PR preview links
|
Workflow.isReplaying() is deprecated in favor of the unsafe package method, which also matches the other SDKs.
Duncanma
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a heading per topic under the Workflow logic requirements section of each SDK's Workflow basics page, so readers can find the replay-safe alternative for what they need. Python already had this structure; PHP is unchanged.
What changed
Workflow.NewGuid()was undocumented andWorkflow.Randomappeared only in an analyzer-suppression note.UUID.randomUUID()as forbidden without namingWorkflow.randomUUID().uuid4()rather than theuuidnpm package.Verification
Each documented API was exercised by a Workflow per language run against
temporal server start-dev, then the recorded history was replayed through that SDK's replayer. All five passed, replay included.Java methods link to the
Workflowclass page rather than per-method anchors:javadoc.io/doc/.../latest/serves a JS shell with no resolvable anchors, and the/static/variant that has them requires a pinned version that would go stale.┆Attachments: EDU-6904 Document replay-safe Workflow APIs per SDK