From c7a01a5fb6c10d262b9262238034f6ffebf5c65a Mon Sep 17 00:00:00 2001 From: Laura Whitaker Date: Thu, 29 Jan 2026 11:04:43 -0700 Subject: [PATCH] add api/v1 for wf pause and unpause --- openapi/openapiv2.json | 94 +++++++++++++++++++ openapi/openapiv3.yaml | 89 ++++++++++++++++++ temporal/api/workflowservice/v1/service.proto | 8 ++ 3 files changed, 191 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 4625a2e45..7e88dbd74 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -3769,6 +3769,53 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/pause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nPauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in\n- The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history\n- No new workflow tasks or activity tasks are dispatched.\n - Any workflow task currently executing on the worker will be allowed to complete.\n - Any activity task currently executing will be paused.\n- All server-side events will continue to be processed by the server.\n- Queries & Updates on a paused workflow will be rejected.", + "operationId": "PauseWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow to pause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "ID of the workflow execution to be paused. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}": { "post": { "summary": "SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if\nit isn't yet started.", @@ -3822,6 +3869,53 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause": { + "post": { + "summary": "Note: This is an experimental API and the behavior may change in a future release.\nUnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request.\nUnpausing a workflow execution results in\n- The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history\n- Workflow tasks and activity tasks are resumed.", + "operationId": "UnpauseWorkflowExecution2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnpauseWorkflowExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow to unpause.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workflowId", + "description": "ID of the workflow execution to be paused. Required.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseWorkflowExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/nexus/endpoints": { "get": { "summary": "List all Nexus endpoints for the cluster, sorted by ID in ascending order. Set page_token in the request to the\nnext_page_token field of the previous response to get the next page of results. An empty next_page_token\nindicates that there are no more results. During pagination, a newly added service with an ID lexicographically\nearlier than the previous page's last endpoint's ID may be missed.", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 5edb053c7..136e06d70 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -3120,6 +3120,52 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/pause: + post: + tags: + - WorkflowService + description: |- + Note: This is an experimental API and the behavior may change in a future release. + PauseWorkflowExecution pauses the workflow execution specified in the request. Pausing a workflow execution results in + - The workflow execution status changes to `PAUSED` and a new WORKFLOW_EXECUTION_PAUSED event is added to the history + - No new workflow tasks or activity tasks are dispatched. + - Any workflow task currently executing on the worker will be allowed to complete. + - Any activity task currently executing will be paused. + - All server-side events will continue to be processed by the server. + - Queries & Updates on a paused workflow will be rejected. + operationId: PauseWorkflowExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow to pause. + required: true + schema: + type: string + - name: workflowId + in: path + description: ID of the workflow execution to be paused. Required. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflowId}/signal-with-start/{signalName}: post: tags: @@ -3174,6 +3220,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{workflowId}/unpause: + post: + tags: + - WorkflowService + description: |- + Note: This is an experimental API and the behavior may change in a future release. + UnpauseWorkflowExecution unpauses a previously paused workflow execution specified in the request. + Unpausing a workflow execution results in + - The workflow execution status changes to `RUNNING` and a new WORKFLOW_EXECUTION_UNPAUSED event is added to the history + - Workflow tasks and activity tasks are resumed. + operationId: UnpauseWorkflowExecution + parameters: + - name: namespace + in: path + description: Namespace of the workflow to unpause. + required: true + schema: + type: string + - name: workflowId + in: path + description: ID of the workflow execution to be paused. Required. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseWorkflowExecutionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnpauseWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{workflow_execution.workflow_id}/cancel: post: tags: diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 085eba306..8b0eb2ce6 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1298,6 +1298,10 @@ service WorkflowService { option (google.api.http) = { post: "/namespaces/{namespace}/workflows/{workflow_id}/pause" body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/pause" + body: "*" + } }; } @@ -1310,6 +1314,10 @@ service WorkflowService { option (google.api.http) = { post: "/namespaces/{namespace}/workflows/{workflow_id}/unpause" body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{workflow_id}/unpause" + body: "*" + } }; }