From e5678addc086e0afd012575f9f095f003478179e Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 17 Aug 2026 09:37:21 -0700 Subject: [PATCH 1/4] Wire request_id through CallbackInfo for linking --- openapi/openapiv2.json | 124 ++++++++++++++----------- openapi/openapiv3.yaml | 43 +++++---- temporal/api/callback/v1/message.proto | 9 +- temporal/api/common/v1/message.proto | 20 ++-- temporal/api/enums/v1/common.proto | 6 +- temporal/api/workflow/v1/message.proto | 14 +++ 6 files changed, 132 insertions(+), 84 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index b81833b85..026577588 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -11107,21 +11107,6 @@ }, "description": "A link to a standalone Nexus operation." }, - "LinkNexusOperationCallback": { - "type": "object", - "properties": { - "operationId": { - "type": "string" - }, - "runId": { - "type": "string" - }, - "requestId": { - "type": "string" - } - }, - "description": "A link to a worker callback attached to a Nexus operation within the same namespace. e.g. the completion handler attached\nto a standalone Nexus operation, not the source Nexus operation itself. A standalone Nexus operation can have multiple\ncallbacks attached to them, and will be differentiated by the server-generated request_id used when the callback was invoked." - }, "LinkWorkflow": { "type": "object", "properties": { @@ -11549,7 +11534,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Completion callbacks attached to the running workflow update." } @@ -12583,7 +12568,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Callbacks to be called by the server when this activity reaches a terminal state.\nCallback addresses must be whitelisted in the server's dynamic configuration." }, @@ -12745,7 +12730,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Completion callbacks to be invoked once the Nexus operation reaches a terminal state." }, @@ -12836,7 +12821,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Callbacks to be called by the server when this workflow reaches a terminal state.\nIf the workflow continues-as-new, these callbacks will be carried over to the new execution.\nCallback addresses must be whitelisted in the server's dynamic configuration." }, @@ -13380,7 +13365,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Callbacks to be called by the server when this update reaches a terminal state." }, @@ -13480,7 +13465,7 @@ "type": "object", "properties": { "callback": { - "$ref": "#/definitions/v1Callback", + "$ref": "#/definitions/commonV1Callback", "description": "Information on how this callback should be invoked (e.g. its URL and type)." }, "registrationTime": { @@ -13515,6 +13500,10 @@ "type": "string", "description": "If the state is BLOCKED, blocked reason provides additional information." }, + "requestId": { + "type": "string", + "description": "The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries\nare made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an\nexecution." + }, "success": { "type": "object", "properties": {}, @@ -13589,7 +13578,7 @@ "type": "object", "properties": { "callback": { - "$ref": "#/definitions/v1Callback", + "$ref": "#/definitions/commonV1Callback", "description": "Information on how this callback should be invoked (e.g. its URL and type)." }, "trigger": { @@ -13626,6 +13615,19 @@ "blockedReason": { "type": "string", "description": "If the state is BLOCKED, blocked reason provides additional information." + }, + "requestId": { + "type": "string", + "description": "The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries\nare made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an\nexecution." + }, + "success": { + "type": "object", + "properties": {}, + "title": "The callback completed successfully. (Which may include delivering a \"failed\" result successfully.)" + }, + "failure": { + "$ref": "#/definitions/v1Failure", + "description": "The failure if the callback was not able to complete successfully. e.g. timed out, received an\nunretriable error, etc." } }, "description": "CallbackInfo contains the state of an attached workflow callback." @@ -13659,6 +13661,29 @@ }, "description": "When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and\nthere is already an existing running workflow, OnConflictOptions defines actions to be taken on\nthe existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent\nhistory event in the running workflow with the changes requested in this object." }, + "commonV1Callback": { + "type": "object", + "properties": { + "nexus": { + "$ref": "#/definitions/CallbackNexus" + }, + "internal": { + "$ref": "#/definitions/CallbackInternal" + }, + "worker": { + "$ref": "#/definitions/v1CallbackWorker" + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Link" + }, + "description": "Links associated with the callback. It can be used to link to underlying resources of the\ncallback." + } + }, + "description": "Callback to attach to various events in the system, e.g. workflow run completion." + }, "protobufAny": { "type": "object", "properties": { @@ -14737,29 +14762,6 @@ }, "description": "CalendarSpec describes an event specification relative to the calendar,\nsimilar to a traditional cron specification, but with labeled fields. Each\nfield can be one of:\n *: matches always\n x: matches when the field equals x\n x/y : matches when the field equals x+n*y where n is an integer\n x-z: matches when the field is between x and z inclusive\n w,x,y,...: matches when the field is one of the listed values\nEach x, y, z, ... is either a decimal integer, or a month or day of week name\nor abbreviation (in the appropriate fields).\nA timestamp matches if all fields match.\nNote that fields have different default values, for convenience.\nNote that the special case that some cron implementations have for treating\nday_of_month and day_of_week as \"or\" instead of \"and\" when both are set is\nnot implemented.\nday_of_week can accept 0 or 7 as Sunday\nCalendarSpec gets compiled into StructuredCalendarSpec, which is what will be\nreturned if you describe the schedule." }, - "v1Callback": { - "type": "object", - "properties": { - "nexus": { - "$ref": "#/definitions/CallbackNexus" - }, - "internal": { - "$ref": "#/definitions/CallbackInternal" - }, - "worker": { - "$ref": "#/definitions/v1CallbackWorker" - }, - "links": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Link" - }, - "description": "Links associated with the callback. It can be used to link to underlying resources of the\ncallback." - } - }, - "description": "Callback to attach to various events in the system, e.g. workflow run completion." - }, "v1CallbackState": { "type": "string", "enum": [ @@ -16123,17 +16125,19 @@ "type": "string" } }, - "description": "Identifies a specific execution within a namespace. This is used for standalone activities\nexecutions in batch jobs currently." + "description": "Identifies a specific execution within a namespace." }, "v1ExecutionType": { "type": "string", "enum": [ "EXECUTION_TYPE_UNSPECIFIED", "EXECUTION_TYPE_WORKFLOW", - "EXECUTION_TYPE_ACTIVITY" + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS", + "EXECUTION_TYPE_UPDATE_WORKFLOW" ], "default": "EXECUTION_TYPE_UNSPECIFIED", - "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities." + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.\n - EXECUTION_TYPE_UPDATE_WORKFLOW: An update workflow execution archtype." }, "v1ExternalWorkflowExecutionCancelRequestedEventAttributes": { "type": "object", @@ -16866,12 +16870,26 @@ "workflow": { "$ref": "#/definitions/LinkWorkflow" }, - "nexusOperationCallback": { - "$ref": "#/definitions/LinkNexusOperationCallback" + "callback": { + "$ref": "#/definitions/v1LinkCallback" } }, "description": "Link can be associated with history events. It might contain information about an external entity\nrelated to the history event. For example, workflow A makes a Nexus call that starts workflow B:\nin this case, a history event in workflow A could contain a Link to the workflow started event in\nworkflow B, and vice-versa." }, + "v1LinkCallback": { + "type": "object", + "properties": { + "execution": { + "$ref": "#/definitions/v1Execution", + "description": "Source execution the callback was attached to." + }, + "requestId": { + "type": "string", + "description": "Request ID used for the callback's delivery." + } + }, + "description": "A link to a worker callback attached to an execution. An execution (e.g. workflow or standalone Nexus\noperation) can have multiple callbacks attached to them, and will be differentiated by the request_id used when the callback\nis invoked." + }, "v1ListActivityExecutionsResponse": { "type": "object", "properties": { @@ -18872,7 +18890,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Callbacks to be called by the server when this update reaches a terminal state." }, @@ -21777,7 +21795,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Completion callbacks attached to the running workflow execution." }, @@ -21993,7 +22011,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/v1Callback" + "$ref": "#/definitions/commonV1Callback" }, "description": "Completion callbacks attached when this workflow was started." }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 13efd7def..41c3b5755 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10905,6 +10905,12 @@ components: blockedReason: type: string description: If the state is BLOCKED, blocked reason provides additional information. + requestId: + type: string + description: |- + The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries + are made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an + execution. failure: allOf: - $ref: '#/components/schemas/Failure' @@ -12431,15 +12437,15 @@ components: - EXECUTION_TYPE_UNSPECIFIED - EXECUTION_TYPE_WORKFLOW - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS + - EXECUTION_TYPE_UPDATE_WORKFLOW type: string format: enum businessId: type: string runId: type: string - description: |- - Identifies a specific execution within a namespace. This is used for standalone activities - executions in batch jobs currently. + description: Identifies a specific execution within a namespace. ExternalWorkflowExecutionCancelRequestedEventAttributes: type: object properties: @@ -13146,8 +13152,8 @@ components: $ref: '#/components/schemas/Link_NexusOperation' workflow: $ref: '#/components/schemas/Link_Workflow' - nexusOperationCallback: - $ref: '#/components/schemas/Link_NexusOperationCallback' + callback: + $ref: '#/components/schemas/Link_Callback' description: |- Link can be associated with history events. It might contain information about an external entity related to the history event. For example, workflow A makes a Nexus call that starts workflow B: @@ -13172,6 +13178,20 @@ components: A link to a built-in batch job. Batch jobs can be used to perform operations on a set of workflows (e.g. terminate, signal, cancel, etc). This link can be put on workflow history events generated by actions taken by a batch job. + Link_Callback: + type: object + properties: + execution: + allOf: + - $ref: '#/components/schemas/Execution' + description: Source execution the callback was attached to. + requestId: + type: string + description: Request ID used for the callback's delivery. + description: |- + A link to a worker callback attached to an execution. An execution (e.g. workflow or standalone Nexus + operation) can have multiple callbacks attached to them, and will be differentiated by the request_id used when the callback + is invoked. Link_NexusOperation: type: object properties: @@ -13182,19 +13202,6 @@ components: runId: type: string description: A link to a standalone Nexus operation. - Link_NexusOperationCallback: - type: object - properties: - operationId: - type: string - runId: - type: string - requestId: - type: string - description: |- - A link to a worker callback attached to a Nexus operation within the same namespace. e.g. the completion handler attached - to a standalone Nexus operation, not the source Nexus operation itself. A standalone Nexus operation can have multiple - callbacks attached to them, and will be differentiated by the server-generated request_id used when the callback was invoked. Link_Workflow: type: object properties: diff --git a/temporal/api/callback/v1/message.proto b/temporal/api/callback/v1/message.proto index e72ff6fdb..25996c426 100644 --- a/temporal/api/callback/v1/message.proto +++ b/temporal/api/callback/v1/message.proto @@ -36,12 +36,17 @@ message CallbackInfo { // If the state is BLOCKED, blocked reason provides additional information. string blocked_reason = 8; + // The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries + // are made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an + // execution. + string request_id = 9; + // Result of the callback's execution, only set when the callback reaches a terminal state. oneof result { // The callback completed successfully. (Which may include delivering a "failed" result successfully.) - google.protobuf.Empty success = 9; + google.protobuf.Empty success = 10; // The failure if the callback was not able to complete successfully. e.g. timed out, received an // unretriable error, etc. - temporal.api.failure.v1.Failure failure = 10; + temporal.api.failure.v1.Failure failure = 11; } } diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index df6ec72d7..5c01ceb50 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -68,8 +68,7 @@ message WorkflowExecution { string run_id = 2; } -// Identifies a specific execution within a namespace. This is used for standalone activities -// executions in batch jobs currently. +// Identifies a specific execution within a namespace. message Execution { temporal.api.enums.v1.ExecutionType type = 1; string business_id = 2; @@ -304,13 +303,14 @@ message Link { string reason = 4; } - // A link to a worker callback attached to a Nexus operation within the same namespace. e.g. the completion handler attached - // to a standalone Nexus operation, not the source Nexus operation itself. A standalone Nexus operation can have multiple - // callbacks attached to them, and will be differentiated by the server-generated request_id used when the callback was invoked. - message NexusOperationCallback { - string operation_id = 1; - string run_id = 2; - string request_id = 3; + // A link to a worker callback attached to an execution. An execution (e.g. workflow or standalone Nexus + // operation) can have multiple callbacks attached to them, and will be differentiated by the request_id used when the callback + // is invoked. + message Callback { + // Source execution the callback was attached to. + Execution execution = 1; + // Request ID used for the callback's delivery. + string request_id = 2; } oneof variant { @@ -319,7 +319,7 @@ message Link { Activity activity = 3; NexusOperation nexus_operation = 4; Workflow workflow = 5; - NexusOperationCallback nexus_operation_callback = 6; + Callback callback = 6; } } diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index e2929337e..4cf911729 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -113,4 +113,8 @@ enum ExecutionType { EXECUTION_TYPE_WORKFLOW = 1; // An activity execution archetype. This is reserved for standalone activities. EXECUTION_TYPE_ACTIVITY = 2; -} \ No newline at end of file + // A Nexus operation execution archetype. This is reserved for standalone Nexus operations. + EXECUTION_TYPE_NEXUS = 3; + // An update workflow execution archtype. + EXECUTION_TYPE_UPDATE_WORKFLOW = 4; +} diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index 1ed33fa4c..050d37581 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -496,6 +496,20 @@ message CallbackInfo { // If the state is BLOCKED, blocked reason provides additional information. string blocked_reason = 9; + + // The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries + // are made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an + // execution. + string request_id = 10; + + // Result of the callback's execution, only set when the callback reaches a terminal state. + oneof result { + // The callback completed successfully. (Which may include delivering a "failed" result successfully.) + google.protobuf.Empty success = 11; + // The failure if the callback was not able to complete successfully. e.g. timed out, received an + // unretriable error, etc. + temporal.api.failure.v1.Failure failure = 12; + } } // PendingNexusOperationInfo contains the state of a pending Nexus operation. From 7f4fe7f63ac47f707e47c4af750c6fe7694e95bf Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 17 Aug 2026 16:12:16 -0700 Subject: [PATCH 2/4] Rename request_id to callback_id --- openapi/openapiv2.json | 21 +++++++++++---------- openapi/openapiv3.yaml | 22 ++++++++++------------ temporal/api/callback/v1/message.proto | 7 +++---- temporal/api/common/v1/message.proto | 13 ++++++------- temporal/api/workflow/v1/message.proto | 6 ++---- 5 files changed, 32 insertions(+), 37 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 026577588..f8682ed37 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -13500,9 +13500,9 @@ "type": "string", "description": "If the state is BLOCKED, blocked reason provides additional information." }, - "requestId": { + "callbackId": { "type": "string", - "description": "The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries\nare made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an\nexecution." + "description": "Unique ID with the scope of the source execution the callback was attached to. This typically is set to the\nincomming request ID sent to Temporal which added the Callback to an execution." }, "success": { "type": "object", @@ -13616,9 +13616,9 @@ "type": "string", "description": "If the state is BLOCKED, blocked reason provides additional information." }, - "requestId": { + "callbackId": { "type": "string", - "description": "The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries\nare made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an\nexecution." + "description": "Unique ID to identify the callback within the Workflow." }, "success": { "type": "object", @@ -16879,16 +16879,17 @@ "v1LinkCallback": { "type": "object", "properties": { + "namespace": { + "type": "string" + }, "execution": { - "$ref": "#/definitions/v1Execution", - "description": "Source execution the callback was attached to." + "$ref": "#/definitions/v1Execution" }, - "requestId": { - "type": "string", - "description": "Request ID used for the callback's delivery." + "callbackId": { + "type": "string" } }, - "description": "A link to a worker callback attached to an execution. An execution (e.g. workflow or standalone Nexus\noperation) can have multiple callbacks attached to them, and will be differentiated by the request_id used when the callback\nis invoked." + "description": "A link to a worker callback attached to an execution (e.g. workflow or standalone Nexus\noperation). Used to differentiate resources created by the source execution vs. resources\ncreated by the *callback* that executed when the source execution finished." }, "v1ListActivityExecutionsResponse": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 41c3b5755..56c95b7bb 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10905,12 +10905,11 @@ components: blockedReason: type: string description: If the state is BLOCKED, blocked reason provides additional information. - requestId: + callbackId: type: string description: |- - The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries - are made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an - execution. + Unique ID with the scope of the source execution the callback was attached to. This typically is set to the + incomming request ID sent to Temporal which added the Callback to an execution. failure: allOf: - $ref: '#/components/schemas/Failure' @@ -13181,17 +13180,16 @@ components: Link_Callback: type: object properties: + namespace: + type: string execution: - allOf: - - $ref: '#/components/schemas/Execution' - description: Source execution the callback was attached to. - requestId: + $ref: '#/components/schemas/Execution' + callbackId: type: string - description: Request ID used for the callback's delivery. description: |- - A link to a worker callback attached to an execution. An execution (e.g. workflow or standalone Nexus - operation) can have multiple callbacks attached to them, and will be differentiated by the request_id used when the callback - is invoked. + A link to a worker callback attached to an execution (e.g. workflow or standalone Nexus + operation). Used to differentiate resources created by the source execution vs. resources + created by the *callback* that executed when the source execution finished. Link_NexusOperation: type: object properties: diff --git a/temporal/api/callback/v1/message.proto b/temporal/api/callback/v1/message.proto index 25996c426..e09d12b41 100644 --- a/temporal/api/callback/v1/message.proto +++ b/temporal/api/callback/v1/message.proto @@ -36,10 +36,9 @@ message CallbackInfo { // If the state is BLOCKED, blocked reason provides additional information. string blocked_reason = 8; - // The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries - // are made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an - // execution. - string request_id = 9; + // Unique ID with the scope of the source execution the callback was attached to. This typically is set to the + // incomming request ID sent to Temporal which added the Callback to an execution. + string callback_id = 9; // Result of the callback's execution, only set when the callback reaches a terminal state. oneof result { diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 5c01ceb50..943211969 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -303,14 +303,13 @@ message Link { string reason = 4; } - // A link to a worker callback attached to an execution. An execution (e.g. workflow or standalone Nexus - // operation) can have multiple callbacks attached to them, and will be differentiated by the request_id used when the callback - // is invoked. + // A link to a worker callback attached to an execution (e.g. workflow or standalone Nexus + // operation). Used to differentiate resources created by the source execution vs. resources + // created by the *callback* that executed when the source execution finished. message Callback { - // Source execution the callback was attached to. - Execution execution = 1; - // Request ID used for the callback's delivery. - string request_id = 2; + string namespace = 1; + Execution execution = 2; + string callback_id = 3; } oneof variant { diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index 050d37581..f44e3f24a 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -497,10 +497,8 @@ message CallbackInfo { // If the state is BLOCKED, blocked reason provides additional information. string blocked_reason = 9; - // The Request ID used when the Callback was delivered. Used as an idempotency key in case multiple deliveries - // are made. Typically, this matches the incomming request ID sent to Temporal which added the Callback to an - // execution. - string request_id = 10; + // Unique ID to identify the callback within the Workflow. + string callback_id = 10; // Result of the callback's execution, only set when the callback reaches a terminal state. oneof result { From 54d5276f0169c293ad090944af33841260eb7bb3 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 18 Aug 2026 10:19:58 -0700 Subject: [PATCH 3/4] Address PR feedback; Worker callbacks scope --- openapi/openapiv2.json | 26 ++++++-------------------- openapi/openapiv3.yaml | 14 ++++++-------- temporal/api/callback/v1/message.proto | 6 +++--- temporal/api/common/v1/message.proto | 14 ++++++++++---- temporal/api/enums/v1/common.proto | 2 -- temporal/api/workflow/v1/message.proto | 12 ------------ 6 files changed, 25 insertions(+), 49 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index f8682ed37..a0d1826d4 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -13500,9 +13500,9 @@ "type": "string", "description": "If the state is BLOCKED, blocked reason provides additional information." }, - "callbackId": { + "requestId": { "type": "string", - "description": "Unique ID with the scope of the source execution the callback was attached to. This typically is set to the\nincomming request ID sent to Temporal which added the Callback to an execution." + "description": "Server-generated request ID used as an idempotency token when invoking callbacks.\nIt has no relation to caller-side request_id sent in operations like StartNexusOperationExecutionRequest." }, "success": { "type": "object", @@ -13615,19 +13615,6 @@ "blockedReason": { "type": "string", "description": "If the state is BLOCKED, blocked reason provides additional information." - }, - "callbackId": { - "type": "string", - "description": "Unique ID to identify the callback within the Workflow." - }, - "success": { - "type": "object", - "properties": {}, - "title": "The callback completed successfully. (Which may include delivering a \"failed\" result successfully.)" - }, - "failure": { - "$ref": "#/definitions/v1Failure", - "description": "The failure if the callback was not able to complete successfully. e.g. timed out, received an\nunretriable error, etc." } }, "description": "CallbackInfo contains the state of an attached workflow callback." @@ -16133,11 +16120,10 @@ "EXECUTION_TYPE_UNSPECIFIED", "EXECUTION_TYPE_WORKFLOW", "EXECUTION_TYPE_ACTIVITY", - "EXECUTION_TYPE_NEXUS", - "EXECUTION_TYPE_UPDATE_WORKFLOW" + "EXECUTION_TYPE_NEXUS" ], "default": "EXECUTION_TYPE_UNSPECIFIED", - "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.\n - EXECUTION_TYPE_UPDATE_WORKFLOW: An update workflow execution archtype." + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS: A Nexus operation execution archetype. This is reserved for standalone Nexus operations." }, "v1ExternalWorkflowExecutionCancelRequestedEventAttributes": { "type": "object", @@ -16885,11 +16871,11 @@ "execution": { "$ref": "#/definitions/v1Execution" }, - "callbackId": { + "requestId": { "type": "string" } }, - "description": "A link to a worker callback attached to an execution (e.g. workflow or standalone Nexus\noperation). Used to differentiate resources created by the source execution vs. resources\ncreated by the *callback* that executed when the source execution finished." + "description": "A link to a worker callback attached to an execution. An execution (e.g. standalone Nexus operation) can have\nmultiple callbacks attached, and will be differentiated by the request_id used when the callback is invoked." }, "v1ListActivityExecutionsResponse": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 56c95b7bb..3cc4f20d0 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10905,11 +10905,11 @@ components: blockedReason: type: string description: If the state is BLOCKED, blocked reason provides additional information. - callbackId: + requestId: type: string description: |- - Unique ID with the scope of the source execution the callback was attached to. This typically is set to the - incomming request ID sent to Temporal which added the Callback to an execution. + Server-generated request ID used as an idempotency token when invoking callbacks. + It has no relation to caller-side request_id sent in operations like StartNexusOperationExecutionRequest. failure: allOf: - $ref: '#/components/schemas/Failure' @@ -12437,7 +12437,6 @@ components: - EXECUTION_TYPE_WORKFLOW - EXECUTION_TYPE_ACTIVITY - EXECUTION_TYPE_NEXUS - - EXECUTION_TYPE_UPDATE_WORKFLOW type: string format: enum businessId: @@ -13184,12 +13183,11 @@ components: type: string execution: $ref: '#/components/schemas/Execution' - callbackId: + requestId: type: string description: |- - A link to a worker callback attached to an execution (e.g. workflow or standalone Nexus - operation). Used to differentiate resources created by the source execution vs. resources - created by the *callback* that executed when the source execution finished. + A link to a worker callback attached to an execution. An execution (e.g. standalone Nexus operation) can have + multiple callbacks attached, and will be differentiated by the request_id used when the callback is invoked. Link_NexusOperation: type: object properties: diff --git a/temporal/api/callback/v1/message.proto b/temporal/api/callback/v1/message.proto index e09d12b41..ca5b7ea0b 100644 --- a/temporal/api/callback/v1/message.proto +++ b/temporal/api/callback/v1/message.proto @@ -36,9 +36,9 @@ message CallbackInfo { // If the state is BLOCKED, blocked reason provides additional information. string blocked_reason = 8; - // Unique ID with the scope of the source execution the callback was attached to. This typically is set to the - // incomming request ID sent to Temporal which added the Callback to an execution. - string callback_id = 9; + // Server-generated request ID used as an idempotency token when invoking callbacks. + // It has no relation to caller-side request_id sent in operations like StartNexusOperationExecutionRequest. + string request_id = 9; // Result of the callback's execution, only set when the callback reaches a terminal state. oneof result { diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 943211969..ec2a108b6 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -303,13 +303,19 @@ message Link { string reason = 4; } - // A link to a worker callback attached to an execution (e.g. workflow or standalone Nexus - // operation). Used to differentiate resources created by the source execution vs. resources - // created by the *callback* that executed when the source execution finished. + // A link to a worker callback attached to an execution. An execution (e.g. standalone Nexus operation) can have + // multiple callbacks attached, and will be differentiated by the request_id used when the callback is invoked. message Callback { string namespace = 1; Execution execution = 2; - string callback_id = 3; + string request_id = 3; + + // NOTE: An Execution alone is not precise enough for all cases. e.g. a callback attached to a + // workflow update would be tied to a workflow execution as well as an update "component" (with + // an associated "component_id"). + // + // Worker callbacks can only be associated with standalone Nexus operations, so those additional + // fields aren't currently necessary. } oneof variant { diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index 4cf911729..eb64372d2 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -115,6 +115,4 @@ enum ExecutionType { EXECUTION_TYPE_ACTIVITY = 2; // A Nexus operation execution archetype. This is reserved for standalone Nexus operations. EXECUTION_TYPE_NEXUS = 3; - // An update workflow execution archtype. - EXECUTION_TYPE_UPDATE_WORKFLOW = 4; } diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index f44e3f24a..1ed33fa4c 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -496,18 +496,6 @@ message CallbackInfo { // If the state is BLOCKED, blocked reason provides additional information. string blocked_reason = 9; - - // Unique ID to identify the callback within the Workflow. - string callback_id = 10; - - // Result of the callback's execution, only set when the callback reaches a terminal state. - oneof result { - // The callback completed successfully. (Which may include delivering a "failed" result successfully.) - google.protobuf.Empty success = 11; - // The failure if the callback was not able to complete successfully. e.g. timed out, received an - // unretriable error, etc. - temporal.api.failure.v1.Failure failure = 12; - } } // PendingNexusOperationInfo contains the state of a pending Nexus operation. From 52984c1df8a3c02328e5b4a9c5ce95536f82a874 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 18 Aug 2026 10:45:28 -0700 Subject: [PATCH 4/4] Rename to EXECUTION_TYPE_NEXUS_OPERATION --- openapi/openapiv2.json | 4 ++-- openapi/openapiv3.yaml | 2 +- temporal/api/enums/v1/common.proto | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index a0d1826d4..0faa17357 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -16120,10 +16120,10 @@ "EXECUTION_TYPE_UNSPECIFIED", "EXECUTION_TYPE_WORKFLOW", "EXECUTION_TYPE_ACTIVITY", - "EXECUTION_TYPE_NEXUS" + "EXECUTION_TYPE_NEXUS_OPERATION" ], "default": "EXECUTION_TYPE_UNSPECIFIED", - "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS: A Nexus operation execution archetype. This is reserved for standalone Nexus operations." + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations." }, "v1ExternalWorkflowExecutionCancelRequestedEventAttributes": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 3cc4f20d0..2a485dccd 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -12436,7 +12436,7 @@ components: - EXECUTION_TYPE_UNSPECIFIED - EXECUTION_TYPE_WORKFLOW - EXECUTION_TYPE_ACTIVITY - - EXECUTION_TYPE_NEXUS + - EXECUTION_TYPE_NEXUS_OPERATION type: string format: enum businessId: diff --git a/temporal/api/enums/v1/common.proto b/temporal/api/enums/v1/common.proto index eb64372d2..ef8381cda 100644 --- a/temporal/api/enums/v1/common.proto +++ b/temporal/api/enums/v1/common.proto @@ -114,5 +114,5 @@ enum ExecutionType { // An activity execution archetype. This is reserved for standalone activities. EXECUTION_TYPE_ACTIVITY = 2; // A Nexus operation execution archetype. This is reserved for standalone Nexus operations. - EXECUTION_TYPE_NEXUS = 3; + EXECUTION_TYPE_NEXUS_OPERATION = 3; }