You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.semanticsPerRetry(...) // At-least-once vs at-most-once
46
46
.serDes(...) // Custom serialization
47
47
.build());
48
48
```
@@ -73,7 +73,7 @@ Control how steps behave when interrupted mid-execution:
73
73
| Semantic | Behavior | Use Case |
74
74
|----------|----------|----------|
75
75
|`AT_LEAST_ONCE_PER_RETRY` (default) | Re-executes step if interrupted before completion | Idempotent operations (database upserts, API calls with idempotency keys) |
|`AT_MOST_ONCE_PER_RETRY`|Re-executes step once per retry if interrupted. Throws `StepInterruptedException` if retries exhausted| Non-idempotent operations (sending emails, charging payments) |
77
77
78
78
```java
79
79
// Default: at-least-once per retry (step may re-run if interrupted)
@@ -84,14 +84,14 @@ var result = ctx.step("idempotent-update", Result.class,
**Important**: These semantics apply *per retry attempt*, not per overall execution:
92
92
93
93
-**AT_LEAST_ONCE_PER_RETRY**: The step executes at least once per retry. If the step succeeds but checkpointing fails (e.g., sandbox crash), the step re-executes on replay.
94
-
-**AT_MOST_ONCE_PER_RETRY**: A checkpoint is created before execution. If failure occurs after checkpoint but before completion, the step is skipped on replay and `StepInterruptedException` is thrown.
94
+
-**AT_MOST_ONCE_PER_RETRY**: A checkpoint is created before execution. If failure occurs after checkpoint but before completion, the step is re-executed on a new retry attempt. `StepInterruptedException` is thrown if retries are exhausted.
95
95
96
96
To achieve step-level at-most-once semantics, combine with a no-retry strategy:
97
97
@@ -100,7 +100,7 @@ To achieve step-level at-most-once semantics, combine with a no-retry strategy:
100
100
var result = ctx.step("charge-payment", Result.class,
0 commit comments