@@ -9,10 +9,13 @@ option java_outer_classname = "MessageProto";
99option ruby_package = "Temporalio::Api::Nexus::V1" ;
1010option csharp_namespace = "Temporalio.Api.Nexus.V1" ;
1111
12+ import "google/protobuf/duration.proto" ;
1213import "google/protobuf/timestamp.proto" ;
1314import "temporal/api/common/v1/message.proto" ;
15+ import "temporal/api/enums/v1/common.proto" ;
1416import "temporal/api/enums/v1/nexus.proto" ;
1517import "temporal/api/failure/v1/message.proto" ;
18+ import "temporal/api/sdk/v1/user_metadata.proto" ;
1619
1720// A general purpose failure message.
1821// See: https://github.com/nexus-rpc/api/blob/main/SPEC.md#failure
@@ -199,7 +202,7 @@ message EndpointTarget {
199202 // Nexus task queue to route requests to.
200203 string task_queue = 2 ;
201204 }
202-
205+
203206 // Target an external server by URL.
204207 // At a later point, this will support providing credentials, in the meantime, an http.RoundTripper can be injected
205208 // into the server to modify the request.
@@ -213,3 +216,150 @@ message EndpointTarget {
213216 External external = 2 ;
214217 }
215218}
219+
220+ // NexusOperationExecutionCancellationInfo contains the state of a Nexus operation cancellation.
221+ message NexusOperationExecutionCancellationInfo {
222+ // The time when cancellation was requested.
223+ google.protobuf.Timestamp requested_time = 1 ;
224+
225+ temporal.api.enums.v1.NexusOperationCancellationState state = 2 ;
226+
227+ // The number of attempts made to deliver the cancel operation request.
228+ // This number represents a minimum bound since the attempt is incremented after the request completes.
229+ int32 attempt = 3 ;
230+
231+ // The time when the last attempt completed.
232+ google.protobuf.Timestamp last_attempt_complete_time = 4 ;
233+ // The last attempt's failure, if any.
234+ temporal.api.failure.v1.Failure last_attempt_failure = 5 ;
235+ // The time when the next attempt is scheduled.
236+ google.protobuf.Timestamp next_attempt_schedule_time = 6 ;
237+
238+ // If the state is BLOCKED, blocked reason provides additional information.
239+ string blocked_reason = 7 ;
240+
241+ // A reason that may be specified in the CancelNexusOperationRequest.
242+ string reason = 8 ;
243+ }
244+
245+ // Full current state of a standalone Nexus operation, as of the time of the request.
246+ message NexusOperationExecutionInfo {
247+ // Unique identifier of this Nexus operation within its namespace along with run ID (below).
248+ string operation_id = 1 ;
249+ string run_id = 2 ;
250+
251+ // Endpoint name, resolved to a URL via the cluster's endpoint registry.
252+ string endpoint = 3 ;
253+ // Service name.
254+ string service = 4 ;
255+ // Operation name.
256+ string operation = 5 ;
257+
258+ // A general status for this operation, indicates whether it is currently running or in one of the terminal statuses.
259+ // Updated once when the operation is originally scheduled, and again when it reaches a terminal status.
260+ temporal.api.enums.v1.NexusOperationExecutionStatus status = 6 ;
261+ // More detailed breakdown of NEXUS_OPERATION_EXECUTION_STATUS_RUNNING.
262+ temporal.api.enums.v1.PendingNexusOperationState state = 7 ;
263+
264+ // Schedule-to-close timeout for this operation.
265+ // (-- api-linter: core::0140::prepositions=disabled
266+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
267+ google.protobuf.Duration schedule_to_close_timeout = 8 ;
268+
269+ // Schedule-to-start timeout for this operation.
270+ // (-- api-linter: core::0140::prepositions=disabled
271+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
272+ google.protobuf.Duration schedule_to_start_timeout = 9 ;
273+
274+ // Start-to-close timeout for this operation.
275+ // (-- api-linter: core::0140::prepositions=disabled
276+ // aip.dev/not-precedent: "to" is used to indicate interval. --)
277+ google.protobuf.Duration start_to_close_timeout = 10 ;
278+
279+ // The number of attempts made to start/deliver the operation request.
280+ // This number represents a minimum bound since the attempt is incremented after the request completes.
281+ int32 attempt = 11 ;
282+
283+ // Time the operation was originally scheduled via a StartNexusOperation request.
284+ google.protobuf.Timestamp schedule_time = 12 ;
285+ // Scheduled time + schedule to close timeout.
286+ google.protobuf.Timestamp expiration_time = 13 ;
287+ // Time when the operation transitioned to a closed state.
288+ google.protobuf.Timestamp close_time = 14 ;
289+
290+ // The time when the last attempt completed.
291+ google.protobuf.Timestamp last_attempt_complete_time = 15 ;
292+ // The last attempt's failure, if any.
293+ temporal.api.failure.v1.Failure last_attempt_failure = 16 ;
294+ // The time when the next attempt is scheduled.
295+ google.protobuf.Timestamp next_attempt_schedule_time = 17 ;
296+
297+ // Elapsed time from schedule_time to now for running operations or to close_time for closed
298+ // operations, including all attempts and backoff between attempts.
299+ google.protobuf.Duration execution_duration = 18 ;
300+
301+ NexusOperationExecutionCancellationInfo cancellation_info = 19 ;
302+
303+ // If the state is BLOCKED, blocked reason provides additional information.
304+ string blocked_reason = 20 ;
305+
306+ // Server-generated request ID used as an idempotency token when submitting start requests to
307+ // the handler. Distinct from the request_id in StartNexusOperationRequest, which is the
308+ // caller-side idempotency key for the StartNexusOperation RPC itself.
309+ string request_id = 21 ;
310+
311+ // Operation token. Only set for asynchronous operations after a successful StartOperation call.
312+ string operation_token = 22 ;
313+
314+ // Incremented each time the operation's state is mutated in persistence.
315+ int64 state_transition_count = 23 ;
316+
317+ temporal.api.common.v1.SearchAttributes search_attributes = 24 ;
318+
319+ // Header for context propagation and tracing purposes.
320+ map <string , string > nexus_header = 25 ;
321+
322+ // Metadata for use by user interfaces to display the fixed as-of-start summary and details of the operation.
323+ temporal.api.sdk.v1.UserMetadata user_metadata = 26 ;
324+
325+ // Links attached by the handler of this operation on start or completion.
326+ repeated temporal.api.common.v1.Link links = 27 ;
327+
328+ // The identity of the client who started this operation.
329+ string identity = 28 ;
330+ }
331+
332+ // Limited Nexus operation information returned in the list response.
333+ // When adding fields here, ensure that it is also present in NexusOperationExecutionInfo (note that it may already be present in
334+ // NexusOperationExecutionInfo but not at the top-level).
335+ message NexusOperationExecutionListInfo {
336+ // A unique identifier of this operation within its namespace along with run ID (below).
337+ string operation_id = 1 ;
338+ // The run ID of the standalone Nexus operation.
339+ string run_id = 2 ;
340+
341+ // Endpoint name.
342+ string endpoint = 3 ;
343+ // Service name.
344+ string service = 4 ;
345+ // Operation name.
346+ string operation = 5 ;
347+
348+ // Time the operation was originally scheduled via a StartNexusOperation request.
349+ google.protobuf.Timestamp schedule_time = 6 ;
350+ // If the operation is in a terminal status, this field represents the time the operation transitioned to that status.
351+ google.protobuf.Timestamp close_time = 7 ;
352+ // The status is updated once, when the operation is originally scheduled, and again when the operation reaches a terminal status.
353+ temporal.api.enums.v1.NexusOperationExecutionStatus status = 8 ;
354+
355+ // Search attributes from the start request.
356+ temporal.api.common.v1.SearchAttributes search_attributes = 9 ;
357+
358+ // Updated on terminal status.
359+ int64 state_transition_count = 10 ;
360+ // Updated once on scheduled and once on terminal status.
361+ int64 state_size_bytes = 11 ;
362+ // The difference between close time and scheduled time.
363+ // This field is only populated if the operation is closed.
364+ google.protobuf.Duration execution_duration = 12 ;
365+ }
0 commit comments