diff --git a/nexus/temporal-proto-models-nexusrpc.yaml b/nexus/temporal-proto-models-nexusrpc.yaml index e0761fd15..a9f010b20 100644 --- a/nexus/temporal-proto-models-nexusrpc.yaml +++ b/nexus/temporal-proto-models-nexusrpc.yaml @@ -17,3 +17,18 @@ services: $pythonRef: temporalio.api.workflowservice.v1.SignalWithStartWorkflowExecutionResponse $rubyRef: Temporalio::Api::WorkflowService::V1::SignalWithStartWorkflowExecutionResponse $typescriptRef: '@temporalio/api/workflowservice/v1.SignalWithStartWorkflowExecutionResponse' + WaitForExternalWorkflow: + input: + $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowRequest + $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowRequest + $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowRequest + $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowRequest + $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowRequest + $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowRequest' + output: + $dotnetRef: Temporalio.Api.WorkflowService.V1.WaitForExternalWorkflowResponse + $goRef: go.temporal.io/api/workflowservice/v1.WaitForExternalWorkflowResponse + $javaRef: io.temporal.api.workflowservice.v1.WaitForExternalWorkflowResponse + $pythonRef: temporalio.api.workflowservice.v1.WaitForExternalWorkflowResponse + $rubyRef: Temporalio::Api::WorkflowService::V1::WaitForExternalWorkflowResponse + $typescriptRef: '@temporalio/api/workflowservice/v1.WaitForExternalWorkflowResponse' diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 12d163654..9a7e9c285 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -4179,6 +4179,51 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { + "post": { + "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", + "operationId": "WaitForExternalWorkflow2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", @@ -9654,6 +9699,51 @@ ] } }, + "/namespaces/{namespace}/workflows/{execution.workflowId}/wait-for-external-workflow": { + "post": { + "summary": "WaitForExternalWorkflow asynchronously waits for an external workflow to complete", + "operationId": "WaitForExternalWorkflow", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1WaitForExternalWorkflowResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceWaitForExternalWorkflowBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workflows/{workflowExecution.workflowId}/cancel": { "post": { "summary": "RequestCancelWorkflowExecution is called by workers when they want to request cancellation of\na workflow execution.", @@ -12920,6 +13010,24 @@ }, "description": "Used to validate the compute config without attaching it to a Worker Deployment Version." }, + "WorkflowServiceWaitForExternalWorkflowBody": { + "type": "object", + "properties": { + "execution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "The workflow execution to wait for.", + "title": "The workflow execution to wait for." + }, + "identity": { + "type": "string" + } + } + }, "apiActivityV1CallbackInfo": { "type": "object", "properties": { @@ -19813,6 +19921,20 @@ }, "description": "Used to override the versioning behavior (and pinned deployment version, if applicable) of a\nspecific workflow execution. If set, this override takes precedence over worker-sent values.\nSee `WorkflowExecutionInfo.VersioningInfo` for more information.\n\nTo remove the override, call `UpdateWorkflowExecutionOptions` with a null\n`VersioningOverride`, and use the `update_mask` to indicate that it should be mutated.\n\nPinned behavior overrides are automatically inherited by child workflows, workflow retries, continue-as-new\nworkflows, and cron workflows." }, + "v1WaitForExternalWorkflowResponse": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/v1WorkflowExecutionStatus" + }, + "result": { + "$ref": "#/definitions/v1Payload" + }, + "failure": { + "$ref": "#/definitions/v1Failure" + } + } + }, "v1WaitPolicy": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 14a6a130c..e6394e342 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -3754,6 +3754,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: + post: + tags: + - WorkflowService + description: |- + WaitForExternalWorkflow asynchronously waits for an external workflow to complete + + (-- api-linter: core::0127::http-annotation=disabled + aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + operationId: WaitForExternalWorkflow + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}: post: tags: @@ -8699,6 +8741,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow: + post: + tags: + - WorkflowService + description: |- + WaitForExternalWorkflow asynchronously waits for an external workflow to complete + + (-- api-linter: core::0127::http-annotation=disabled + aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) + (-- api-linter: core::0136::prepositions=disabled + aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + operationId: WaitForExternalWorkflow + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WaitForExternalWorkflowResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflows/{workflowId}: post: tags: @@ -18105,6 +18189,37 @@ components: If omitted and the target workflow is not pinned, the override request will be rejected with a PreconditionFailed error. + WaitForExternalWorkflowRequest: + type: object + properties: + namespace: + type: string + execution: + allOf: + - $ref: '#/components/schemas/WorkflowExecution' + description: The workflow execution to wait for. + identity: + type: string + WaitForExternalWorkflowResponse: + type: object + properties: + status: + enum: + - WORKFLOW_EXECUTION_STATUS_UNSPECIFIED + - WORKFLOW_EXECUTION_STATUS_RUNNING + - WORKFLOW_EXECUTION_STATUS_COMPLETED + - WORKFLOW_EXECUTION_STATUS_FAILED + - WORKFLOW_EXECUTION_STATUS_CANCELED + - WORKFLOW_EXECUTION_STATUS_TERMINATED + - WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW + - WORKFLOW_EXECUTION_STATUS_TIMED_OUT + - WORKFLOW_EXECUTION_STATUS_PAUSED + type: string + format: enum + result: + $ref: '#/components/schemas/Payload' + failure: + $ref: '#/components/schemas/Failure' WaitPolicy: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index f4012c73d..5f6fa6ddb 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3544,3 +3544,19 @@ message DeleteNexusOperationExecutionRequest { message DeleteNexusOperationExecutionResponse { } + +message WaitForExternalWorkflowRequest { + string namespace = 1; + // The workflow execution to wait for. + temporal.api.common.v1.WorkflowExecution execution = 2; + string identity = 3; +} + +message WaitForExternalWorkflowResponse { + temporal.api.enums.v1.WorkflowExecutionStatus status = 1; + + oneof completion_status { + temporal.api.common.v1.Payload result = 2; + temporal.api.failure.v1.Failure failure = 3; + } +} diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 49be10dfb..3b30eaf42 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -2026,4 +2026,27 @@ service WorkflowService { // (-- api-linter: core::0127::http-annotation=disabled // aip.dev/not-precedent: Nexus operation deletion not exposed to HTTP, users should use cancel or terminate. --) rpc DeleteNexusOperationExecution (DeleteNexusOperationExecutionRequest) returns (DeleteNexusOperationExecutionResponse) {} + + // WaitForExternalWorkflow asynchronously waits for an external workflow to complete + // + // (-- api-linter: core::0127::http-annotation=disabled + // aip.dev/not-precedent: Activity deletion not exposed to HTTP, users should use cancel or terminate. --) + // (-- api-linter: core::0136::prepositions=disabled + // aip.dev/not-precedent: WaitForExternalWorkflow is the established name for this operation. --) + rpc WaitForExternalWorkflow (WaitForExternalWorkflowRequest) returns (WaitForExternalWorkflowResponse) { + option (nexusannotations.v1.operation).tags = "exposed"; + + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/wait-for-external-workflow" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "workflow:{execution.workflow_id}" + }; + } }