diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 4a5ab1d6..1bf7cb4d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1541,6 +1541,259 @@ ] } }, + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}": { + "post": { + "operationId": "DescribeActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/pause": { + "post": { + "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", + "operationId": "PauseActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/reset": { + "post": { + "summary": "Reset will reset activity to an initial state.", + "operationId": "ResetActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResetActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/resume": { + "post": { + "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", + "operationId": "ResumeActivity2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ResumeActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResumeActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/update": { + "post": { + "operationId": "UpdateActivityOptions2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflows/{execution.workflowId}": { "get": { "summary": "DescribeWorkflowExecution returns information about the specified workflow execution.", @@ -3880,30 +4133,259 @@ "collectionFormat": "multi" }, { - "name": "taskQueues", - "description": "Task queues to retrieve reachability for. Leave this empty to query for all task queues associated with given\nbuild ids in the namespace.\nMust specify at least one task queue if querying for an unversioned worker.\nThe number of task queues that the server will fetch reachability information for is limited.\nSee the `GetWorkerTaskReachabilityResponse` documentation for more information.", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi" + "name": "taskQueues", + "description": "Task queues to retrieve reachability for. Leave this empty to query for all task queues associated with given\nbuild ids in the namespace.\nMust specify at least one task queue if querying for an unversioned worker.\nThe number of task queues that the server will fetch reachability information for is limited.\nSee the `GetWorkerTaskReachabilityResponse` documentation for more information.", + "in": "query", + "required": false, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi" + }, + { + "name": "reachability", + "description": "Type of reachability to query for.\n`TASK_REACHABILITY_NEW_WORKFLOWS` is always returned in the response.\nUse `TASK_REACHABILITY_EXISTING_WORKFLOWS` if your application needs to respond to queries on closed workflows.\nOtherwise, use `TASK_REACHABILITY_OPEN_WORKFLOWS`. Default is `TASK_REACHABILITY_EXISTING_WORKFLOWS` if left\nunspecified.\nSee the TaskReachability docstring for information about each enum variant.\n\n - TASK_REACHABILITY_NEW_WORKFLOWS: There's a possiblity for a worker to receive new workflow tasks. Workers should *not* be retired.\n - TASK_REACHABILITY_EXISTING_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from existing workflows. Workers\nshould *not* be retired.\nThis enum value does not distinguish between open and closed workflows.\n - TASK_REACHABILITY_OPEN_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from open workflows. Workers\nshould *not* be retired.\n - TASK_REACHABILITY_CLOSED_WORKFLOWS: There's a possiblity for a worker to receive existing workflow tasks from closed workflows. Workers may be\nretired dependending on application requirements. For example, if there's no need to query closed workflows.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "TASK_REACHABILITY_UNSPECIFIED", + "TASK_REACHABILITY_NEW_WORKFLOWS", + "TASK_REACHABILITY_EXISTING_WORKFLOWS", + "TASK_REACHABILITY_OPEN_WORKFLOWS", + "TASK_REACHABILITY_CLOSED_WORKFLOWS" + ], + "default": "TASK_REACHABILITY_UNSPECIFIED" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflow-count": { + "get": { + "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", + "operationId": "CountWorkflowExecutions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CountWorkflowExecutionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "query", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows": { + "get": { + "summary": "ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.", + "operationId": "ListWorkflowExecutions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListWorkflowExecutionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "pageSize", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "nextPageToken", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + }, + { + "name": "query", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/execute-multi-operation": { + "post": { + "summary": "ExecuteMultiOperation executes multiple operations within a single workflow.", + "description": "Operations are started atomically, meaning if *any* operation fails to be started, none are,\nand the request fails. Upon start, the API returns only when *all* operations have a response.\n\nUpon failure, it returns `MultiOperationExecutionFailure` where the status code\nequals the status code of the *first* operation that failed to be started.\n\nNOTE: Experimental API.", + "operationId": "ExecuteMultiOperation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ExecuteMultiOperationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceExecuteMultiOperationBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}": { + "post": { + "operationId": "DescribeActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceDescribeActivityBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/pause": { + "post": { + "summary": "PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started.", + "operationId": "PauseActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PauseActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" }, { - "name": "reachability", - "description": "Type of reachability to query for.\n`TASK_REACHABILITY_NEW_WORKFLOWS` is always returned in the response.\nUse `TASK_REACHABILITY_EXISTING_WORKFLOWS` if your application needs to respond to queries on closed workflows.\nOtherwise, use `TASK_REACHABILITY_OPEN_WORKFLOWS`. Default is `TASK_REACHABILITY_EXISTING_WORKFLOWS` if left\nunspecified.\nSee the TaskReachability docstring for information about each enum variant.\n\n - TASK_REACHABILITY_NEW_WORKFLOWS: There's a possiblity for a worker to receive new workflow tasks. Workers should *not* be retired.\n - TASK_REACHABILITY_EXISTING_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from existing workflows. Workers\nshould *not* be retired.\nThis enum value does not distinguish between open and closed workflows.\n - TASK_REACHABILITY_OPEN_WORKFLOWS: There's a possiblity for a worker to receive existing workflow and activity tasks from open workflows. Workers\nshould *not* be retired.\n - TASK_REACHABILITY_CLOSED_WORKFLOWS: There's a possiblity for a worker to receive existing workflow tasks from closed workflows. Workers may be\nretired dependending on application requirements. For example, if there's no need to query closed workflows.", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "TASK_REACHABILITY_UNSPECIFIED", - "TASK_REACHABILITY_NEW_WORKFLOWS", - "TASK_REACHABILITY_EXISTING_WORKFLOWS", - "TASK_REACHABILITY_OPEN_WORKFLOWS", - "TASK_REACHABILITY_CLOSED_WORKFLOWS" - ], - "default": "TASK_REACHABILITY_UNSPECIFIED" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServicePauseActivityBody" + } } ], "tags": [ @@ -3911,15 +4393,15 @@ ] } }, - "/namespaces/{namespace}/workflow-count": { - "get": { - "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", - "operationId": "CountWorkflowExecutions", + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/reset": { + "post": { + "summary": "Reset will reset activity to an initial state.", + "operationId": "ResetActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CountWorkflowExecutionsResponse" + "$ref": "#/definitions/v1ResetActivityResponse" } }, "default": { @@ -3937,10 +4419,24 @@ "type": "string" }, { - "name": "query", - "in": "query", - "required": false, + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResetActivityBody" + } } ], "tags": [ @@ -3948,15 +4444,15 @@ ] } }, - "/namespaces/{namespace}/workflows": { - "get": { - "summary": "ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.", - "operationId": "ListWorkflowExecutions", + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/resume": { + "post": { + "summary": "ResumeActivity will unpause the activity is the activity is in the paused state.", + "operationId": "ResumeActivity", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListWorkflowExecutionsResponse" + "$ref": "#/definitions/v1ResumeActivityResponse" } }, "default": { @@ -3974,24 +4470,24 @@ "type": "string" }, { - "name": "pageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" }, { - "name": "nextPageToken", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" }, { - "name": "query", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceResumeActivityBody" + } } ], "tags": [ @@ -3999,16 +4495,14 @@ ] } }, - "/namespaces/{namespace}/workflows/execute-multi-operation": { + "/namespaces/{namespace}/workflows/{activityExecution.workflowExecution.workflowId}/activities/{activityExecution.activityId}/update": { "post": { - "summary": "ExecuteMultiOperation executes multiple operations within a single workflow.", - "description": "Operations are started atomically, meaning if *any* operation fails to be started, none are,\nand the request fails. Upon start, the API returns only when *all* operations have a response.\n\nUpon failure, it returns `MultiOperationExecutionFailure` where the status code\nequals the status code of the *first* operation that failed to be started.\n\nNOTE: Experimental API.", - "operationId": "ExecuteMultiOperation", + "operationId": "UpdateActivityOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ExecuteMultiOperationResponse" + "$ref": "#/definitions/v1UpdateActivityOptionsResponse" } }, "default": { @@ -4025,12 +4519,24 @@ "required": true, "type": "string" }, + { + "name": "activityExecution.workflowExecution.workflowId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityExecution.activityId", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceExecuteMultiOperationBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityOptionsBody" } } ], @@ -4905,6 +5411,29 @@ } } }, + "WorkflowServiceDescribeActivityBody": { + "type": "object", + "properties": { + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceExecuteMultiOperationBody": { "type": "object", "properties": { @@ -4934,6 +5463,29 @@ } } }, + "WorkflowServicePauseActivityBody": { + "type": "object", + "properties": { + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceQueryWorkflowBody": { "type": "object", "properties": { @@ -5039,6 +5591,35 @@ } } }, + "WorkflowServiceResetActivityBody": { + "type": "object", + "properties": { + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" + }, + "triggerImmediately": { + "type": "boolean" + }, + "keepPaused": { + "type": "boolean" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceResetWorkflowExecutionBody": { "type": "object", "properties": { @@ -5225,6 +5806,32 @@ } } }, + "WorkflowServiceResumeActivityBody": { + "type": "object", + "properties": { + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" + }, + "triggerImmediately": { + "type": "boolean" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceSignalWithStartWorkflowExecutionBody": { "type": "object", "properties": { @@ -5514,6 +6121,32 @@ } } }, + "WorkflowServiceUpdateActivityOptionsBody": { + "type": "object", + "properties": { + "activityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "type": "object", + "properties": { + "runId": { + "type": "string" + } + }, + "description": "Identifies a specific workflow within a namespace. Practically speaking, because run_id is a\nuuid, a workflow execution is globally unique. Note that many commands allow specifying an empty\nrun id as a way of saying \"target the latest run of the workflow\"." + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" + }, + "activityOptionsUpdate": { + "$ref": "#/definitions/v1OptionsUpdate" + }, + "identity": { + "type": "string" + } + } + }, "WorkflowServiceUpdateNamespaceBody": { "type": "object", "properties": { @@ -5755,6 +6388,18 @@ } } }, + "v1ActivityExecution": { + "type": "object", + "properties": { + "workflowExecution": { + "$ref": "#/definitions/v1WorkflowExecution" + }, + "activityId": { + "type": "string" + } + }, + "title": "Identifies a specific activity within a namespace. ActivityExecution is expected to be\nglobally unique for running workflows.\nrun_id in workflow_execution can be empty,\nwhen run_id is empty the latest run of the workflow should be selected" + }, "v1ActivityFailureInfo": { "type": "object", "properties": { @@ -5794,6 +6439,19 @@ } } }, + "v1ActivityState": { + "type": "string", + "enum": [ + "ACTIVITY_STATE_UNSPECIFIED", + "ACTIVITY_STATE_SCHEDULED", + "ACTIVITY_STATE_STARTED", + "ACTIVITY_STATE_PAUSED", + "ACTIVITY_STATE_SUCCEEDED", + "ACTIVITY_STATE_FAILED", + "ACTIVITY_STATE_TIMED_OUT" + ], + "default": "ACTIVITY_STATE_UNSPECIFIED" + }, "v1ActivityTaskCancelRequestedEventAttributes": { "type": "object", "properties": { @@ -6949,6 +7607,17 @@ "type": "object", "description": "Deprecated." }, + "v1DescribeActivityResponse": { + "type": "object", + "properties": { + "activityOptions": { + "$ref": "#/definitions/v1Options" + }, + "activityState": { + "$ref": "#/definitions/v1ActivityState" + } + } + }, "v1DescribeBatchOperationResponse": { "type": "object", "properties": { @@ -8553,6 +9222,37 @@ }, "description": "Nexus operation timed out." }, + "v1Options": { + "type": "object", + "properties": { + "taskQueue": { + "$ref": "#/definitions/v1TaskQueue" + }, + "timeouts": { + "$ref": "#/definitions/v1Timeouts" + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy" + } + } + }, + "v1OptionsUpdate": { + "type": "object", + "properties": { + "taskQueue": { + "type": "string" + }, + "timeouts": { + "$ref": "#/definitions/v1Timeouts" + }, + "retryPolicy": { + "$ref": "#/definitions/v1RetryPolicy" + }, + "updateMask": { + "type": "string" + } + } + }, "v1Outcome": { "type": "object", "properties": { @@ -8580,6 +9280,9 @@ "v1PatchScheduleResponse": { "type": "object" }, + "v1PauseActivityResponse": { + "type": "object" + }, "v1Payload": { "description": "Arbitrary payload data in an unconstrained format.\nThis may be activity input parameters, a workflow result, a memo, etc.\n" }, @@ -9318,6 +10021,9 @@ "v1RequestCancelWorkflowExecutionResponse": { "type": "object" }, + "v1ResetActivityResponse": { + "type": "object" + }, "v1ResetOptions": { "type": "object", "properties": { @@ -9528,6 +10234,9 @@ "v1RespondWorkflowTaskFailedResponse": { "type": "object" }, + "v1ResumeActivityResponse": { + "type": "object" + }, "v1RetryPolicy": { "type": "object", "properties": { @@ -10835,6 +11544,27 @@ ], "default": "TIMEOUT_TYPE_UNSPECIFIED" }, + "v1Timeouts": { + "type": "object", + "properties": { + "scheduleToClose": { + "type": "string", + "description": "Indicates how long the caller is willing to wait for activity completion. The \"schedule\" time\nis when the activity is initially scheduled, not when the most recent retry is scheduled.\nLimits how long retries will be attempted. Either this or `start_to_close_timeout` must be\nspecified. When not specified, defaults to the workflow execution timeout.\n" + }, + "scheduleToStart": { + "type": "string", + "title": "Limits the time an activity task can stay in a task queue before a worker picks it up. The\n\"schedule\" time is when the most recent retry is scheduled. This timeout should usually not\nbe set: it's useful in specific scenarios like worker-specific task queues. This timeout is\nalways non retryable, as all a retry would achieve is to put it back into the same queue.\nDefaults to `schedule_to_close_timeout` or workflow execution timeout if that is not\nspecified. More info:\nhttps://docs.temporal.io/docs/content/what-is-a-schedule-to-start-timeout/" + }, + "startToClose": { + "type": "string", + "description": "Maximum time an activity is allowed to execute after being picked up by a worker. This\ntimeout is always retryable. Either this or `schedule_to_close_timeout` must be specified.\n" + }, + "heartbeatTimeout": { + "type": "string", + "description": "Maximum permitted time between successful worker heartbeats." + } + } + }, "v1TimerCanceledEventAttributes": { "type": "object", "properties": { @@ -10935,6 +11665,9 @@ } } }, + "v1UpdateActivityOptionsResponse": { + "type": "object" + }, "v1UpdateAdmittedEventOrigin": { "type": "string", "enum": [ diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 6d9d73fa..875f2b8f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1317,6 +1317,209 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id} + : post: + tags: + - WorkflowService + operationId: DescribeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause + : post: + tags: + - WorkflowService + description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + operationId: PauseActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset + : post: + tags: + - WorkflowService + description: Reset will reset activity to an initial state. + operationId: ResetActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume + : post: + tags: + - WorkflowService + description: ResumeActivity will unpause the activity is the activity is in the paused state. + operationId: ResumeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update + : post: + tags: + - WorkflowService + operationId: UpdateActivityOptions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}: get: tags: @@ -3486,6 +3689,209 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id} + : post: + tags: + - WorkflowService + operationId: DescribeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause + : post: + tags: + - WorkflowService + description: PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + operationId: PauseActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PauseActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset + : post: + tags: + - WorkflowService + description: Reset will reset activity to an initial state. + operationId: ResetActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResetActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume + : post: + tags: + - WorkflowService + description: ResumeActivity will unpause the activity is the activity is in the paused state. + operationId: ResumeActivity + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ResumeActivityResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update + : post: + tags: + - WorkflowService + operationId: UpdateActivityOptions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: activity_execution.workflow_execution.workflow_id + in: path + required: true + schema: + type: string + - name: activity_execution.activity_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityOptionsRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateActivityOptionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflows/{execution.workflow_id}: get: tags: @@ -4014,6 +4420,18 @@ paths: $ref: '#/components/schemas/Status' components: schemas: + ActivityExecution: + type: object + properties: + workflowExecution: + $ref: '#/components/schemas/WorkflowExecution' + activityId: + type: string + description: |- + Identifies a specific activity within a namespace. ActivityExecution is expected to be + globally unique for running workflows. + run_id in workflow_execution can be empty, + when run_id is empty the latest run of the workflow should be selected ActivityFailureInfo: type: object properties: @@ -4977,6 +5395,31 @@ components: DeleteScheduleResponse: type: object properties: {} + DescribeActivityRequest: + type: object + properties: + namespace: + type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' + identity: + type: string + DescribeActivityResponse: + type: object + properties: + activityOptions: + $ref: '#/components/schemas/Options' + activityState: + enum: + - ACTIVITY_STATE_UNSPECIFIED + - ACTIVITY_STATE_SCHEDULED + - ACTIVITY_STATE_STARTED + - ACTIVITY_STATE_PAUSED + - ACTIVITY_STATE_SUCCEEDED + - ACTIVITY_STATE_FAILED + - ACTIVITY_STATE_TIMED_OUT + type: string + format: enum DescribeBatchOperationResponse: type: object properties: @@ -6312,6 +6755,27 @@ components: type: string description: The request ID allocated at schedule time. description: Nexus operation timed out. + Options: + type: object + properties: + taskQueue: + $ref: '#/components/schemas/TaskQueue' + timeouts: + $ref: '#/components/schemas/Timeouts' + retryPolicy: + $ref: '#/components/schemas/RetryPolicy' + OptionsUpdate: + type: object + properties: + taskQueue: + type: string + timeouts: + $ref: '#/components/schemas/Timeouts' + retryPolicy: + $ref: '#/components/schemas/RetryPolicy' + updateMask: + type: string + format: field-mask Outcome: type: object properties: @@ -6340,6 +6804,18 @@ components: PatchScheduleResponse: type: object properties: {} + PauseActivityRequest: + type: object + properties: + namespace: + type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' + identity: + type: string + PauseActivityResponse: + type: object + properties: {} Payload: description: |- Represents some binary (byte array) data (ex: activity input parameters or workflow result) with @@ -6880,6 +7356,22 @@ components: RequestCancelWorkflowExecutionResponse: type: object properties: {} + ResetActivityRequest: + type: object + properties: + namespace: + type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' + triggerImmediately: + type: boolean + keepPaused: + type: boolean + identity: + type: string + ResetActivityResponse: + type: object + properties: {} ResetOptions: type: object properties: @@ -7188,6 +7680,20 @@ components: description: |- Server validation failures could include last_heartbeat_details payload is too large, request failure is too large + ResumeActivityRequest: + type: object + properties: + namespace: + type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' + triggerImmediately: + type: boolean + identity: + type: string + ResumeActivityResponse: + type: object + properties: {} RetryPolicy: type: object properties: @@ -8314,6 +8820,47 @@ components: format: enum lastHeartbeatDetails: $ref: '#/components/schemas/Payloads' + Timeouts: + type: object + properties: + scheduleToClose: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Indicates how long the caller is willing to wait for activity completion. The "schedule" time + is when the activity is initially scheduled, not when the most recent retry is scheduled. + Limits how long retries will be attempted. Either this or `start_to_close_timeout` must be + specified. When not specified, defaults to the workflow execution timeout. + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + scheduleToStart: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Limits the time an activity task can stay in a task queue before a worker picks it up. The + "schedule" time is when the most recent retry is scheduled. This timeout should usually not + be set: it's useful in specific scenarios like worker-specific task queues. This timeout is + always non retryable, as all a retry would achieve is to put it back into the same queue. + Defaults to `schedule_to_close_timeout` or workflow execution timeout if that is not + specified. More info: + https://docs.temporal.io/docs/content/what-is-a-schedule-to-start-timeout/ + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + startToClose: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: |- + Maximum time an activity is allowed to execute after being picked up by a worker. This + timeout is always retryable. Either this or `schedule_to_close_timeout` must be specified. + + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" is used to indicate interval. --) + heartbeatTimeout: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Maximum permitted time between successful worker heartbeats. TimerCanceledEventAttributes: type: object properties: @@ -8386,6 +8933,20 @@ components: type: string description: If set, override overlap policy for this one request. format: enum + UpdateActivityOptionsRequest: + type: object + properties: + namespace: + type: string + activityExecution: + $ref: '#/components/schemas/ActivityExecution' + activityOptionsUpdate: + $ref: '#/components/schemas/OptionsUpdate' + identity: + type: string + UpdateActivityOptionsResponse: + type: object + properties: {} UpdateNamespaceInfo: type: object properties: diff --git a/temporal/api/activity/v1/message.proto b/temporal/api/activity/v1/message.proto new file mode 100644 index 00000000..43e98a48 --- /dev/null +++ b/temporal/api/activity/v1/message.proto @@ -0,0 +1,86 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.activity.v1; + +option go_package = "go.temporal.io/api/activity/v1;activity"; +option java_package = "io.temporal.api.activity.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporalio::Api::Activity::V1"; +option csharp_namespace = "Temporalio.Api.Activity.V1"; + +import "temporal/api/common/v1/message.proto"; +import "temporal/api/taskqueue/v1/message.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; + +message Timeouts { + // Indicates how long the caller is willing to wait for activity completion. The "schedule" time + // is when the activity is initially scheduled, not when the most recent retry is scheduled. + // Limits how long retries will be attempted. Either this or `start_to_close_timeout` must be + // specified. When not specified, defaults to the workflow execution timeout. + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_close = 1; + // Limits the time an activity task can stay in a task queue before a worker picks it up. The + // "schedule" time is when the most recent retry is scheduled. This timeout should usually not + // be set: it's useful in specific scenarios like worker-specific task queues. This timeout is + // always non retryable, as all a retry would achieve is to put it back into the same queue. + // Defaults to `schedule_to_close_timeout` or workflow execution timeout if that is not + // specified. More info: + // https://docs.temporal.io/docs/content/what-is-a-schedule-to-start-timeout/ + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration schedule_to_start = 2; + // Maximum time an activity is allowed to execute after being picked up by a worker. This + // timeout is always retryable. Either this or `schedule_to_close_timeout` must be specified. + // + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" is used to indicate interval. --) + google.protobuf.Duration start_to_close = 3; + // Maximum permitted time between successful worker heartbeats. + google.protobuf.Duration heartbeat_timeout = 4; +} + +message Options { + temporal.api.taskqueue.v1.TaskQueue task_queue = 1; + + temporal.api.activity.v1.Timeouts timeouts = 2; + + temporal.api.common.v1.RetryPolicy retry_policy = 3; +} + +message OptionsUpdate { + string task_queue = 1; + + temporal.api.activity.v1.Timeouts timeouts = 2; + + temporal.api.common.v1.RetryPolicy retry_policy = 3; + + google.protobuf.FieldMask update_mask = 4; +} diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 4284a706..4f474349 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -80,6 +80,15 @@ message WorkflowExecution { string run_id = 2; } +// Identifies a specific activity within a namespace. ActivityExecution is expected to be +// globally unique for running workflows. +// run_id in workflow_execution can be empty, +// when run_id is empty the latest run of the workflow should be selected +message ActivityExecution { + temporal.api.common.v1.WorkflowExecution workflow_execution = 1; + string activity_id = 2; +} + // Represents the identifier used by a workflow author to define the workflow. Typically, the // name of a function. This is sometimes referred to as the workflow's "name" message WorkflowType { diff --git a/temporal/api/enums/v1/activity.proto b/temporal/api/enums/v1/activity.proto new file mode 100644 index 00000000..3b44f014 --- /dev/null +++ b/temporal/api/enums/v1/activity.proto @@ -0,0 +1,44 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.enums.v1; + +option go_package = "go.temporal.io/api/enums/v1;enums"; +option java_package = "io.temporal.api.enums.v1"; +option java_multiple_files = true; +option java_outer_classname = "ActivityProto"; +option ruby_package = "Temporalio::Api::Enums::V1"; +option csharp_namespace = "Temporalio.Api.Enums.V1"; + + +enum ActivityState { + ACTIVITY_STATE_UNSPECIFIED = 0; + ACTIVITY_STATE_SCHEDULED = 1; + ACTIVITY_STATE_STARTED = 2; + ACTIVITY_STATE_PAUSED = 3; + ACTIVITY_STATE_SUCCEEDED = 4; + ACTIVITY_STATE_FAILED = 5; + ACTIVITY_STATE_TIMED_OUT = 6; +} + diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index e086d72f..de07f2cb 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -31,11 +31,12 @@ option java_outer_classname = "RequestResponseProto"; option ruby_package = "Temporalio::Api::WorkflowService::V1"; option csharp_namespace = "Temporalio.Api.WorkflowService.V1"; +import "temporal/api/enums/v1/activity.proto"; import "temporal/api/enums/v1/batch_operation.proto"; +import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/workflow.proto"; import "temporal/api/enums/v1/namespace.proto"; import "temporal/api/enums/v1/failed_cause.proto"; -import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/query.proto"; import "temporal/api/enums/v1/reset.proto"; import "temporal/api/enums/v1/task_queue.proto"; @@ -55,6 +56,7 @@ import "temporal/api/taskqueue/v1/message.proto"; import "temporal/api/update/v1/message.proto"; import "temporal/api/version/v1/message.proto"; import "temporal/api/batch/v1/message.proto"; +import "temporal/api/activity/v1/message.proto"; import "temporal/api/sdk/v1/task_complete_metadata.proto"; import "temporal/api/sdk/v1/user_metadata.proto"; import "temporal/api/nexus/v1/message.proto"; @@ -1652,3 +1654,62 @@ message ExecuteMultiOperationResponse { } } } + +message UpdateActivityOptionsRequest { + string namespace = 1; + temporal.api.common.v1.ActivityExecution activity_execution = 2; + + temporal.api.activity.v1.OptionsUpdate activity_options_update = 3; + string identity = 4; +} + +message UpdateActivityOptionsResponse { +} + +message DescribeActivityRequest { + string namespace = 1; + temporal.api.common.v1.ActivityExecution activity_execution = 2; + + string identity = 3; +} + +message DescribeActivityResponse { + temporal.api.activity.v1.Options activity_options = 1; + + temporal.api.enums.v1.ActivityState activity_state = 2; +} + +message PauseActivityRequest { + string namespace = 1; + temporal.api.common.v1.ActivityExecution activity_execution = 2; + + string identity = 5; +} + +message PauseActivityResponse { +} + +message ResumeActivityRequest { + string namespace = 1; + temporal.api.common.v1.ActivityExecution activity_execution = 2; + + bool trigger_immediately = 5; + + string identity = 6; +} + +message ResumeActivityResponse { +} + +message ResetActivityRequest { + string namespace = 1; + temporal.api.common.v1.ActivityExecution activity_execution = 2; + + bool trigger_immediately = 5; + bool keep_paused = 6; + + string identity = 7; +} + +message ResetActivityResponse { +} \ No newline at end of file diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index cd73cb81..0c3f8278 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -835,4 +835,65 @@ service WorkflowService { // aip.dev/not-precedent: We do not expose worker API to HTTP. --) rpc RespondNexusTaskFailed(RespondNexusTaskFailedRequest) returns (RespondNexusTaskFailedResponse) { } + + rpc UpdateActivityOptions (UpdateActivityOptionsRequest) returns (UpdateActivityOptionsResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/update" + body: "*" + } + }; + } + + rpc DescribeActivity (DescribeActivityRequest) returns (DescribeActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}" + body: "*" + } + }; + } + + // PauseActivity will set activity into a paused state. It means if activity is not running, it will not be started. + rpc PauseActivity (PauseActivityRequest) returns (PauseActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/pause" + body: "*" + } + }; + } + // ResumeActivity will unpause the activity is the activity is in the paused state. + rpc ResumeActivity (ResumeActivityRequest) returns (ResumeActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/resume" + body: "*" + } + }; + } + // Reset will reset activity to an initial state. + rpc ResetActivity (ResetActivityRequest) returns (ResetActivityResponse) + { + option (google.api.http) = { + post: "/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{activity_execution.workflow_execution.workflow_id}/activities/{activity_execution.activity_id}/reset" + body: "*" + } + }; + } }