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
Copy file name to clipboardExpand all lines: docs/encyclopedia/nexus-operations.mdx
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,10 @@ keywords:
14
14
- nexus circuit breaking
15
15
- nexus circuit breaker
16
16
- circuit breaker is open
17
+
- nexus timeouts
18
+
- schedule-to-close timeout
19
+
- schedule-to-start timeout
20
+
- start-to-close timeout
17
21
- execution semantics
18
22
- temporal sdk
19
23
- versioning
@@ -179,7 +183,7 @@ For example, when you execute a Nexus Operation in a caller Workflow the followi
179
183
## Automatic retries {#automatic-retries}
180
184
181
185
Once the caller Workflow schedules an Operation with the caller's Temporal Service, the caller's Nexus Machinery keeps trying to start the Operation.
182
-
If a [retryable Nexus error](/references/failures#nexus-errors) is returned the Nexus Machinery will retry until the Nexus Operation's Start-to-Close-Timeout is exceeded.
186
+
If a [retryable Nexus error](/references/failures#nexus-errors) is returned the Nexus Machinery will retry until the Nexus Operation's [Schedule-to-Close timeout](#schedule-to-close-timeout) is exceeded.
183
187
184
188
For example, if a Nexus handler returns a [retryable error](/references/failures#nexus-errors), or an [upstream timeout](https://github.com/nexus-rpc/api/blob/main/SPEC.md#predefined-handler-errors) is encountered by the caller, the Nexus request will be retried up to the [default Retry Policy's](https://github.com/temporalio/temporal/blob/de7c8879e103be666a7b067cc1b247f0ac63c25c/components/nexusoperations/config.go#L111) max attempts and expiration interval.
185
189
@@ -193,6 +197,51 @@ This differs from how Activities and Workflows handle errors and retries:
193
197
194
198
See [errors in Nexus handlers](/nexus/error-handling#errors-in-nexus-handlers) to control the retry behavior by returning a [non-retryable Nexus error](/references/failures#non-retryable-nexus-errors).
195
199
200
+
## Timeouts {#timeouts}
201
+
202
+
Nexus Operations support three types of timeouts that control how long the caller is willing to wait at different stages of the Operation lifecycle.
203
+
These timeouts are set by the caller when scheduling the Operation.
The Schedule-to-Close timeout limits the total duration from when the Operation is scheduled to when it completes.
208
+
This is the overall timeout for the entire Operation.
209
+
The Nexus Machinery [automatically retries](#automatic-retries) failed requests internally until this timeout is exceeded, at which point the Operation fails with a [NexusOperationTimedOut](/references/events#nexusoperationtimedout) event.
210
+
211
+
For asynchronous Operations, this timeout covers the full lifecycle: scheduling, starting, and completing.
212
+
For synchronous Operations, this timeout covers the time from scheduling to receiving the result.
213
+
214
+
In Temporal Cloud, the maximum Schedule-to-Close timeout is 60 days.
The Schedule-to-Start timeout limits how long the caller is willing to wait for the Operation to be started (or completed, if synchronous) by the handler.
219
+
If the Operation is not started within this timeout, it fails with `TIMEOUT_TYPE_SCHEDULE_TO_START`.
220
+
221
+
If not set or set to zero, no Schedule-to-Start timeout is enforced.
222
+
223
+
:::note
224
+
225
+
The Schedule-to-Start timeout requires Temporal Server version 1.31.0 or later.
The Start-to-Close timeout limits how long the caller is willing to wait for an asynchronous Operation to complete after it has been started.
232
+
If the Operation does not complete within this timeout after starting, it fails with `TIMEOUT_TYPE_START_TO_CLOSE`.
233
+
234
+
This timeout only applies to asynchronous Operations.
235
+
Synchronous Operations ignore this timeout because they complete as part of the start request.
236
+
237
+
If not set or set to zero, no Start-to-Close timeout is enforced.
238
+
239
+
:::note
240
+
241
+
The Start-to-Close timeout requires Temporal Server version 1.31.0 or later.
242
+
243
+
:::
244
+
196
245
## Circuit breaking {#circuit-breaking}
197
246
198
247
Circuit breaking handles deployment issues, such as remote service faults, that take time to recover.
@@ -296,7 +345,7 @@ Pending Nexus Operations: 1
296
345
297
346
### At-least-once execution semantics and idempotency
298
347
299
-
The Nexus Machinery provides reliable execution with at-least-once execution semantics for a Nexus Operation, until the caller's Schedule-to-Close-Timeout is exceeded, at which time the overall Nexus Operation times out.
348
+
The Nexus Machinery provides reliable execution with at-least-once execution semantics for a Nexus Operation, until the caller's [Schedule-to-Close timeout](#schedule-to-close-timeout) is exceeded, at which time the overall Nexus Operation times out.
300
349
301
350
The Nexus Machinery breaks up the [Nexus Operation lifecycle](/nexus/operations#operation-lifecycle) into one or more [Nexus Tasks](/tasks#nexus-task) that a Nexus handler is responsible for processing.
302
351
If a Nexus handler times out or returns a non-retryable Nexus error, then the Nexus Machinery will retry the Nexus request to provide at-least-once execution.
0 commit comments