Improve replay-safety documentation for interceptors, clarify where interceptors run.#4307
Improve replay-safety documentation for interceptors, clarify where interceptors run.#4307
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| current_time = workflow.now() | ||
| ``` | ||
|
|
||
| #### Detecting replay (advanced) |
There was a problem hiding this comment.
This is probably the right place to also elaborate on workflow.unsafe.is_replaying_history_events
There was a problem hiding this comment.
It doesn't seem to be in every SDK yet but I can add to the ones it's in. If you can ping the person who's implementing these to know to come update the docs, that'd be great.
df1e65b to
f972671
Compare
📖 Docs PR preview links
|
chris-olszewski
left a comment
There was a problem hiding this comment.
Review of Ruby section
3ab1da7 to
c440108
Compare
jmaeagle99
left a comment
There was a problem hiding this comment.
Feedback on improving links for .NET. Also, there is no interceptors docs for .NET, but looks like we have an issue for it already: #3875
Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com>
c440108 to
58190c8
Compare
Co-authored-by: Justin Anderson <44687433+jmaeagle99@users.noreply.github.com>
Co-authored-by: Justin Anderson <44687433+jmaeagle99@users.noreply.github.com>
Co-authored-by: Justin Anderson <44687433+jmaeagle99@users.noreply.github.com>
| #### Detecting replay (advanced) | ||
|
|
||
| Use [`workflow.IsReplaying(ctx)`](https://pkg.go.dev/go.temporal.io/sdk/workflow#IsReplaying) to guard code that should only run on the first execution, such as emitting metrics or sending external notifications from an Interceptor. | ||
| (Never use this to affect Workflow business logic - branching on replay status breaks determinism.) |
There was a problem hiding this comment.
I'd put this in a Caution box instead
| #### Detecting replay (advanced) | ||
|
|
||
| Use [`WorkflowUnsafe.isReplaying()`](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/workflow/WorkflowUnsafe.html) to guard code that should only run on the first execution, such as emitting metrics or sending external notifications from an Interceptor. | ||
| (Never use this to affect Workflow business logic - branching on replay status breaks determinism.) |
There was a problem hiding this comment.
Same here for the rest of the SDKs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
What does this PR do?
We're trying to improve our interceptor docs for our AI Partner program. Interceptors are hard, we're trying to make it easier.
Notes to reviewers
Main Claude Prompt:
Test plan:
click in all the docs
http://localhost:3000/develop/java/core-application#workflow-logic-requirements
http://localhost:3000/develop/dotnet/core-application#workflow-logic-requirements
http://localhost:3000/develop/python/core-application#workflow-logic-requirements
http://localhost:3000/develop/java/core-application#workflow-logic-requirements
http://localhost:3000/develop/go/core-application#workflow-logic-requirements
http://localhost:3000/develop/dotnet/core-application#workflow-logic-requirements
┆Attachments: EDU-6066 Improve replay-safety documentation for interceptors