diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 61d98c55a..b1b88f950 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." + }, + "idReusePolicyReturnExistingOutcomeOnReject": { + "type": "boolean", + "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." } } }, @@ -18946,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", @@ -18954,7 +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 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 f7053f93a..331faa86c 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16377,19 +16377,37 @@ 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. + idReusePolicyReturnExistingOutcomeOnReject: + type: boolean + description: |- + Include the outcome in a success response if the activity has completed, and + 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. StartActivityExecutionResponse: type: object 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 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 a4098d9b1..93fee05a1 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3169,15 +3169,27 @@ 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 in a success response if the activity has completed, and + // 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. + bool id_reuse_policy_return_existing_outcome_on_reject = 23; } 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 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; } message DescribeActivityExecutionRequest {