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/8] 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/8] 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/8] 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/8] 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/8] 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/8] 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/8] 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: From c2e3a1f59bd9d91e8fa442773cd02d22aa7fec05 Mon Sep 17 00:00:00 2001 From: Kundan <281732484+ks-temporal@users.noreply.github.com> Date: Wed, 10 Jun 2026 21:23:17 -0700 Subject: [PATCH 8/8] Update comment on run_id, link and outcome based on review --- openapi/openapiv2.json | 6 +++--- openapi/openapiv3.yaml | 13 ++++++++++--- .../api/workflowservice/v1/request_response.proto | 10 +++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 13ec0c49c..b1b88f950 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -18950,7 +18950,7 @@ "properties": { "runId": { "type": "string", - "description": "The run ID of the activity that was started - or used (via ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING)." + "description": "The run ID of the activity that was started - or used (via ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING),\nor was already completed when request's id_reuse_policy_return_existing_outcome_on_reject\ncauses an outcome to be included in this response." }, "started": { "type": "boolean", @@ -18958,11 +18958,11 @@ }, "link": { "$ref": "#/definitions/v1Link", - "description": "Link to the started activity." + "description": "Link to the started activity - or an already completed activity when request's\nid_reuse_policy_return_existing_outcome_on_reject causes an outcome to be included in this." }, "outcome": { "$ref": "#/definitions/v1ActivityExecutionOutcome", - "description": "Only set if the activity is already completed and include_outcome was true in the request." + "description": "Only set if the activity is already completed and id_reuse_policy_return_existing_outcome_on_reject\nwas true in the request. In that case it also populates the run_id and link for that activity." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 25f5aa464..331faa86c 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16389,18 +16389,25 @@ components: properties: runId: type: string - description: The run ID of the activity that was started - or used (via ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING). + description: |- + The run ID of the activity that was started - or used (via ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING), + or was already completed when request's id_reuse_policy_return_existing_outcome_on_reject + causes an outcome to be included in this response. started: type: boolean description: If true, a new activity was started. link: allOf: - $ref: '#/components/schemas/Link' - description: Link to the started activity. + description: |- + Link to the started activity - or an already completed activity when request's + id_reuse_policy_return_existing_outcome_on_reject causes an outcome to be included in this. outcome: allOf: - $ref: '#/components/schemas/ActivityExecutionOutcome' - description: Only set if the activity is already completed and include_outcome was true in the request. + description: |- + Only set if the activity is already completed and id_reuse_policy_return_existing_outcome_on_reject + was true in the request. In that case it also populates the run_id and link for that activity. StartBatchOperationRequest: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index b78a9bac7..93fee05a1 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3178,13 +3178,17 @@ message StartActivityExecutionRequest { } message StartActivityExecutionResponse { - // The run ID of the activity that was started - or used (via ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING). + // The run ID of the activity that was started - or used (via ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING), + // or was already completed when request's id_reuse_policy_return_existing_outcome_on_reject + // causes an outcome to be included in this response. string run_id = 1; // If true, a new activity was started. bool started = 2; - // Link to the started activity. + // Link to the started activity - or an already completed activity when request's + // id_reuse_policy_return_existing_outcome_on_reject causes an outcome to be included in this. temporal.api.common.v1.Link link = 3; - // Only set if the activity is already completed and include_outcome was true in the request. + // Only set if the activity is already completed and id_reuse_policy_return_existing_outcome_on_reject + // was true in the request. In that case it also populates the run_id and link for that activity. temporal.api.activity.v1.ActivityExecutionOutcome outcome = 4; }