Skip to content

Commit e03483a

Browse files
lennessyyclaude
andcommitted
Use caution admonition for replay determinism warning across all SDKs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8b1840c commit e03483a

6 files changed

Lines changed: 30 additions & 6 deletions

File tree

docs/develop/dotnet/core-application.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ var currentTime = Workflow.UtcNow;
121121
#### Detecting replay (advanced)
122122

123123
Use [`Workflow.Unsafe.IsReplaying`](https://dotnet.temporal.io/api/Temporalio.Workflows.Workflow.Unsafe.html#Temporalio_Workflows_Workflow_Unsafe_IsReplaying) to guard code that should only run on the first execution, such as emitting metrics or sending external notifications from an Interceptor.
124-
(Never use this to affect Workflow business logic - branching on replay status breaks determinism.)
124+
:::caution
125+
126+
Never use this to affect Workflow business logic — branching on replay status breaks determinism.
127+
128+
:::
125129

126130
```csharp
127131
if (!Workflow.Unsafe.IsReplaying)

docs/develop/go/core-application.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,11 @@ currentTime := workflow.Now(ctx)
441441
#### Detecting replay (advanced)
442442

443443
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.
444-
(Never use this to affect Workflow business logic - branching on replay status breaks determinism.)
444+
:::caution
445+
446+
Never use this to affect Workflow business logic — branching on replay status breaks determinism.
447+
448+
:::
445449

446450
```go
447451
if !workflow.IsReplaying(ctx) {

docs/develop/java/core-application.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ long currentTime = Workflow.currentTimeMillis();
310310
#### Detecting replay (advanced)
311311

312312
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.
313-
(Never use this to affect Workflow business logic - branching on replay status breaks determinism.)
313+
:::caution
314+
315+
Never use this to affect Workflow business logic — branching on replay status breaks determinism.
316+
317+
:::
314318

315319
```java
316320
if (!WorkflowUnsafe.isReplaying()) {

docs/develop/python/core-application.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ current_time = workflow.now()
258258
#### Detecting replay (advanced)
259259

260260
Use [`workflow.unsafe.is_replaying`](https://python.temporal.io/temporalio.workflow.html#is_replaying) to guard code that should only run on the first execution, such as emitting metrics or sending external notifications from an [Interceptor](/develop/python/interceptors).
261-
(Never use this to affect Workflow business logic - branching on replay status breaks determinism.)
261+
:::caution
262+
263+
Never use this to affect Workflow business logic — branching on replay status breaks determinism.
264+
265+
:::
262266

263267
```python
264268
if not workflow.unsafe.is_replaying():

docs/develop/ruby/core-application.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ current_time = Temporalio::Workflow.now
105105
#### Detecting replay (advanced)
106106

107107
Use [`Temporalio::Workflow::Unsafe.replaying?`](https://ruby-doc.temporal.io/) to guard code that should only run on the first execution, such as emitting metrics or sending external notifications from an Interceptor.
108-
(Never use this to affect Workflow business logic - branching on replay status breaks determinism.)
108+
:::caution
109+
110+
Never use this to affect Workflow business logic — branching on replay status breaks determinism.
111+
112+
:::
109113

110114
```ruby
111115
unless Temporalio::Workflow::Unsafe.replaying?

docs/develop/typescript/core-application.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,11 @@ for (let x = 0; x < 10; ++x) {
475475
#### Detecting replay (advanced)
476476

477477
Use [`workflowInfo().unsafe.isReplaying`](https://typescript.temporal.io/api/interfaces/workflow.UnsafeWorkflowInfo#isreplaying) to guard code that should only run on the first execution, such as emitting metrics or sending external notifications from an [Interceptor](/develop/typescript/interceptors).
478-
(Never use this to affect Workflow business logic - branching on replay status breaks determinism.)
478+
:::caution
479+
480+
Never use this to affect Workflow business logic branching on replay status breaks determinism.
481+
482+
:::
479483

480484
```ts
481485
import { workflowInfo } from '@temporalio/workflow';

0 commit comments

Comments
 (0)