diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 0b643ceb7..79c1e8960 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1021,6 +1021,334 @@ ] } }, + "/api/v1/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}": { + "get": { + "summary": "DescribeChannel returns the listeners of a channel and its latest\nnotification.", + "operationId": "DescribeChannel6", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}/listeners": { + "post": { + "summary": "RegisterChannelListener registers a callback as a listener of a channel. A\nWorkflow registers itself with the `SubscribeNotificationChannel` command\ninstead.", + "operationId": "RegisterChannelListener6", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RegisterChannelListenerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRegisterChannelListenerBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}/listeners/{listenerId}": { + "delete": { + "summary": "UnregisterChannelListener removes a listener from a channel.", + "operationId": "UnregisterChannelListener6", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnregisterChannelListenerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "listenerId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the caller, for metrics and logs.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}/notifications": { + "get": { + "summary": "PollChannel is a long poll for clients. It returns the retained\nnotifications of a channel with a counter above `after_counter`, waiting\nup to `wait` for one when none is retained yet.", + "operationId": "PollChannel6", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PollChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "afterCounter", + "description": "Only notifications with a counter above this one are returned.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "wait", + "description": "How long to wait for a notification when none is retained above\n`after_counter`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maxNotifications", + "description": "At most this many notifications are returned. Zero means the server's\ndefault.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/activities/{execution.businessId}/channels/{notification.channel}/notify": { + "post": { + "summary": "NotifyChannel tells every listener of a channel that a source they consume\nhas moved. The writer names no addressee and never learns who listens. The\nserver wakes each listener: a Workflow with a Workflow Task, a callback by\ninvoking it. Nothing goes to History except the notifications a woken\nWorkflow Task carries on its scheduled event.", + "operationId": "NotifyChannel6", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1NotifyChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "notification.channel", + "description": "The channel the writer notified. Listeners register on the same name.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceNotifyChannelBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/activity-complete": { "post": { "summary": "RespondActivityTaskCompleted is called by workers when they successfully complete an activity\ntask.", @@ -1375,26 +1703,343 @@ }, "parameters": [ { - "name": "namespace", - "description": "Namespace that contains the batch operation", - "in": "path", - "required": true, + "name": "namespace", + "description": "Namespace that contains the batch operation", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "jobId", + "description": "Job ID defines the unique ID for the batch job", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceStartBatchOperationBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/batch-operations/{jobId}/stop": { + "post": { + "summary": "StopBatchOperation stops a batch operation", + "operationId": "StopBatchOperation2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StopBatchOperationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace that contains the batch operation", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "jobId", + "description": "Batch job id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceStopBatchOperationBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/channels/{channel}": { + "get": { + "summary": "DescribeChannel returns the listeners of a channel and its latest\nnotification.", + "operationId": "DescribeChannel2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.businessId", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/channels/{channel}/listeners": { + "post": { + "summary": "RegisterChannelListener registers a callback as a listener of a channel. A\nWorkflow registers itself with the `SubscribeNotificationChannel` command\ninstead.", + "operationId": "RegisterChannelListener2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RegisterChannelListenerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRegisterChannelListenerBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/channels/{channel}/listeners/{listenerId}": { + "delete": { + "summary": "UnregisterChannelListener removes a listener from a channel.", + "operationId": "UnregisterChannelListener2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnregisterChannelListenerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "listenerId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the caller, for metrics and logs.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.businessId", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/channels/{channel}/notifications": { + "get": { + "summary": "PollChannel is a long poll for clients. It returns the retained\nnotifications of a channel with a counter above `after_counter`, waiting\nup to `wait` for one when none is retained yet.", + "operationId": "PollChannel2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PollChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "afterCounter", + "description": "Only notifications with a counter above this one are returned.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "wait", + "description": "How long to wait for a notification when none is retained above\n`after_counter`.", + "in": "query", + "required": false, "type": "string" }, { - "name": "jobId", - "description": "Job ID defines the unique ID for the batch job", - "in": "path", - "required": true, + "name": "maxNotifications", + "description": "At most this many notifications are returned. Zero means the server's\ndefault.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.businessId", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceStartBatchOperationBody" - } + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -1402,15 +2047,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/batch-operations/{jobId}/stop": { + "/api/v1/namespaces/{namespace}/channels/{notification.channel}/notify": { "post": { - "summary": "StopBatchOperation stops a batch operation", - "operationId": "StopBatchOperation2", + "summary": "NotifyChannel tells every listener of a channel that a source they consume\nhas moved. The writer names no addressee and never learns who listens. The\nserver wakes each listener: a Workflow with a Workflow Task, a callback by\ninvoking it. Nothing goes to History except the notifications a woken\nWorkflow Task carries on its scheduled event.", + "operationId": "NotifyChannel2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StopBatchOperationResponse" + "$ref": "#/definitions/v1NotifyChannelResponse" } }, "default": { @@ -1423,14 +2068,13 @@ "parameters": [ { "name": "namespace", - "description": "Namespace that contains the batch operation", "in": "path", "required": true, "type": "string" }, { - "name": "jobId", - "description": "Batch job id", + "name": "notification.channel", + "description": "The channel the writer notified. Listeners register on the same name.", "in": "path", "required": true, "type": "string" @@ -1440,7 +2084,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStopBatchOperationBody" + "$ref": "#/definitions/WorkflowServiceNotifyChannelBody" } } ], @@ -3502,15 +4146,233 @@ ] } }, - "/api/v1/namespaces/{namespace}/workers": { + "/api/v1/namespaces/{namespace}/workers": { + "get": { + "summary": "ListWorkers is a visibility API to list worker status information in a specific namespace.", + "operationId": "ListWorkers2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListWorkersResponse" + } + }, + "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", + "description": "`query` in ListWorkers is used to filter workers based on worker attributes.\nSupported attributes:\n* WorkerInstanceKey\n* WorkerIdentity\n* HostName\n* TaskQueue\n* DeploymentName\n* BuildId\n* SdkName\n* SdkVersion\n* StartTime\n* Status", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "includeSystemWorkers", + "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { + "get": { + "summary": "DescribeWorker returns information about the specified worker.", + "operationId": "DescribeWorker2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workerInstanceKey", + "description": "Worker instance key to describe.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workers/fetch-config": { + "post": { + "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", + "operationId": "FetchWorkerConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1FetchWorkerConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceFetchWorkerConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workers/heartbeat": { + "post": { + "summary": "WorkerHeartbeat receive heartbeat request from the worker.", + "operationId": "RecordWorkerHeartbeat2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RecordWorkerHeartbeatResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRecordWorkerHeartbeatBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workers/update-config": { + "post": { + "summary": "UpdateWorkerConfig updates the worker configuration of one or more workers.\nCan be used to partially update the worker configuration.\nCan be used to update the configuration of multiple workers.", + "operationId": "UpdateWorkerConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkerConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkerConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/api/v1/namespaces/{namespace}/workflow-count": { "get": { - "summary": "ListWorkers is a visibility API to list worker status information in a specific namespace.", - "operationId": "ListWorkers2", + "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", + "operationId": "CountWorkflowExecutions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListWorkersResponse" + "$ref": "#/definitions/v1CountWorkflowExecutionsResponse" } }, "default": { @@ -3527,33 +4389,11 @@ "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", - "description": "`query` in ListWorkers is used to filter workers based on worker attributes.\nSupported attributes:\n* WorkerInstanceKey\n* WorkerIdentity\n* HostName\n* TaskQueue\n* DeploymentName\n* BuildId\n* SdkName\n* SdkVersion\n* StartTime\n* Status", "in": "query", "required": false, "type": "string" - }, - { - "name": "includeSystemWorkers", - "description": "When true, the response will include system workers that are created implicitly\nby the server and not by the user. By default, system workers are excluded.", - "in": "query", - "required": false, - "type": "boolean" } ], "tags": [ @@ -3561,15 +4401,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { + "/api/v1/namespaces/{namespace}/workflow-rules": { "get": { - "summary": "DescribeWorker returns information about the specified worker.", - "operationId": "DescribeWorker2", + "summary": "Return all namespace workflow rules", + "operationId": "ListWorkflowRules2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeWorkerResponse" + "$ref": "#/definitions/v1ListWorkflowRulesResponse" } }, "default": { @@ -3582,33 +4422,30 @@ "parameters": [ { "name": "namespace", - "description": "Namespace this worker belongs to.", "in": "path", "required": true, "type": "string" }, { - "name": "workerInstanceKey", - "description": "Worker instance key to describe.", - "in": "path", - "required": true, - "type": "string" + "name": "nextPageToken", + "in": "query", + "required": false, + "type": "string", + "format": "byte" } ], "tags": [ "WorkflowService" ] - } - }, - "/api/v1/namespaces/{namespace}/workers/fetch-config": { + }, "post": { - "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", - "operationId": "FetchWorkerConfig2", + "summary": "Create a new workflow rule. The rules are used to control the workflow execution.\nThe rule will be applied to all running and new workflows in the namespace.\nIf the rule with such ID already exist this call will fail\nNote: the rules are part of namespace configuration and will be stored in the namespace config.\nNamespace config is eventually consistent.", + "operationId": "CreateWorkflowRule2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1FetchWorkerConfigResponse" + "$ref": "#/definitions/v1CreateWorkflowRuleResponse" } }, "default": { @@ -3621,7 +4458,6 @@ "parameters": [ { "name": "namespace", - "description": "Namespace this worker belongs to.", "in": "path", "required": true, "type": "string" @@ -3631,7 +4467,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceFetchWorkerConfigBody" + "$ref": "#/definitions/WorkflowServiceCreateWorkflowRuleBody" } } ], @@ -3640,15 +4476,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workers/heartbeat": { - "post": { - "summary": "WorkerHeartbeat receive heartbeat request from the worker.", - "operationId": "RecordWorkerHeartbeat2", + "/api/v1/namespaces/{namespace}/workflow-rules/{ruleId}": { + "get": { + "summary": "DescribeWorkflowRule return the rule specification for existing rule id.\nIf there is no rule with such id - NOT FOUND error will be returned.", + "operationId": "DescribeWorkflowRule2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordWorkerHeartbeatResponse" + "$ref": "#/definitions/v1DescribeWorkflowRuleResponse" } }, "default": { @@ -3661,34 +4497,30 @@ "parameters": [ { "name": "namespace", - "description": "Namespace this worker belongs to.", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "ruleId", + "description": "User-specified ID of the rule to read. Unique within the namespace.", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRecordWorkerHeartbeatBody" - } + "type": "string" } ], "tags": [ "WorkflowService" ] - } - }, - "/api/v1/namespaces/{namespace}/workers/update-config": { - "post": { - "summary": "UpdateWorkerConfig updates the worker configuration of one or more workers.\nCan be used to partially update the worker configuration.\nCan be used to update the configuration of multiple workers.", - "operationId": "UpdateWorkerConfig2", + }, + "delete": { + "summary": "Delete rule by rule id", + "operationId": "DeleteWorkflowRule2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkerConfigResponse" + "$ref": "#/definitions/v1DeleteWorkflowRuleResponse" } }, "default": { @@ -3701,18 +4533,16 @@ "parameters": [ { "name": "namespace", - "description": "Namespace this worker belongs to.", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "ruleId", + "description": "ID of the rule to delete. Unique within the namespace.", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateWorkerConfigBody" - } + "type": "string" } ], "tags": [ @@ -3720,15 +4550,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflow-count": { + "/api/v1/namespaces/{namespace}/workflows": { "get": { - "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", - "operationId": "CountWorkflowExecutions2", + "summary": "ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.", + "operationId": "ListWorkflowExecutions2", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CountWorkflowExecutionsResponse" + "$ref": "#/definitions/v1ListWorkflowExecutionsResponse" } }, "default": { @@ -3745,6 +4575,20 @@ "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", @@ -3757,15 +4601,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflow-rules": { + "/api/v1/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}": { "get": { - "summary": "Return all namespace workflow rules", - "operationId": "ListWorkflowRules2", + "summary": "DescribeChannel returns the listeners of a channel and its latest\nnotification.", + "operationId": "DescribeChannel4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListWorkflowRulesResponse" + "$ref": "#/definitions/v1DescribeChannelResponse" } }, "default": { @@ -3783,25 +4627,52 @@ "type": "string" }, { - "name": "nextPageToken", + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", "in": "query", "required": false, "type": "string", - "format": "byte" + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ "WorkflowService" ] - }, + } + }, + "/api/v1/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}/listeners": { "post": { - "summary": "Create a new workflow rule. The rules are used to control the workflow execution.\nThe rule will be applied to all running and new workflows in the namespace.\nIf the rule with such ID already exist this call will fail\nNote: the rules are part of namespace configuration and will be stored in the namespace config.\nNamespace config is eventually consistent.", - "operationId": "CreateWorkflowRule2", + "summary": "RegisterChannelListener registers a callback as a listener of a channel. A\nWorkflow registers itself with the `SubscribeNotificationChannel` command\ninstead.", + "operationId": "RegisterChannelListener4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1CreateWorkflowRuleResponse" + "$ref": "#/definitions/v1RegisterChannelListenerResponse" } }, "default": { @@ -3818,12 +4689,24 @@ "required": true, "type": "string" }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceCreateWorkflowRuleBody" + "$ref": "#/definitions/WorkflowServiceRegisterChannelListenerBody" } } ], @@ -3832,15 +4715,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflow-rules/{ruleId}": { - "get": { - "summary": "DescribeWorkflowRule return the rule specification for existing rule id.\nIf there is no rule with such id - NOT FOUND error will be returned.", - "operationId": "DescribeWorkflowRule2", + "/api/v1/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}/listeners/{listenerId}": { + "delete": { + "summary": "UnregisterChannelListener removes a listener from a channel.", + "operationId": "UnregisterChannelListener4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeWorkflowRuleResponse" + "$ref": "#/definitions/v1UnregisterChannelListenerResponse" } }, "default": { @@ -3858,25 +4741,65 @@ "type": "string" }, { - "name": "ruleId", - "description": "User-specified ID of the rule to read. Unique within the namespace.", + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "listenerId", "in": "path", "required": true, "type": "string" + }, + { + "name": "identity", + "description": "The identity of the caller, for metrics and logs.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ "WorkflowService" ] - }, - "delete": { - "summary": "Delete rule by rule id", - "operationId": "DeleteWorkflowRule2", + } + }, + "/api/v1/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}/notifications": { + "get": { + "summary": "PollChannel is a long poll for clients. It returns the retained\nnotifications of a channel with a counter above `after_counter`, waiting\nup to `wait` for one when none is retained yet.", + "operationId": "PollChannel4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DeleteWorkflowRuleResponse" + "$ref": "#/definitions/v1PollChannelResponse" } }, "default": { @@ -3894,11 +4817,59 @@ "type": "string" }, { - "name": "ruleId", - "description": "ID of the rule to delete. Unique within the namespace.", + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", "in": "path", "required": true, "type": "string" + }, + { + "name": "afterCounter", + "description": "Only notifications with a counter above this one are returned.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "wait", + "description": "How long to wait for a notification when none is retained above\n`after_counter`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maxNotifications", + "description": "At most this many notifications are returned. Zero means the server's\ndefault.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -3906,15 +4877,15 @@ ] } }, - "/api/v1/namespaces/{namespace}/workflows": { - "get": { - "summary": "ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.", - "operationId": "ListWorkflowExecutions2", + "/api/v1/namespaces/{namespace}/workflows/{execution.businessId}/channels/{notification.channel}/notify": { + "post": { + "summary": "NotifyChannel tells every listener of a channel that a source they consume\nhas moved. The writer names no addressee and never learns who listens. The\nserver wakes each listener: a Workflow with a Workflow Task, a callback by\ninvoking it. Nothing goes to History except the notifications a woken\nWorkflow Task carries on its scheduled event.", + "operationId": "NotifyChannel4", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListWorkflowExecutionsResponse" + "$ref": "#/definitions/v1NotifyChannelResponse" } }, "default": { @@ -3932,24 +4903,25 @@ "type": "string" }, { - "name": "pageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" }, { - "name": "nextPageToken", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "notification.channel", + "description": "The channel the writer notified. Listeners register on the same name.", + "in": "path", + "required": true, + "type": "string" }, { - "name": "query", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceNotifyChannelBody" + } } ], "tags": [ @@ -6121,7 +7093,240 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StartActivityExecutionResponse" + "$ref": "#/definitions/v1StartActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Identifier for this activity. Required. This identifier should be meaningful in the user's\nown system. It must be unique among activities in the same namespace, subject to the rules\nimposed by id_reuse_policy and id_conflict_policy.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/cancel": { + "post": { + "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", + "description": "Cancellation is cooperative: this call records the request, but the activity must detect and\nacknowledge it for the activity to reach CANCELED status. The cancellation signal is\ndelivered via `cancel_requested` in the heartbeat response; SDKs surface this via\nlanguage-idiomatic mechanisms (context cancellation, exceptions, abort signals).", + "operationId": "RequestCancelActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/complete": { + "post": { + "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCompletedById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to complete", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/fail": { + "post": { + "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskFailedById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity to fail", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/heartbeat": { + "post": { + "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RecordActivityTaskHeartbeatById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "activityId", + "description": "Id of the activity we're heartbeating", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/activities/{activityId}/outcome": { + "get": { + "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", + "operationId": "PollActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PollActivityExecutionResponse" } }, "default": { @@ -6140,18 +7345,16 @@ }, { "name": "activityId", - "description": "Identifier for this activity. Required. This identifier should be meaningful in the user's\nown system. It must be unique among activities in the same namespace, subject to the rules\nimposed by id_reuse_policy and id_conflict_policy.", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceStartActivityExecutionBody" - } + "name": "runId", + "description": "Activity run ID. If empty the request targets the latest run.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -6159,16 +7362,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/cancel": { + "/namespaces/{namespace}/activities/{activityId}/pause": { "post": { - "summary": "RequestCancelActivityExecution requests cancellation of an activity execution.", - "description": "Cancellation is cooperative: this call records the request, but the activity must detect and\nacknowledge it for the activity to reach CANCELED status. The cancellation signal is\ndelivered via `cancel_requested` in the heartbeat response; SDKs surface this via\nlanguage-idiomatic mechanisms (context cancellation, exceptions, abort signals).", - "operationId": "RequestCancelActivityExecution", + "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", + "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "PauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RequestCancelActivityExecutionResponse" + "$ref": "#/definitions/v1PauseActivityExecutionResponse" } }, "default": { @@ -6181,12 +7384,14 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -6196,7 +7401,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRequestCancelActivityExecutionBody" + "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" } } ], @@ -6205,15 +7410,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/complete": { + "/namespaces/{namespace}/activities/{activityId}/reset": { "post": { - "summary": "See `RespondActivityTaskCompleted`. This version allows clients to record completions by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCompletedById", + "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", + "operationId": "ResetActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCompletedByIdResponse" + "$ref": "#/definitions/v1ResetActivityExecutionResponse" } }, "default": { @@ -6226,14 +7432,14 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity to complete", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" @@ -6243,7 +7449,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCompletedByIdBody" + "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" } } ], @@ -6252,15 +7458,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/fail": { + "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { "post": { - "summary": "See `RecordActivityTaskFailed`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskFailedById", + "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", + "operationId": "RespondActivityTaskCanceledById", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskFailedByIdResponse" + "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" } }, "default": { @@ -6280,7 +7486,7 @@ }, { "name": "activityId", - "description": "Id of the activity to fail", + "description": "Id of the activity to confirm is cancelled", "in": "path", "required": true, "type": "string" @@ -6290,7 +7496,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskFailedByIdBody" + "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" } } ], @@ -6299,15 +7505,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/heartbeat": { + "/namespaces/{namespace}/activities/{activityId}/terminate": { "post": { - "summary": "See `RecordActivityTaskHeartbeat`. This version allows clients to record heartbeats by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RecordActivityTaskHeartbeatById", + "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", + "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", + "operationId": "TerminateActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RecordActivityTaskHeartbeatByIdResponse" + "$ref": "#/definitions/v1TerminateActivityExecutionResponse" } }, "default": { @@ -6320,14 +7527,12 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { "name": "activityId", - "description": "Id of the activity we're heartbeating", "in": "path", "required": true, "type": "string" @@ -6337,7 +7542,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRecordActivityTaskHeartbeatByIdBody" + "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" } } ], @@ -6346,15 +7551,16 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/outcome": { - "get": { - "summary": "PollActivityExecution long-polls for an activity execution to complete and returns the\noutcome (result or failure).", - "operationId": "PollActivityExecution", + "/namespaces/{namespace}/activities/{activityId}/unpause": { + "post": { + "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", + "operationId": "UnpauseActivityExecution", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PollActivityExecutionResponse" + "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" } }, "default": { @@ -6367,22 +7573,25 @@ "parameters": [ { "name": "namespace", + "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { "name": "activityId", + "description": "The ID of the activity to target.", "in": "path", "required": true, "type": "string" }, { - "name": "runId", - "description": "Activity run ID. If empty the request targets the latest run.", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" + } } ], "tags": [ @@ -6390,16 +7599,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/pause": { + "/namespaces/{namespace}/activities/{activityId}/update-options": { "post": { - "summary": "PauseActivityExecution pauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity", - "description": "Pausing an activity means:\n- If the activity is currently waiting for a retry or is running and subsequently fails,\n it will not be rescheduled until it is unpaused.\n- If the activity is already paused, calling this method will have no effect.\n- If the activity is running and finishes successfully, the activity will be completed.\n- If the activity is running and finishes with failure:\n * if there is no retry left - the activity will be completed.\n * if there are more retries left - the activity will be paused.\nFor long-running activities:\n- activities in paused state will send a cancellation with \"activity_paused\" set to 'true' in response to 'RecordActivityTaskHeartbeat'.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "PauseActivityExecution", + "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", + "operationId": "UpdateActivityExecutionOptions", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1PauseActivityExecutionResponse" + "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" } }, "default": { @@ -6412,7 +7620,7 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", + "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" @@ -6429,7 +7637,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServicePauseActivityExecutionBody" + "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" } } ], @@ -6438,16 +7646,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/reset": { - "post": { - "summary": "ResetActivityExecution resets the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "Resetting an activity means:\n* number of attempts will be reset to 0.\n* activity timeouts will be reset.\n* if the activity is waiting for retry, and it is not paused or 'keep_paused' is not provided:\n it will be scheduled immediately (* see 'jitter' flag)\n\nReturns a `NotFound` error if there is no pending activity with the provided ID or type.", - "operationId": "ResetActivityExecution", + "/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}": { + "get": { + "summary": "DescribeChannel returns the listeners of a channel and its latest\nnotification.", + "operationId": "DescribeChannel5", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ResetActivityExecutionResponse" + "$ref": "#/definitions/v1DescribeChannelResponse" } }, "default": { @@ -6460,25 +7667,41 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "The ID of the activity to target.", + "name": "execution.businessId", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "channel", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceResetActivityExecutionBody" - } + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -6486,15 +7709,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/resolve-as-canceled": { + "/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}/listeners": { "post": { - "summary": "See `RespondActivityTaskCanceled`. This version allows clients to record failures by\nnamespace/workflow id/activity id instead of task token.", - "operationId": "RespondActivityTaskCanceledById", + "summary": "RegisterChannelListener registers a callback as a listener of a channel. A\nWorkflow registers itself with the `SubscribeNotificationChannel` command\ninstead.", + "operationId": "RegisterChannelListener5", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1RespondActivityTaskCanceledByIdResponse" + "$ref": "#/definitions/v1RegisterChannelListenerResponse" } }, "default": { @@ -6507,14 +7730,18 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "Id of the activity to confirm is cancelled", + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", "in": "path", "required": true, "type": "string" @@ -6524,7 +7751,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceRespondActivityTaskCanceledByIdBody" + "$ref": "#/definitions/WorkflowServiceRegisterChannelListenerBody" } } ], @@ -6533,16 +7760,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/terminate": { - "post": { - "summary": "TerminateActivityExecution terminates an existing activity execution immediately.", - "description": "Termination does not reach the worker and the activity code cannot react to it. A terminated activity may have a\nrunning attempt.", - "operationId": "TerminateActivityExecution", + "/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}/listeners/{listenerId}": { + "delete": { + "summary": "UnregisterChannelListener removes a listener from a channel.", + "operationId": "UnregisterChannelListener5", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1TerminateActivityExecutionResponse" + "$ref": "#/definitions/v1UnregisterChannelListenerResponse" } }, "default": { @@ -6560,18 +7786,49 @@ "type": "string" }, { - "name": "activityId", + "name": "execution.businessId", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "channel", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceTerminateActivityExecutionBody" - } + "type": "string" + }, + { + "name": "listenerId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the caller, for metrics and logs.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -6579,16 +7836,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/unpause": { - "post": { - "summary": "UnpauseActivityExecution unpauses the execution of an activity specified by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "description": "If activity is not paused, this call will have no effect.\nIf the activity was paused while waiting for retry, it will be scheduled immediately (* see 'jitter' flag).\nOnce the activity is unpaused, all timeout timers will be regenerated.\n\nReturns a `NotFound` error if there is no pending activity with the provided ID", - "operationId": "UnpauseActivityExecution", + "/namespaces/{namespace}/activities/{execution.businessId}/channels/{channel}/notifications": { + "get": { + "summary": "PollChannel is a long poll for clients. It returns the retained\nnotifications of a channel with a counter above `after_counter`, waiting\nup to `wait` for one when none is retained yet.", + "operationId": "PollChannel5", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UnpauseActivityExecutionResponse" + "$ref": "#/definitions/v1PollChannelResponse" } }, "default": { @@ -6601,25 +7857,64 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity.", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "The ID of the activity to target.", + "name": "execution.businessId", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", + "name": "channel", + "in": "path", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceUnpauseActivityExecutionBody" - } + "type": "string" + }, + { + "name": "afterCounter", + "description": "Only notifications with a counter above this one are returned.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "wait", + "description": "How long to wait for a notification when none is retained above\n`after_counter`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maxNotifications", + "description": "At most this many notifications are returned. Zero means the server's\ndefault.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -6627,15 +7922,15 @@ ] } }, - "/namespaces/{namespace}/activities/{activityId}/update-options": { + "/namespaces/{namespace}/activities/{execution.businessId}/channels/{notification.channel}/notify": { "post": { - "summary": "UpdateActivityExecutionOptions is called by the client to update the options of an activity by its ID.\nThis API can be used to target a workflow activity or a standalone activity.", - "operationId": "UpdateActivityExecutionOptions", + "summary": "NotifyChannel tells every listener of a channel that a source they consume\nhas moved. The writer names no addressee and never learns who listens. The\nserver wakes each listener: a Workflow with a Workflow Task, a callback by\ninvoking it. Nothing goes to History except the notifications a woken\nWorkflow Task carries on its scheduled event.", + "operationId": "NotifyChannel5", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateActivityExecutionOptionsResponse" + "$ref": "#/definitions/v1NotifyChannelResponse" } }, "default": { @@ -6648,14 +7943,19 @@ "parameters": [ { "name": "namespace", - "description": "Namespace of the workflow which scheduled this activity", "in": "path", "required": true, "type": "string" }, { - "name": "activityId", - "description": "The ID of the activity to target.", + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "notification.channel", + "description": "The channel the writer notified. Listeners register on the same name.", "in": "path", "required": true, "type": "string" @@ -6665,7 +7965,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceUpdateActivityExecutionOptionsBody" + "$ref": "#/definitions/WorkflowServiceNotifyChannelBody" } } ], @@ -7035,19 +8335,336 @@ "type": "string" }, { - "name": "jobId", - "description": "Job ID defines the unique ID for the batch job", - "in": "path", - "required": true, + "name": "jobId", + "description": "Job ID defines the unique ID for the batch job", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceStartBatchOperationBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/batch-operations/{jobId}/stop": { + "post": { + "summary": "StopBatchOperation stops a batch operation", + "operationId": "StopBatchOperation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StopBatchOperationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace that contains the batch operation", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "jobId", + "description": "Batch job id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceStopBatchOperationBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/channels/{channel}": { + "get": { + "summary": "DescribeChannel returns the listeners of a channel and its latest\nnotification.", + "operationId": "DescribeChannel", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.businessId", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/channels/{channel}/listeners": { + "post": { + "summary": "RegisterChannelListener registers a callback as a listener of a channel. A\nWorkflow registers itself with the `SubscribeNotificationChannel` command\ninstead.", + "operationId": "RegisterChannelListener", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RegisterChannelListenerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceRegisterChannelListenerBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/channels/{channel}/listeners/{listenerId}": { + "delete": { + "summary": "UnregisterChannelListener removes a listener from a channel.", + "operationId": "UnregisterChannelListener", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UnregisterChannelListenerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "listenerId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the caller, for metrics and logs.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.businessId", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/channels/{channel}/notifications": { + "get": { + "summary": "PollChannel is a long poll for clients. It returns the retained\nnotifications of a channel with a counter above `after_counter`, waiting\nup to `wait` for one when none is retained yet.", + "operationId": "PollChannel", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1PollChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "afterCounter", + "description": "Only notifications with a counter above this one are returned.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "wait", + "description": "How long to wait for a notification when none is retained above\n`after_counter`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maxNotifications", + "description": "At most this many notifications are returned. Zero means the server's\ndefault.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.businessId", + "in": "query", + "required": false, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceStartBatchOperationBody" - } + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -7055,15 +8672,15 @@ ] } }, - "/namespaces/{namespace}/batch-operations/{jobId}/stop": { + "/namespaces/{namespace}/channels/{notification.channel}/notify": { "post": { - "summary": "StopBatchOperation stops a batch operation", - "operationId": "StopBatchOperation", + "summary": "NotifyChannel tells every listener of a channel that a source they consume\nhas moved. The writer names no addressee and never learns who listens. The\nserver wakes each listener: a Workflow with a Workflow Task, a callback by\ninvoking it. Nothing goes to History except the notifications a woken\nWorkflow Task carries on its scheduled event.", + "operationId": "NotifyChannel", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1StopBatchOperationResponse" + "$ref": "#/definitions/v1NotifyChannelResponse" } }, "default": { @@ -7076,14 +8693,13 @@ "parameters": [ { "name": "namespace", - "description": "Namespace that contains the batch operation", "in": "path", "required": true, "type": "string" }, { - "name": "jobId", - "description": "Batch job id", + "name": "notification.channel", + "description": "The channel the writer notified. Listeners register on the same name.", "in": "path", "required": true, "type": "string" @@ -7093,7 +8709,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceStopBatchOperationBody" + "$ref": "#/definitions/WorkflowServiceNotifyChannelBody" } } ], @@ -9396,7 +11012,246 @@ }, "parameters": [ { - "name": "namespace", + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkflowRuleBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflow-rules/{ruleId}": { + "get": { + "summary": "DescribeWorkflowRule return the rule specification for existing rule id.\nIf there is no rule with such id - NOT FOUND error will be returned.", + "operationId": "DescribeWorkflowRule", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkflowRuleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "ruleId", + "description": "User-specified ID of the rule to read. Unique within the namespace.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + }, + "delete": { + "summary": "Delete rule by rule id", + "operationId": "DeleteWorkflowRule", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DeleteWorkflowRuleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "ruleId", + "description": "ID of the rule to delete. Unique within the namespace.", + "in": "path", + "required": true, + "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/{execution.businessId}/channels/{channel}": { + "get": { + "summary": "DescribeChannel returns the listeners of a channel and its latest\nnotification.", + "operationId": "DescribeChannel3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeChannelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}/listeners": { + "post": { + "summary": "RegisterChannelListener registers a callback as a listener of a channel. A\nWorkflow registers itself with the `SubscribeNotificationChannel` command\ninstead.", + "operationId": "RegisterChannelListener3", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1RegisterChannelListenerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", "in": "path", "required": true, "type": "string" @@ -9406,7 +11261,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WorkflowServiceCreateWorkflowRuleBody" + "$ref": "#/definitions/WorkflowServiceRegisterChannelListenerBody" } } ], @@ -9415,15 +11270,15 @@ ] } }, - "/namespaces/{namespace}/workflow-rules/{ruleId}": { - "get": { - "summary": "DescribeWorkflowRule return the rule specification for existing rule id.\nIf there is no rule with such id - NOT FOUND error will be returned.", - "operationId": "DescribeWorkflowRule", + "/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}/listeners/{listenerId}": { + "delete": { + "summary": "UnregisterChannelListener removes a listener from a channel.", + "operationId": "UnregisterChannelListener3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DescribeWorkflowRuleResponse" + "$ref": "#/definitions/v1UnregisterChannelListenerResponse" } }, "default": { @@ -9441,25 +11296,65 @@ "type": "string" }, { - "name": "ruleId", - "description": "User-specified ID of the rule to read. Unique within the namespace.", + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "listenerId", "in": "path", "required": true, "type": "string" + }, + { + "name": "identity", + "description": "The identity of the caller, for metrics and logs.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ "WorkflowService" ] - }, - "delete": { - "summary": "Delete rule by rule id", - "operationId": "DeleteWorkflowRule", + } + }, + "/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}/notifications": { + "get": { + "summary": "PollChannel is a long poll for clients. It returns the retained\nnotifications of a channel with a counter above `after_counter`, waiting\nup to `wait` for one when none is retained yet.", + "operationId": "PollChannel3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DeleteWorkflowRuleResponse" + "$ref": "#/definitions/v1PollChannelResponse" } }, "default": { @@ -9477,11 +11372,59 @@ "type": "string" }, { - "name": "ruleId", - "description": "ID of the rule to delete. Unique within the namespace.", + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel", "in": "path", "required": true, "type": "string" + }, + { + "name": "afterCounter", + "description": "Only notifications with a counter above this one are returned.", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "wait", + "description": "How long to wait for a notification when none is retained above\n`after_counter`.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "maxNotifications", + "description": "At most this many notifications are returned. Zero means the server's\ndefault.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "execution.type", + "description": " - EXECUTION_TYPE_WORKFLOW: A workflow execution archetype.\n - EXECUTION_TYPE_ACTIVITY: An activity execution archetype. This is reserved for standalone activities.\n - EXECUTION_TYPE_NEXUS_OPERATION: A Nexus operation execution archetype. This is reserved for standalone Nexus operations.", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "EXECUTION_TYPE_UNSPECIFIED", + "EXECUTION_TYPE_WORKFLOW", + "EXECUTION_TYPE_ACTIVITY", + "EXECUTION_TYPE_NEXUS_OPERATION" + ], + "default": "EXECUTION_TYPE_UNSPECIFIED" + }, + { + "name": "execution.runId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -9489,15 +11432,15 @@ ] } }, - "/namespaces/{namespace}/workflows": { - "get": { - "summary": "ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace.", - "operationId": "ListWorkflowExecutions", + "/namespaces/{namespace}/workflows/{execution.businessId}/channels/{notification.channel}/notify": { + "post": { + "summary": "NotifyChannel tells every listener of a channel that a source they consume\nhas moved. The writer names no addressee and never learns who listens. The\nserver wakes each listener: a Workflow with a Workflow Task, a callback by\ninvoking it. Nothing goes to History except the notifications a woken\nWorkflow Task carries on its scheduled event.", + "operationId": "NotifyChannel3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListWorkflowExecutionsResponse" + "$ref": "#/definitions/v1NotifyChannelResponse" } }, "default": { @@ -9515,24 +11458,25 @@ "type": "string" }, { - "name": "pageSize", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" + "name": "execution.businessId", + "in": "path", + "required": true, + "type": "string" }, { - "name": "nextPageToken", - "in": "query", - "required": false, - "type": "string", - "format": "byte" + "name": "notification.channel", + "description": "The channel the writer notified. Listeners register on the same name.", + "in": "path", + "required": true, + "type": "string" }, { - "name": "query", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceNotifyChannelBody" + } } ], "tags": [ @@ -11709,6 +13653,58 @@ } } }, + "WorkflowServiceNotifyChannelBody": { + "type": "object", + "properties": { + "notification": { + "type": "object", + "properties": { + "position": { + "type": "string", + "format": "byte", + "description": "Where the source stands after the write that caused this notification,\nin the writer's terms. Opaque to the server." + }, + "counter": { + "type": "string", + "format": "int64", + "description": "Orders notifications from one channel's writers. The writer derives it\nfrom the position, since only the source can order its positions. Among\nnotifications folded together, the one with the highest counter is kept." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1Payload" + }, + "description": "Details for the listener, such as which topic moved. Bounded in size and\ncarried as payloads, so a codec applies as to any payload. This is state,\nnot a log: a fold keeps the latest notification only, so a writer puts\nhere what is true at `position`, such as which topic moved or a close\nflag, never something a consumer must see once per write." + }, + "linkedTo": { + "$ref": "#/definitions/v1Execution", + "description": "Set for a channel linked to an execution: the owner and the run that\nreceived the notification. Empty for an independent channel. A listener\nthat holds both kinds routes the notification by it." + } + }, + "description": "A notification tells the listeners of a channel that a source they consume\nhas moved. It is not data: the listener reads the source itself. A channel\nis named by the writer and its listeners; for a stream, the provider formats\nthe stream's identity into the name. Writers never learn who listens. The\nserver folds notifications per listener while one is pending and no task has\nbeen scheduled for it, keeping the one with the highest counter." + }, + "identity": { + "type": "string", + "description": "The identity of the caller, for audit, metrics and logs. It is not copied\ninto the notification. A writer that wants the consumer to see who wrote\nputs that in the notification's `metadata`." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe a retried notification." + }, + "execution": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/v1ExecutionType" + }, + "runId": { + "type": "string" + } + }, + "description": "When set, the call addresses the channel linked to this execution.\n`run_id` is optional and resolves to the current run of a workflow chain,\nas a Signal does. When unset, the call addresses the independent channel\nof that name." + } + } + }, "WorkflowServicePatchScheduleBody": { "type": "object", "properties": { @@ -11897,6 +13893,35 @@ } } }, + "WorkflowServiceRegisterChannelListenerBody": { + "type": "object", + "properties": { + "callback": { + "$ref": "#/definitions/commonV1Callback", + "description": "Invoked with each notification on the channel." + }, + "requestId": { + "type": "string", + "description": "Used to de-dupe a retried registration." + }, + "identity": { + "type": "string", + "description": "The identity of the caller, for metrics and logs." + }, + "execution": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/v1ExecutionType" + }, + "runId": { + "type": "string" + } + }, + "description": "When set, the call addresses the channel linked to this execution.\n`run_id` is optional and resolves to the current run of a workflow chain,\nas a Signal does. When unset, the call addresses the independent channel\nof that name." + } + } + }, "WorkflowServiceRequestCancelActivityExecutionBody": { "type": "object", "properties": { @@ -14841,6 +16866,36 @@ } } }, + "v1ChannelKind": { + "type": "string", + "enum": [ + "CHANNEL_KIND_UNSPECIFIED", + "CHANNEL_KIND_INDEPENDENT", + "CHANNEL_KIND_LINKED" + ], + "default": "CHANNEL_KIND_UNSPECIFIED", + "description": "Where a channel lives, which decides how a call addresses it.\n\n - CHANNEL_KIND_INDEPENDENT: Its own execution, keyed by namespace and channel name. Any number of\nworkflows and callbacks listen to it.\n - CHANNEL_KIND_LINKED: Kept in one execution's state, keyed by namespace, execution and\nchannel name. The owning execution is its listener by construction." + }, + "v1ChannelListener": { + "type": "object", + "properties": { + "listenerId": { + "type": "string", + "description": "Assigned by the server when the listener registers." + }, + "workflow": { + "$ref": "#/definitions/v1WorkflowListener" + }, + "callback": { + "$ref": "#/definitions/commonV1Callback" + }, + "registeredTime": { + "type": "string", + "format": "date-time" + } + }, + "description": "A listener of a channel: a Workflow Execution woken with a Workflow Task, or\na callback the server invokes with each notification." + }, "v1ChildWorkflowExecutionCanceledEventAttributes": { "type": "object", "properties": { @@ -15670,6 +17725,34 @@ } } }, + "v1DescribeChannelResponse": { + "type": "object", + "properties": { + "listeners": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ChannelListener" + } + }, + "latest": { + "$ref": "#/definitions/v1Notification", + "description": "The notification with the highest counter the channel retains." + }, + "retainedCount": { + "type": "integer", + "format": "int32", + "description": "How many notifications the channel retains for pollers." + }, + "kind": { + "$ref": "#/definitions/v1ChannelKind" + }, + "linkedTo": { + "$ref": "#/definitions/v1Execution", + "description": "The owner of a linked channel and the run that holds it. Empty for an\nindependent channel." + } + } + }, "v1DescribeDeploymentResponse": { "type": "object", "properties": { @@ -18085,6 +20168,47 @@ "default": "NEXUS_OPERATION_WAIT_STAGE_UNSPECIFIED", "description": "Stage that can be specified when waiting on a nexus operation.\n\n - NEXUS_OPERATION_WAIT_STAGE_STARTED: Wait for the operation to be started.\n - NEXUS_OPERATION_WAIT_STAGE_CLOSED: Wait for the operation to be in a terminal state, either successful or unsuccessful." }, + "v1Notification": { + "type": "object", + "properties": { + "channel": { + "type": "string", + "description": "The channel the writer notified. Listeners register on the same name." + }, + "position": { + "type": "string", + "format": "byte", + "description": "Where the source stands after the write that caused this notification,\nin the writer's terms. Opaque to the server." + }, + "counter": { + "type": "string", + "format": "int64", + "description": "Orders notifications from one channel's writers. The writer derives it\nfrom the position, since only the source can order its positions. Among\nnotifications folded together, the one with the highest counter is kept." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1Payload" + }, + "description": "Details for the listener, such as which topic moved. Bounded in size and\ncarried as payloads, so a codec applies as to any payload. This is state,\nnot a log: a fold keeps the latest notification only, so a writer puts\nhere what is true at `position`, such as which topic moved or a close\nflag, never something a consumer must see once per write." + }, + "linkedTo": { + "$ref": "#/definitions/v1Execution", + "description": "Set for a channel linked to an execution: the owner and the run that\nreceived the notification. Empty for an independent channel. A listener\nthat holds both kinds routes the notification by it." + } + }, + "description": "A notification tells the listeners of a channel that a source they consume\nhas moved. It is not data: the listener reads the source itself. A channel\nis named by the writer and its listeners; for a stream, the provider formats\nthe stream's identity into the name. Writers never learn who listens. The\nserver folds notifications per listener while one is pending and no task has\nbeen scheduled for it, keeping the one with the highest counter." + }, + "v1NotifyChannelResponse": { + "type": "object", + "properties": { + "listenerCount": { + "type": "integer", + "format": "int32", + "description": "Listeners registered when the notification was accepted. Zero means the\nnotification was retained for pollers and woke nobody." + } + } + }, "v1Outcome": { "type": "object", "properties": { @@ -18423,6 +20547,18 @@ } } }, + "v1PollChannelResponse": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Notification" + } + } + } + }, "v1PollNexusOperationExecutionResponse": { "type": "object", "properties": { @@ -18809,6 +20945,14 @@ "v1RecordWorkerHeartbeatResponse": { "type": "object" }, + "v1RegisterChannelListenerResponse": { + "type": "object", + "properties": { + "listenerId": { + "type": "string" + } + } + }, "v1RegisterNamespaceRequest": { "type": "object", "properties": { @@ -20608,6 +22752,9 @@ "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, + "v1UnregisterChannelListenerResponse": { + "type": "object" + }, "v1UpdateActivityExecutionOptionsResponse": { "type": "object", "properties": { @@ -22307,6 +24454,19 @@ "default": "WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED", "description": "Defines whether to allow re-using a workflow id from a previously *closed* workflow.\nIf the request is denied, the server returns a `WorkflowExecutionAlreadyStartedFailure` error.\n\nSee `WorkflowIdConflictPolicy` for handling workflow id duplication with a *running* workflow.\n\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE: Allow starting a workflow execution using the same workflow id.\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: Allow starting a workflow execution using the same workflow id, only when the last\nexecution's final state is one of [terminated, cancelled, timed out, failed].\n - WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE: Do not permit re-use of the workflow id for this workflow. Future start workflow requests\ncould potentially change the policy, allowing re-use of the workflow id.\n - WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING: Terminate the current Workflow if one is already running; otherwise allow reusing the\nWorkflow ID. When using this option, `WorkflowIdConflictPolicy` must be left unspecified.\n\nDeprecated. Instead, set `WorkflowIdReusePolicy` to `ALLOW_DUPLICATE` and\n`WorkflowIdConflictPolicy` to `TERMINATE_EXISTING`. Note that `WorkflowIdConflictPolicy`\nrequires Temporal Server v1.24.0 or later." }, + "v1WorkflowListener": { + "type": "object", + "properties": { + "workflowId": { + "type": "string" + }, + "runId": { + "type": "string", + "description": "The run that subscribed. The server follows a continue-as-new to the\nchain's current run when it delivers." + } + }, + "description": "A Workflow Execution listening on a channel." + }, "v1WorkflowPropertiesModifiedEventAttributes": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 2aa7c45bf..8489f883b 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -950,6 +950,299 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}: + get: + tags: + - WorkflowService + description: |- + DescribeChannel returns the listeners of a channel and its latest + notification. + operationId: DescribeChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners: + post: + tags: + - WorkflowService + description: |- + RegisterChannelListener registers a callback as a listener of a channel. A + Workflow registers itself with the `SubscribeNotificationChannel` command + instead. + operationId: RegisterChannelListener + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners/{listenerId}: + delete: + tags: + - WorkflowService + description: |- + UnregisterChannelListener removes a listener from a channel. + + (-- api-linter: core::0136::http-method=disabled + aip.dev/not-precedent: Removing a listener is a delete of that listener. --) + operationId: UnregisterChannelListener + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: listenerId + in: path + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the caller, for metrics and logs. + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnregisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/notifications: + get: + tags: + - WorkflowService + description: |- + PollChannel is a long poll for clients. It returns the retained + notifications of a channel with a counter above `after_counter`, waiting + up to `wait` for one when none is retained yet. + operationId: PollChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: afterCounter + in: query + description: |- + Only notifications with a counter above this one are returned. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "after" names the exclusive lower bound. --) + schema: + type: string + - name: wait + in: query + description: |- + How long to wait for a notification when none is retained above + `after_counter`. + schema: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Represents a a duration between -315,576,000,000s and 315,576,000,000s (around 10000 years). Precision is in nanoseconds. 1 nanosecond is represented as 0.000000001s + - name: maxNotifications + in: query + description: |- + At most this many notifications are returned. Zero means the server's + default. + schema: + type: integer + format: int32 + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PollChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{notification.channel}/notify: + post: + tags: + - WorkflowService + description: |- + NotifyChannel tells every listener of a channel that a source they consume + has moved. The writer names no addressee and never learns who listens. The + server wakes each listener: a Workflow with a Workflow Task, a callback by + invoking it. Nothing goes to History except the notifications a woken + Workflow Task carries on its scheduled event. + operationId: NotifyChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: notification.channel + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/activity-complete: post: tags: @@ -1317,67 +1610,335 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/current-deployment/{deployment.series_name}: - post: + /api/v1/namespaces/{namespace}/channels/{channel}: + get: tags: - WorkflowService description: |- - Sets a deployment as the current deployment for its deployment series. Can optionally update - the metadata of the deployment as well. - Deprecated. Replaced by `SetWorkerDeploymentCurrentVersion`. - operationId: SetCurrentDeployment + DescribeChannel returns the listeners of a channel and its latest + notification. + operationId: DescribeChannel parameters: - name: namespace in: path required: true schema: type: string - - name: deployment.series_name + - name: channel in: path required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetCurrentDeploymentRequest' - required: true + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/SetCurrentDeploymentResponse' + $ref: '#/components/schemas/DescribeChannelResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/current-deployment/{seriesName}: - get: + /api/v1/namespaces/{namespace}/channels/{channel}/listeners: + post: tags: - WorkflowService description: |- - Returns the current deployment (and its info) for a given deployment series. - Deprecated. Replaced by `current_version` returned by `DescribeWorkerDeployment`. - operationId: GetCurrentDeployment + RegisterChannelListener registers a callback as a listener of a channel. A + Workflow registers itself with the `SubscribeNotificationChannel` command + instead. + operationId: RegisterChannelListener parameters: - name: namespace in: path required: true schema: type: string - - name: seriesName + - name: channel in: path required: true schema: type: string - responses: - "200": - description: OK + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/channels/{channel}/listeners/{listenerId}: + delete: + tags: + - WorkflowService + description: |- + UnregisterChannelListener removes a listener from a channel. + + (-- api-linter: core::0136::http-method=disabled + aip.dev/not-precedent: Removing a listener is a delete of that listener. --) + operationId: UnregisterChannelListener + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: listenerId + in: path + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the caller, for metrics and logs. + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnregisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/channels/{channel}/notifications: + get: + tags: + - WorkflowService + description: |- + PollChannel is a long poll for clients. It returns the retained + notifications of a channel with a counter above `after_counter`, waiting + up to `wait` for one when none is retained yet. + operationId: PollChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: afterCounter + in: query + description: |- + Only notifications with a counter above this one are returned. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "after" names the exclusive lower bound. --) + schema: + type: string + - name: wait + in: query + description: |- + How long to wait for a notification when none is retained above + `after_counter`. + schema: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Represents a a duration between -315,576,000,000s and 315,576,000,000s (around 10000 years). Precision is in nanoseconds. 1 nanosecond is represented as 0.000000001s + - name: maxNotifications + in: query + description: |- + At most this many notifications are returned. Zero means the server's + default. + schema: + type: integer + format: int32 + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PollChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/channels/{notification.channel}/notify: + post: + tags: + - WorkflowService + description: |- + NotifyChannel tells every listener of a channel that a source they consume + has moved. The writer names no addressee and never learns who listens. The + server wakes each listener: a Workflow with a Workflow Task, a callback by + invoking it. Nothing goes to History except the notifications a woken + Workflow Task carries on its scheduled event. + operationId: NotifyChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: notification.channel + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/current-deployment/{deployment.series_name}: + post: + tags: + - WorkflowService + description: |- + Sets a deployment as the current deployment for its deployment series. Can optionally update + the metadata of the deployment as well. + Deprecated. Replaced by `SetWorkerDeploymentCurrentVersion`. + operationId: SetCurrentDeployment + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment.series_name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SetCurrentDeploymentResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/current-deployment/{seriesName}: + get: + tags: + - WorkflowService + description: |- + Returns the current deployment (and its info) for a given deployment series. + Deprecated. Replaced by `current_version` returned by `DescribeWorkerDeployment`. + operationId: GetCurrentDeployment + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: seriesName + in: path + required: true + schema: + type: string + responses: + "200": + description: OK content: application/json: schema: @@ -3542,24 +4103,41 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}: + /api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}: get: tags: - WorkflowService - description: DescribeWorkflowExecution returns information about the specified workflow execution. - operationId: DescribeWorkflowExecution + description: |- + DescribeChannel returns the listeners of a channel and its latest + notification. + operationId: DescribeChannel parameters: - name: namespace in: path required: true schema: type: string - - name: execution.workflow_id + - name: execution.business_id in: path required: true schema: type: string - - name: execution.workflowId + - name: channel + in: path + required: true + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId in: query schema: type: string @@ -3573,57 +4151,333 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DescribeWorkflowExecutionResponse' + $ref: '#/components/schemas/DescribeChannelResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history: - get: + /api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners: + post: tags: - WorkflowService description: |- - GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with - `NotFound` if the specified workflow execution is unknown to the service. - operationId: GetWorkflowExecutionHistory + RegisterChannelListener registers a callback as a listener of a channel. A + Workflow registers itself with the `SubscribeNotificationChannel` command + instead. + operationId: RegisterChannelListener parameters: - name: namespace in: path required: true schema: type: string - - name: execution.workflow_id + - name: execution.business_id in: path required: true schema: type: string - - name: execution.workflowId - in: query - schema: - type: string - - name: execution.runId - in: query - schema: - type: string - - name: maximumPageSize - in: query - schema: - type: integer - format: int32 - - name: nextPageToken - in: query - description: |- - If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of - these, it should be passed here to fetch the next page. + - name: channel + in: path + required: true schema: type: string - format: bytes - - name: waitNewEvent - in: query - description: |- - If set to true, the RPC call will not resolve until there is a new event which matches + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners/{listenerId}: + delete: + tags: + - WorkflowService + description: |- + UnregisterChannelListener removes a listener from a channel. + + (-- api-linter: core::0136::http-method=disabled + aip.dev/not-precedent: Removing a listener is a delete of that listener. --) + operationId: UnregisterChannelListener + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: listenerId + in: path + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the caller, for metrics and logs. + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnregisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/notifications: + get: + tags: + - WorkflowService + description: |- + PollChannel is a long poll for clients. It returns the retained + notifications of a channel with a counter above `after_counter`, waiting + up to `wait` for one when none is retained yet. + operationId: PollChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: afterCounter + in: query + description: |- + Only notifications with a counter above this one are returned. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "after" names the exclusive lower bound. --) + schema: + type: string + - name: wait + in: query + description: |- + How long to wait for a notification when none is retained above + `after_counter`. + schema: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Represents a a duration between -315,576,000,000s and 315,576,000,000s (around 10000 years). Precision is in nanoseconds. 1 nanosecond is represented as 0.000000001s + - name: maxNotifications + in: query + description: |- + At most this many notifications are returned. Zero means the server's + default. + schema: + type: integer + format: int32 + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PollChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{notification.channel}/notify: + post: + tags: + - WorkflowService + description: |- + NotifyChannel tells every listener of a channel that a source they consume + has moved. The writer names no addressee and never learns who listens. The + server wakes each listener: a Workflow with a Workflow Task, a callback by + invoking it. Nothing goes to History except the notifications a woken + Workflow Task carries on its scheduled event. + operationId: NotifyChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: notification.channel + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}: + get: + tags: + - WorkflowService + description: DescribeWorkflowExecution returns information about the specified workflow execution. + operationId: DescribeWorkflowExecution + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + - name: execution.workflowId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkflowExecutionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workflows/{execution.workflow_id}/history: + get: + tags: + - WorkflowService + description: |- + GetWorkflowExecutionHistory returns the history of specified workflow execution. Fails with + `NotFound` if the specified workflow execution is unknown to the service. + operationId: GetWorkflowExecutionHistory + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.workflow_id + in: path + required: true + schema: + type: string + - name: execution.workflowId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + - name: maximumPageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + description: |- + If a `GetWorkflowExecutionHistoryResponse` or a `PollWorkflowTaskQueueResponse` had one of + these, it should be passed here to fetch the next page. + schema: + type: string + format: bytes + - name: waitNewEvent + in: query + description: |- + If set to true, the RPC call will not resolve until there is a new event which matches the `history_event_filter_type`, or a timeout is hit. schema: type: boolean @@ -6031,29 +6885,322 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/activity-complete: - post: + /namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}: + get: tags: - WorkflowService description: |- - RespondActivityTaskCompleted is called by workers when they successfully complete an activity - task. - - For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history - and a new workflow task created for the workflow. Fails with `NotFound` if the task token is - no longer valid due to activity timeout, already being completed, or never having existed. - operationId: RespondActivityTaskCompleted + DescribeChannel returns the listeners of a channel and its latest + notification. + operationId: DescribeChannel parameters: - name: namespace in: path required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RespondActivityTaskCompletedRequest' + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners: + post: + tags: + - WorkflowService + description: |- + RegisterChannelListener registers a callback as a listener of a channel. A + Workflow registers itself with the `SubscribeNotificationChannel` command + instead. + operationId: RegisterChannelListener + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners/{listenerId}: + delete: + tags: + - WorkflowService + description: |- + UnregisterChannelListener removes a listener from a channel. + + (-- api-linter: core::0136::http-method=disabled + aip.dev/not-precedent: Removing a listener is a delete of that listener. --) + operationId: UnregisterChannelListener + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: listenerId + in: path + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the caller, for metrics and logs. + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UnregisterChannelListenerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/notifications: + get: + tags: + - WorkflowService + description: |- + PollChannel is a long poll for clients. It returns the retained + notifications of a channel with a counter above `after_counter`, waiting + up to `wait` for one when none is retained yet. + operationId: PollChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: afterCounter + in: query + description: |- + Only notifications with a counter above this one are returned. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "after" names the exclusive lower bound. --) + schema: + type: string + - name: wait + in: query + description: |- + How long to wait for a notification when none is retained above + `after_counter`. + schema: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Represents a a duration between -315,576,000,000s and 315,576,000,000s (around 10000 years). Precision is in nanoseconds. 1 nanosecond is represented as 0.000000001s + - name: maxNotifications + in: query + description: |- + At most this many notifications are returned. Zero means the server's + default. + schema: + type: integer + format: int32 + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PollChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activities/{execution.business_id}/channels/{notification.channel}/notify: + post: + tags: + - WorkflowService + description: |- + NotifyChannel tells every listener of a channel that a source they consume + has moved. The writer names no addressee and never learns who listens. The + server wakes each listener: a Workflow with a Workflow Task, a callback by + invoking it. Nothing goes to History except the notifications a woken + Workflow Task carries on its scheduled event. + operationId: NotifyChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: notification.channel + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/activity-complete: + post: + tags: + - WorkflowService + description: |- + RespondActivityTaskCompleted is called by workers when they successfully complete an activity + task. + + For workflow activities, this results in a new `ACTIVITY_TASK_COMPLETED` event being written to the workflow history + and a new workflow task created for the workflow. Fails with `NotFound` if the task token is + no longer valid due to activity timeout, already being completed, or never having existed. + operationId: RespondActivityTaskCompleted + parameters: + - name: namespace + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RespondActivityTaskCompletedRequest' required: true responses: "200": @@ -6270,112 +7417,380 @@ paths: in: query description: List page size schema: - type: integer - format: int32 - - name: nextPageToken - in: query - description: Next page token + type: integer + format: int32 + - name: nextPageToken + in: query + description: Next page token + schema: + type: string + format: bytes + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListBatchOperationsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/batch-operations/{jobId}: + get: + tags: + - WorkflowService + description: DescribeBatchOperation returns the information about a batch operation + operationId: DescribeBatchOperation + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: jobId + in: path + description: Batch job id + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeBatchOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: StartBatchOperation starts a new batch operation + operationId: StartBatchOperation + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: jobId + in: path + description: Job ID defines the unique ID for the batch job + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartBatchOperationRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StartBatchOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/batch-operations/{jobId}/stop: + post: + tags: + - WorkflowService + description: StopBatchOperation stops a batch operation + operationId: StopBatchOperation + parameters: + - name: namespace + in: path + description: Namespace that contains the batch operation + required: true + schema: + type: string + - name: jobId + in: path + description: Batch job id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StopBatchOperationRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StopBatchOperationResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/channels/{channel}: + get: + tags: + - WorkflowService + description: |- + DescribeChannel returns the listeners of a channel and its latest + notification. + operationId: DescribeChannel + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeChannelResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/channels/{channel}/listeners: + post: + tags: + - WorkflowService + description: |- + RegisterChannelListener registers a callback as a listener of a channel. A + Workflow registers itself with the `SubscribeNotificationChannel` command + instead. + operationId: RegisterChannelListener + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true schema: type: string - format: bytes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterChannelListenerRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/ListBatchOperationsResponse' + $ref: '#/components/schemas/RegisterChannelListenerResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/batch-operations/{jobId}: - get: + /namespaces/{namespace}/channels/{channel}/listeners/{listenerId}: + delete: tags: - WorkflowService - description: DescribeBatchOperation returns the information about a batch operation - operationId: DescribeBatchOperation + description: |- + UnregisterChannelListener removes a listener from a channel. + + (-- api-linter: core::0136::http-method=disabled + aip.dev/not-precedent: Removing a listener is a delete of that listener. --) + operationId: UnregisterChannelListener parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: jobId + - name: channel + in: path + required: true + schema: + type: string + - name: listenerId in: path - description: Batch job id required: true schema: type: string + - name: identity + in: query + description: The identity of the caller, for metrics and logs. + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeBatchOperationResponse' + $ref: '#/components/schemas/UnregisterChannelListenerResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - post: + /namespaces/{namespace}/channels/{channel}/notifications: + get: tags: - WorkflowService - description: StartBatchOperation starts a new batch operation - operationId: StartBatchOperation + description: |- + PollChannel is a long poll for clients. It returns the retained + notifications of a channel with a counter above `after_counter`, waiting + up to `wait` for one when none is retained yet. + operationId: PollChannel parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: jobId + - name: channel in: path - description: Job ID defines the unique ID for the batch job required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/StartBatchOperationRequest' - required: true + - name: afterCounter + in: query + description: |- + Only notifications with a counter above this one are returned. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "after" names the exclusive lower bound. --) + schema: + type: string + - name: wait + in: query + description: |- + How long to wait for a notification when none is retained above + `after_counter`. + schema: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Represents a a duration between -315,576,000,000s and 315,576,000,000s (around 10000 years). Precision is in nanoseconds. 1 nanosecond is represented as 0.000000001s + - name: maxNotifications + in: query + description: |- + At most this many notifications are returned. Zero means the server's + default. + schema: + type: integer + format: int32 + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/StartBatchOperationResponse' + $ref: '#/components/schemas/PollChannelResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/batch-operations/{jobId}/stop: + /namespaces/{namespace}/channels/{notification.channel}/notify: post: tags: - WorkflowService - description: StopBatchOperation stops a batch operation - operationId: StopBatchOperation + description: |- + NotifyChannel tells every listener of a channel that a source they consume + has moved. The writer names no addressee and never learns who listens. The + server wakes each listener: a Workflow with a Workflow Task, a callback by + invoking it. Nothing goes to History except the notifications a woken + Workflow Task carries on its scheduled event. + operationId: NotifyChannel parameters: - name: namespace in: path - description: Namespace that contains the batch operation required: true schema: type: string - - name: jobId + - name: notification.channel in: path - description: Batch job id required: true schema: type: string @@ -6383,7 +7798,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StopBatchOperationRequest' + $ref: '#/components/schemas/NotifyChannelRequest' required: true responses: "200": @@ -6391,7 +7806,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StopBatchOperationResponse' + $ref: '#/components/schemas/NotifyChannelResponse' default: description: Default error response content: @@ -8346,41 +9761,208 @@ paths: parameters: - name: namespace in: path - description: Namespace this worker belongs to. + description: Namespace this worker belongs to. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflow-count: + get: + tags: + - WorkflowService + description: CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace. + operationId: CountWorkflowExecutions + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: query + in: query + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CountWorkflowExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflow-rules: + get: + tags: + - WorkflowService + description: Return all namespace workflow rules + operationId: ListWorkflowRules + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: nextPageToken + in: query + schema: + type: string + format: bytes + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListWorkflowRulesResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: |- + Create a new workflow rule. The rules are used to control the workflow execution. + The rule will be applied to all running and new workflows in the namespace. + If the rule with such ID already exist this call will fail + Note: the rules are part of namespace configuration and will be stored in the namespace config. + Namespace config is eventually consistent. + operationId: CreateWorkflowRule + parameters: + - name: namespace + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkflowRuleRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkflowRuleResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflow-rules/{ruleId}: + get: + tags: + - WorkflowService + description: |- + DescribeWorkflowRule return the rule specification for existing rule id. + If there is no rule with such id - NOT FOUND error will be returned. + operationId: DescribeWorkflowRule + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: ruleId + in: path + description: User-specified ID of the rule to read. Unique within the namespace. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkflowRuleResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + delete: + tags: + - WorkflowService + description: Delete rule by rule id + operationId: DeleteWorkflowRule + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: ruleId + in: path + description: ID of the rule to delete. Unique within the namespace. required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateWorkerConfigRequest' - required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/UpdateWorkerConfigResponse' + $ref: '#/components/schemas/DeleteWorkflowRuleResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflow-count: + /namespaces/{namespace}/workflows: get: tags: - WorkflowService - description: CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace. - operationId: CountWorkflowExecutions + description: ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace. + operationId: ListWorkflowExecutions parameters: - name: namespace in: path required: true schema: type: string + - name: pageSize + in: query + schema: + type: integer + format: int32 + - name: nextPageToken + in: query + schema: + type: string + format: bytes - name: query in: query schema: @@ -8391,64 +9973,98 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CountWorkflowExecutionsResponse' + $ref: '#/components/schemas/ListWorkflowExecutionsResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflow-rules: + /namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}: get: tags: - WorkflowService - description: Return all namespace workflow rules - operationId: ListWorkflowRules + description: |- + DescribeChannel returns the listeners of a channel and its latest + notification. + operationId: DescribeChannel parameters: - name: namespace in: path required: true schema: type: string - - name: nextPageToken + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId in: query schema: type: string - format: bytes responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/ListWorkflowRulesResponse' + $ref: '#/components/schemas/DescribeChannelResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners: post: tags: - WorkflowService description: |- - Create a new workflow rule. The rules are used to control the workflow execution. - The rule will be applied to all running and new workflows in the namespace. - If the rule with such ID already exist this call will fail - Note: the rules are part of namespace configuration and will be stored in the namespace config. - Namespace config is eventually consistent. - operationId: CreateWorkflowRule + RegisterChannelListener registers a callback as a listener of a channel. A + Workflow registers itself with the `SubscribeNotificationChannel` command + instead. + operationId: RegisterChannelListener parameters: - name: namespace in: path required: true schema: type: string + - name: execution.business_id + in: path + required: true + schema: + type: string + - name: channel + in: path + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateWorkflowRuleRequest' + $ref: '#/components/schemas/RegisterChannelListenerRequest' required: true responses: "200": @@ -8456,109 +10072,201 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateWorkflowRuleResponse' + $ref: '#/components/schemas/RegisterChannelListenerResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflow-rules/{ruleId}: - get: + /namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners/{listenerId}: + delete: tags: - WorkflowService description: |- - DescribeWorkflowRule return the rule specification for existing rule id. - If there is no rule with such id - NOT FOUND error will be returned. - operationId: DescribeWorkflowRule + UnregisterChannelListener removes a listener from a channel. + + (-- api-linter: core::0136::http-method=disabled + aip.dev/not-precedent: Removing a listener is a delete of that listener. --) + operationId: UnregisterChannelListener parameters: - name: namespace in: path required: true schema: type: string - - name: ruleId + - name: execution.business_id in: path - description: User-specified ID of the rule to read. Unique within the namespace. required: true schema: type: string + - name: channel + in: path + required: true + schema: + type: string + - name: listenerId + in: path + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the caller, for metrics and logs. + schema: + type: string + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DescribeWorkflowRuleResponse' + $ref: '#/components/schemas/UnregisterChannelListenerResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - delete: + /namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/notifications: + get: tags: - WorkflowService - description: Delete rule by rule id - operationId: DeleteWorkflowRule + description: |- + PollChannel is a long poll for clients. It returns the retained + notifications of a channel with a counter above `after_counter`, waiting + up to `wait` for one when none is retained yet. + operationId: PollChannel parameters: - name: namespace in: path required: true schema: type: string - - name: ruleId + - name: execution.business_id in: path - description: ID of the rule to delete. Unique within the namespace. required: true schema: type: string + - name: channel + in: path + required: true + schema: + type: string + - name: afterCounter + in: query + description: |- + Only notifications with a counter above this one are returned. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "after" names the exclusive lower bound. --) + schema: + type: string + - name: wait + in: query + description: |- + How long to wait for a notification when none is retained above + `after_counter`. + schema: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Represents a a duration between -315,576,000,000s and 315,576,000,000s (around 10000 years). Precision is in nanoseconds. 1 nanosecond is represented as 0.000000001s + - name: maxNotifications + in: query + description: |- + At most this many notifications are returned. Zero means the server's + default. + schema: + type: integer + format: int32 + - name: execution.type + in: query + schema: + enum: + - EXECUTION_TYPE_UNSPECIFIED + - EXECUTION_TYPE_WORKFLOW + - EXECUTION_TYPE_ACTIVITY + - EXECUTION_TYPE_NEXUS_OPERATION + type: string + format: enum + - name: execution.businessId + in: query + schema: + type: string + - name: execution.runId + in: query + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/DeleteWorkflowRuleResponse' + $ref: '#/components/schemas/PollChannelResponse' default: description: Default error response content: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows: - get: + /namespaces/{namespace}/workflows/{execution.business_id}/channels/{notification.channel}/notify: + post: tags: - WorkflowService - description: ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace. - operationId: ListWorkflowExecutions + description: |- + NotifyChannel tells every listener of a channel that a source they consume + has moved. The writer names no addressee and never learns who listens. The + server wakes each listener: a Workflow with a Workflow Task, a callback by + invoking it. Nothing goes to History except the notifications a woken + Workflow Task carries on its scheduled event. + operationId: NotifyChannel parameters: - name: namespace in: path required: true schema: type: string - - name: pageSize - in: query - schema: - type: integer - format: int32 - - name: nextPageToken - in: query + - name: execution.business_id + in: path + required: true schema: type: string - format: bytes - - name: query - in: query + - name: notification.channel + in: path + required: true schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChannelRequest' + required: true responses: "200": description: OK content: application/json: schema: - $ref: '#/components/schemas/ListWorkflowExecutionsResponse' + $ref: '#/components/schemas/NotifyChannelResponse' default: description: Default error response content: @@ -10956,6 +12664,22 @@ components: identity: type: string description: The identity of the worker or client that requested the cancellation. + ChannelListener: + type: object + properties: + listenerId: + type: string + description: Assigned by the server when the listener registers. + workflow: + $ref: '#/components/schemas/WorkflowListener' + callback: + $ref: '#/components/schemas/Callback' + registeredTime: + type: string + format: date-time + description: |- + A listener of a channel: a Workflow Execution woken with a Workflow Task, or + a callback the server invokes with each notification. ChildWorkflowExecutionCanceledEventAttributes: type: object properties: @@ -11867,6 +13591,36 @@ components: items: $ref: '#/components/schemas/Execution' description: Executions is the list of workflow OR standalone activity executions to apply the batch operation + DescribeChannelResponse: + type: object + properties: + listeners: + type: array + items: + $ref: '#/components/schemas/ChannelListener' + latest: + allOf: + - $ref: '#/components/schemas/Notification' + description: The notification with the highest counter the channel retains. + retainedCount: + type: integer + description: How many notifications the channel retains for pollers. + format: int32 + kind: + enum: + - CHANNEL_KIND_UNSPECIFIED + - CHANNEL_KIND_INDEPENDENT + - CHANNEL_KIND_LINKED + type: string + format: enum + linkedTo: + allOf: + - $ref: '#/components/schemas/Execution' + description: |- + The owner of a linked channel and the run that holds it. Empty for an + independent channel. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" names the owner the channel is linked to. --) DescribeDeploymentResponse: type: object properties: @@ -14240,6 +15994,83 @@ components: type: string description: The request ID allocated at schedule time. description: Nexus operation timed out. + Notification: + type: object + properties: + channel: + type: string + description: The channel the writer notified. Listeners register on the same name. + position: + type: string + description: |- + Where the source stands after the write that caused this notification, + in the writer's terms. Opaque to the server. + format: bytes + counter: + type: string + description: |- + Orders notifications from one channel's writers. The writer derives it + from the position, since only the source can order its positions. Among + notifications folded together, the one with the highest counter is kept. + metadata: + type: object + additionalProperties: + $ref: '#/components/schemas/Payload' + description: |- + Details for the listener, such as which topic moved. Bounded in size and + carried as payloads, so a codec applies as to any payload. This is state, + not a log: a fold keeps the latest notification only, so a writer puts + here what is true at `position`, such as which topic moved or a close + flag, never something a consumer must see once per write. + linkedTo: + allOf: + - $ref: '#/components/schemas/Execution' + description: |- + Set for a channel linked to an execution: the owner and the run that + received the notification. Empty for an independent channel. A listener + that holds both kinds routes the notification by it. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "to" names the owner the channel is linked to. --) + description: |- + A notification tells the listeners of a channel that a source they consume + has moved. It is not data: the listener reads the source itself. A channel + is named by the writer and its listeners; for a stream, the provider formats + the stream's identity into the name. Writers never learn who listens. The + server folds notifications per listener while one is pending and no task has + been scheduled for it, keeping the one with the highest counter. + NotifyChannelRequest: + type: object + properties: + namespace: + type: string + notification: + $ref: '#/components/schemas/Notification' + identity: + type: string + description: |- + The identity of the caller, for audit, metrics and logs. It is not copied + into the notification. A writer that wants the consumer to see who wrote + puts that in the notification's `metadata`. + requestId: + type: string + description: Used to de-dupe a retried notification. + execution: + allOf: + - $ref: '#/components/schemas/Execution' + description: |- + When set, the call addresses the channel linked to this execution. + `run_id` is optional and resolves to the current run of a workflow chain, + as a Signal does. When unset, the call addresses the independent channel + of that name. + NotifyChannelResponse: + type: object + properties: + listenerCount: + type: integer + description: |- + Listeners registered when the notification was accepted. Zero means the + notification was retained for pollers and woke nobody. + format: int32 OnConflictOptions: type: object properties: @@ -14687,6 +16518,13 @@ components: description: The run ID of the activity, useful when run_id was not specified in the request. outcome: $ref: '#/components/schemas/ActivityExecutionOutcome' + PollChannelResponse: + type: object + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/Notification' PollNexusOperationExecutionResponse: type: object properties: @@ -15249,6 +17087,36 @@ components: RecordWorkerHeartbeatResponse: type: object properties: {} + RegisterChannelListenerRequest: + type: object + properties: + namespace: + type: string + channel: + type: string + callback: + allOf: + - $ref: '#/components/schemas/Callback' + description: Invoked with each notification on the channel. + requestId: + type: string + description: Used to de-dupe a retried registration. + identity: + type: string + description: The identity of the caller, for metrics and logs. + execution: + allOf: + - $ref: '#/components/schemas/Execution' + description: |- + When set, the call addresses the channel linked to this execution. + `run_id` is optional and resolves to the current run of a workflow chain, + as a Signal does. When unset, the call addresses the independent channel + of that name. + RegisterChannelListenerResponse: + type: object + properties: + listenerId: + type: string RegisterNamespaceRequest: type: object properties: @@ -18366,6 +20234,9 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. + UnregisterChannelListenerResponse: + type: object + properties: {} UpdateActivityExecutionOptionsRequest: type: object properties: @@ -20886,6 +22757,17 @@ components: description: |- Holds all the information about worker versioning for a particular workflow execution. Experimental. Versioning info is experimental and might change in the future. + WorkflowListener: + type: object + properties: + workflowId: + type: string + runId: + type: string + description: |- + The run that subscribed. The server follows a continue-as-new to the + chain's current run when it delivers. + description: A Workflow Execution listening on a channel. WorkflowPropertiesModifiedEventAttributes: type: object properties: diff --git a/temporal/api/notification/v1/message.proto b/temporal/api/notification/v1/message.proto new file mode 100644 index 000000000..584619582 --- /dev/null +++ b/temporal/api/notification/v1/message.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package temporal.api.notification.v1; + +option go_package = "go.temporal.io/api/notification/v1;notification"; +option java_package = "io.temporal.api.notification.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporalio::Api::Notification::V1"; +option csharp_namespace = "Temporalio.Api.Notification.V1"; + +import "google/protobuf/timestamp.proto"; + +import "temporal/api/common/v1/message.proto"; + +// A notification tells the listeners of a channel that a source they consume +// has moved. It is not data: the listener reads the source itself. A channel +// is named by the writer and its listeners; for a stream, the provider formats +// the stream's identity into the name. Writers never learn who listens. The +// server folds notifications per listener while one is pending and no task has +// been scheduled for it, keeping the one with the highest counter. +message Notification { + // The channel the writer notified. Listeners register on the same name. + string channel = 1; + // Where the source stands after the write that caused this notification, + // in the writer's terms. Opaque to the server. + bytes position = 2; + // Orders notifications from one channel's writers. The writer derives it + // from the position, since only the source can order its positions. Among + // notifications folded together, the one with the highest counter is kept. + int64 counter = 3; + // Details for the listener, such as which topic moved. Bounded in size and + // carried as payloads, so a codec applies as to any payload. This is state, + // not a log: a fold keeps the latest notification only, so a writer puts + // here what is true at `position`, such as which topic moved or a close + // flag, never something a consumer must see once per write. + map metadata = 4; + // Set for a channel linked to an execution: the owner and the run that + // received the notification. Empty for an independent channel. A listener + // that holds both kinds routes the notification by it. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" names the owner the channel is linked to. --) + temporal.api.common.v1.Execution linked_to = 5; +} + +// A listener of a channel: a Workflow Execution woken with a Workflow Task, or +// a callback the server invokes with each notification. +message ChannelListener { + // Assigned by the server when the listener registers. + string listener_id = 1; + oneof listener { + WorkflowListener workflow = 2; + temporal.api.common.v1.Callback callback = 3; + } + google.protobuf.Timestamp registered_time = 4; +} + +// A Workflow Execution listening on a channel. +message WorkflowListener { + string workflow_id = 1; + // The run that subscribed. The server follows a continue-as-new to the + // chain's current run when it delivers. + string run_id = 2; +} + +// Where a channel lives, which decides how a call addresses it. +enum ChannelKind { + CHANNEL_KIND_UNSPECIFIED = 0; + // Its own execution, keyed by namespace and channel name. Any number of + // workflows and callbacks listen to it. + CHANNEL_KIND_INDEPENDENT = 1; + // Kept in one execution's state, keyed by namespace, execution and + // channel name. The owning execution is its listener by construction. + CHANNEL_KIND_LINKED = 2; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 1aae988d8..9ed39640c 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -24,6 +24,7 @@ import "temporal/api/enums/v1/activity.proto"; import "temporal/api/enums/v1/nexus.proto"; import "temporal/api/activity/v1/message.proto"; import "temporal/api/common/v1/message.proto"; +import "temporal/api/notification/v1/message.proto"; import "temporal/api/history/v1/message.proto"; import "temporal/api/workflow/v1/message.proto"; import "temporal/api/command/v1/message.proto"; @@ -880,6 +881,112 @@ message SignalWorkflowExecutionResponse { temporal.api.common.v1.Link link = 1; } +message NotifyChannelRequest { + string namespace = 1; + temporal.api.notification.v1.Notification notification = 2; + // The identity of the caller, for audit, metrics and logs. It is not copied + // into the notification. A writer that wants the consumer to see who wrote + // puts that in the notification's `metadata`. + string identity = 3; + // Used to de-dupe a retried notification. + string request_id = 4; + // When set, the call addresses the channel linked to this execution. + // `run_id` is optional and resolves to the current run of a workflow chain, + // as a Signal does. When unset, the call addresses the independent channel + // of that name. + temporal.api.common.v1.Execution execution = 5; +} + +message NotifyChannelResponse { + // Listeners registered when the notification was accepted. Zero means the + // notification was retained for pollers and woke nobody. + int32 listener_count = 1; +} + +message RegisterChannelListenerRequest { + string namespace = 1; + string channel = 2; + // Invoked with each notification on the channel. + temporal.api.common.v1.Callback callback = 3; + // Used to de-dupe a retried registration. + string request_id = 4; + // The identity of the caller, for metrics and logs. + string identity = 5; + // When set, the call addresses the channel linked to this execution. + // `run_id` is optional and resolves to the current run of a workflow chain, + // as a Signal does. When unset, the call addresses the independent channel + // of that name. + temporal.api.common.v1.Execution execution = 6; +} + +message RegisterChannelListenerResponse { + string listener_id = 1; +} + +message UnregisterChannelListenerRequest { + string namespace = 1; + string channel = 2; + string listener_id = 3; + // The identity of the caller, for metrics and logs. + string identity = 4; + // When set, the call addresses the channel linked to this execution. + // `run_id` is optional and resolves to the current run of a workflow chain, + // as a Signal does. When unset, the call addresses the independent channel + // of that name. + temporal.api.common.v1.Execution execution = 5; +} + +message UnregisterChannelListenerResponse { +} + +message PollChannelRequest { + string namespace = 1; + string channel = 2; + // Only notifications with a counter above this one are returned. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "after" names the exclusive lower bound. --) + int64 after_counter = 3; + // How long to wait for a notification when none is retained above + // `after_counter`. + google.protobuf.Duration wait = 4; + // At most this many notifications are returned. Zero means the server's + // default. + int32 max_notifications = 5; + // When set, the call addresses the channel linked to this execution. + // `run_id` is optional and resolves to the current run of a workflow chain, + // as a Signal does. When unset, the call addresses the independent channel + // of that name. + temporal.api.common.v1.Execution execution = 6; +} + +message PollChannelResponse { + repeated temporal.api.notification.v1.Notification notifications = 1; +} + +message DescribeChannelRequest { + string namespace = 1; + string channel = 2; + // When set, the call addresses the channel linked to this execution. + // `run_id` is optional and resolves to the current run of a workflow chain, + // as a Signal does. When unset, the call addresses the independent channel + // of that name. + temporal.api.common.v1.Execution execution = 3; +} + +message DescribeChannelResponse { + repeated temporal.api.notification.v1.ChannelListener listeners = 1; + // The notification with the highest counter the channel retains. + temporal.api.notification.v1.Notification latest = 2; + // How many notifications the channel retains for pollers. + int32 retained_count = 3; + temporal.api.notification.v1.ChannelKind kind = 4; + // The owner of a linked channel and the run that holds it. Empty for an + // independent channel. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "to" names the owner the channel is linked to. --) + temporal.api.common.v1.Execution linked_to = 5; +} + message SignalWithStartWorkflowExecutionRequest { string namespace = 1; string workflow_id = 2; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 34f6a73f6..dde3072da 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -483,6 +483,162 @@ service WorkflowService { }; } + // NotifyChannel tells every listener of a channel that a source they consume + // has moved. The writer names no addressee and never learns who listens. The + // server wakes each listener: a Workflow with a Workflow Task, a callback by + // invoking it. Nothing goes to History except the notifications a woken + // Workflow Task carries on its scheduled event. + rpc NotifyChannel (NotifyChannelRequest) returns (NotifyChannelResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/channels/{notification.channel}/notify" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/channels/{notification.channel}/notify" + body: "*" + } + additional_bindings { + post: "/namespaces/{namespace}/workflows/{execution.business_id}/channels/{notification.channel}/notify" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{notification.channel}/notify" + body: "*" + } + additional_bindings { + post: "/namespaces/{namespace}/activities/{execution.business_id}/channels/{notification.channel}/notify" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{notification.channel}/notify" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "channel:{notification.channel}" + }; + } + + // RegisterChannelListener registers a callback as a listener of a channel. A + // Workflow registers itself with the `SubscribeNotificationChannel` command + // instead. + rpc RegisterChannelListener (RegisterChannelListenerRequest) + returns (RegisterChannelListenerResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/channels/{channel}/listeners" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/channels/{channel}/listeners" + body: "*" + } + additional_bindings { + post: "/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners" + body: "*" + } + additional_bindings { + post: "/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners" + body: "*" + } + additional_bindings { + post: "/api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners" + body: "*" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "channel:{channel}" + }; + } + + // UnregisterChannelListener removes a listener from a channel. + // + // (-- api-linter: core::0136::http-method=disabled + // aip.dev/not-precedent: Removing a listener is a delete of that listener. --) + rpc UnregisterChannelListener (UnregisterChannelListenerRequest) + returns (UnregisterChannelListenerResponse) { + option (google.api.http) = { + delete: "/namespaces/{namespace}/channels/{channel}/listeners/{listener_id}" + additional_bindings { + delete: "/api/v1/namespaces/{namespace}/channels/{channel}/listeners/{listener_id}" + } + additional_bindings { + delete: "/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners/{listener_id}" + } + additional_bindings { + delete: "/api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/listeners/{listener_id}" + } + additional_bindings { + delete: "/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners/{listener_id}" + } + additional_bindings { + delete: "/api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/listeners/{listener_id}" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "channel:{channel}" + }; + } + + // PollChannel is a long poll for clients. It returns the retained + // notifications of a channel with a counter above `after_counter`, waiting + // up to `wait` for one when none is retained yet. + rpc PollChannel (PollChannelRequest) returns (PollChannelResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/channels/{channel}/notifications" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/channels/{channel}/notifications" + } + additional_bindings { + get: "/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/notifications" + } + additional_bindings { + get: "/api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}/notifications" + } + additional_bindings { + get: "/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/notifications" + } + additional_bindings { + get: "/api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}/notifications" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "channel:{channel}" + }; + } + + // DescribeChannel returns the listeners of a channel and its latest + // notification. + rpc DescribeChannel (DescribeChannelRequest) returns (DescribeChannelResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/channels/{channel}" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/channels/{channel}" + } + additional_bindings { + get: "/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}" + } + additional_bindings { + get: "/api/v1/namespaces/{namespace}/workflows/{execution.business_id}/channels/{channel}" + } + additional_bindings { + get: "/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}" + } + additional_bindings { + get: "/api/v1/namespaces/{namespace}/activities/{execution.business_id}/channels/{channel}" + } + }; + option (temporal.api.protometa.v1.request_header) = { + header: "temporal-resource-id" + value: "channel:{channel}" + }; + } + // SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if // it isn't yet started. //