From e6fcb0d8b580899c157bb65ac1c175df6c508299 Mon Sep 17 00:00:00 2001 From: Kundan <281732484+ks-temporal@users.noreply.github.com> Date: Wed, 20 May 2026 07:58:46 -0700 Subject: [PATCH 1/7] Add optional activity outcome in start activity response --- openapi/openapiv2.json | 8 ++++++++ openapi/openapiv3.yaml | 7 +++++++ temporal/api/workflowservice/v1/request_response.proto | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 65437ff15..3adba52db 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -12173,6 +12173,10 @@ "startDelay": { "type": "string", "description": "Time to wait before dispatching the first activity task. This delay is not applied to retry attempts." + }, + "includeOutcome": { + "type": "boolean", + "description": "Include the outcome (result/failure) in the response if the activity has completed." } } }, @@ -18929,6 +18933,10 @@ "link": { "$ref": "#/definitions/v1Link", "description": "Link to the started activity." + }, + "outcome": { + "$ref": "#/definitions/v1ActivityExecutionOutcome", + "description": "Only set if the activity is already completed and include_outcome was true in the request." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bb733a194..931e6a32a 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16349,6 +16349,9 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. + includeOutcome: + type: boolean + description: Include the outcome (result/failure) in the response if the activity has completed. StartActivityExecutionResponse: type: object properties: @@ -16362,6 +16365,10 @@ components: allOf: - $ref: '#/components/schemas/Link' description: Link to the started activity. + outcome: + allOf: + - $ref: '#/components/schemas/ActivityExecutionOutcome' + description: Only set if the activity is already completed and include_outcome was true in the request. StartBatchOperationRequest: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 6d2d324a7..3e3c9a162 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3164,6 +3164,9 @@ message StartActivityExecutionRequest { temporal.api.common.v1.OnConflictOptions on_conflict_options = 21; // Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. google.protobuf.Duration start_delay = 22; + + // Include the outcome (result/failure) in the response if the activity has completed. + bool include_outcome = 23; } message StartActivityExecutionResponse { @@ -3173,6 +3176,8 @@ message StartActivityExecutionResponse { bool started = 2; // Link to the started activity. temporal.api.common.v1.Link link = 3; + // Only set if the activity is already completed and include_outcome was true in the request. + temporal.api.activity.v1.ActivityExecutionOutcome outcome = 4; } message DescribeActivityExecutionRequest { From df33ca7b53cd20708f9b5e02a404fce62d2c3893 Mon Sep 17 00:00:00 2001 From: ks-temporal <281732484+ks-temporal@users.noreply.github.com> Date: Tue, 26 May 2026 11:52:41 -0700 Subject: [PATCH 2/7] Update comment based on review Co-authored-by: Fred Tzeng <41805201+fretz12@users.noreply.github.com> --- temporal/api/workflowservice/v1/request_response.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 3e3c9a162..1b07a1d27 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3165,7 +3165,7 @@ message StartActivityExecutionRequest { // Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. google.protobuf.Duration start_delay = 22; - // Include the outcome (result/failure) in the response if the activity has completed. + // Include the outcome in the response if the activity has completed. bool include_outcome = 23; } From 374277413014a38d1ec90da246f27cefc720a031 Mon Sep 17 00:00:00 2001 From: Kundan <281732484+ks-temporal@users.noreply.github.com> Date: Tue, 26 May 2026 12:05:03 -0700 Subject: [PATCH 3/7] Update comment based on review --- openapi/openapiv2.json | 2 +- openapi/openapiv3.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 2811d8c9c..9f5ed9064 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -12176,7 +12176,7 @@ }, "includeOutcome": { "type": "boolean", - "description": "Include the outcome (result/failure) in the response if the activity has completed." + "description": "Include the outcome in the response if the activity has completed." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 6579924c5..9c5f685dd 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16367,7 +16367,7 @@ components: description: Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. includeOutcome: type: boolean - description: Include the outcome (result/failure) in the response if the activity has completed. + description: Include the outcome in the response if the activity has completed. StartActivityExecutionResponse: type: object properties: From b809f9ae27983935d7352c083f555f331c487219 Mon Sep 17 00:00:00 2001 From: Kundan <281732484+ks-temporal@users.noreply.github.com> Date: Thu, 28 May 2026 10:53:36 -0700 Subject: [PATCH 4/7] Update comment based on review --- temporal/api/workflowservice/v1/request_response.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 1b07a1d27..0782fe909 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3165,7 +3165,11 @@ message StartActivityExecutionRequest { // Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. google.protobuf.Duration start_delay = 22; - // Include the outcome in the response if the activity has completed. + // Include the outcome in a success response if the activity has completed, and + // id_reuse_policy or id_conflict_policy would have caused a failure response otherwise. + // This is applicable only when the id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE, + // or the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY, + // or id_conflict_policy is ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING. bool include_outcome = 23; } From 677c499fc2daa89b3ad47cc4dddb970d1e03c950 Mon Sep 17 00:00:00 2001 From: Kundan <281732484+ks-temporal@users.noreply.github.com> Date: Thu, 28 May 2026 11:20:12 -0700 Subject: [PATCH 5/7] Update comment based on review --- openapi/openapiv2.json | 2 +- openapi/openapiv3.yaml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 13d3b910a..724519f59 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -12176,7 +12176,7 @@ }, "includeOutcome": { "type": "boolean", - "description": "Include the outcome in the response if the activity has completed." + "description": "Include the outcome in a success response if the activity has completed, and\nid_reuse_policy or id_conflict_policy would have caused a failure response otherwise.\nThis is applicable only when the id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE,\nor the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY,\nor id_conflict_policy is ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bf39f0178..08d0b5f89 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16379,7 +16379,12 @@ components: description: Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. includeOutcome: type: boolean - description: Include the outcome in the response if the activity has completed. + description: |- + Include the outcome in a success response if the activity has completed, and + id_reuse_policy or id_conflict_policy would have caused a failure response otherwise. + This is applicable only when the id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE, + or the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY, + or id_conflict_policy is ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING. StartActivityExecutionResponse: type: object properties: From 3b18f3ef4b8573bd61e85df57be6fa3e75bd191b Mon Sep 17 00:00:00 2001 From: Kundan <281732484+ks-temporal@users.noreply.github.com> Date: Mon, 8 Jun 2026 13:14:40 -0700 Subject: [PATCH 6/7] Rename flag based on feedback to be more explicit. --- temporal/api/workflowservice/v1/request_response.proto | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index b91213dce..b78a9bac7 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3171,11 +3171,10 @@ message StartActivityExecutionRequest { google.protobuf.Duration start_delay = 22; // Include the outcome in a success response if the activity has completed, and - // id_reuse_policy or id_conflict_policy would have caused a failure response otherwise. + // id_reuse_policy would have caused a failure response otherwise. // This is applicable only when the id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE, - // or the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY, - // or id_conflict_policy is ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING. - bool include_outcome = 23; + // or the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY. + bool id_reuse_policy_return_existing_outcome_on_reject = 23; } message StartActivityExecutionResponse { From 3b82d448785cbace3f8d0469465bee0693ef2fb9 Mon Sep 17 00:00:00 2001 From: Kundan <281732484+ks-temporal@users.noreply.github.com> Date: Mon, 8 Jun 2026 13:39:41 -0700 Subject: [PATCH 7/7] Rename flag based on feedback to be more explicit --- openapi/openapiv2.json | 4 ++-- openapi/openapiv3.yaml | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 724519f59..13ec0c49c 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -12174,9 +12174,9 @@ "type": "string", "description": "Time to wait before dispatching the first activity task. This delay is not applied to retry attempts." }, - "includeOutcome": { + "idReusePolicyReturnExistingOutcomeOnReject": { "type": "boolean", - "description": "Include the outcome in a success response if the activity has completed, and\nid_reuse_policy or id_conflict_policy would have caused a failure response otherwise.\nThis is applicable only when the id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE,\nor the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY,\nor id_conflict_policy is ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING." + "description": "Include the outcome in a success response if the activity has completed, and\nid_reuse_policy would have caused a failure response otherwise.\nThis is applicable only when the id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE,\nor the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 08d0b5f89..25f5aa464 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16377,14 +16377,13 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. - includeOutcome: + idReusePolicyReturnExistingOutcomeOnReject: type: boolean description: |- Include the outcome in a success response if the activity has completed, and - id_reuse_policy or id_conflict_policy would have caused a failure response otherwise. + id_reuse_policy would have caused a failure response otherwise. This is applicable only when the id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE, - or the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY, - or id_conflict_policy is ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING. + or the activity succeeded and id_reuse_policy is ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY. StartActivityExecutionResponse: type: object properties: