diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 0b643ceb7..daf6a3774 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.", @@ -1382,19 +1710,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" + ] + } + }, + "/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": "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": [ @@ -6102,26 +7074,259 @@ "type": "boolean" }, { - "name": "includeLastFailure", - "description": "Include the last_failure field inside info in the response if available.", - "in": "query", - "required": false, - "type": "boolean" + "name": "includeLastFailure", + "description": "Include the last_failure field inside info in the response if available.", + "in": "query", + "required": false, + "type": "boolean" + } + ], + "tags": [ + "WorkflowService" + ] + }, + "post": { + "summary": "StartActivityExecution starts a new activity execution.", + "description": "Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", + "operationId": "StartActivityExecution", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$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" ] - }, - "post": { - "summary": "StartActivityExecution starts a new activity execution.", - "description": "Returns an `ActivityExecutionAlreadyStarted` error if an instance already exists with same activity ID in this namespace\nunless permitted by the specified ID conflict policy.", - "operationId": "StartActivityExecution", + } + }, + "/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/v1StartActivityExecutionResponse" + "$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" } } ], @@ -6998,25 +8298,303 @@ "type": "string" }, { - "name": "jobId", - "description": "Batch job id", - "in": "path", - "required": true, + "name": "jobId", + "description": "Batch job id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + }, + "post": { + "summary": "StartBatchOperation starts a new batch operation", + "operationId": "StartBatchOperation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1StartBatchOperationResponse" + } + }, + "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": "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" ] - }, - "post": { - "summary": "StartBatchOperation starts a new batch operation", - "operationId": "StartBatchOperation", + } + }, + "/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/v1StartBatchOperationResponse" + "$ref": "#/definitions/v1PollChannelResponse" } }, "default": { @@ -7029,25 +8607,64 @@ "parameters": [ { "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", + "name": "channel", "in": "path", "required": true, "type": "string" }, { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceStartBatchOperationBody" - } + "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": "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" } } ], @@ -9253,25 +10869,213 @@ "name": "body", "in": "body", "required": true, - "schema": { - "$ref": "#/definitions/WorkflowServiceRecordWorkerHeartbeatBody" - } + "schema": { + "$ref": "#/definitions/WorkflowServiceRecordWorkerHeartbeatBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/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": "UpdateWorkerConfig", + "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" + ] + } + }, + "/namespaces/{namespace}/workflow-count": { + "get": { + "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", + "operationId": "CountWorkflowExecutions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CountWorkflowExecutionsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "query", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, + "/namespaces/{namespace}/workflow-rules": { + "get": { + "summary": "Return all namespace workflow rules", + "operationId": "ListWorkflowRules", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListWorkflowRulesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "nextPageToken", + "in": "query", + "required": false, + "type": "string", + "format": "byte" + } + ], + "tags": [ + "WorkflowService" + ] + }, + "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": "CreateWorkflowRule", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkflowRuleResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/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" ] - } - }, - "/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": "UpdateWorkerConfig", + }, + "delete": { + "summary": "Delete rule by rule id", + "operationId": "DeleteWorkflowRule", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1UpdateWorkerConfigResponse" + "$ref": "#/definitions/v1DeleteWorkflowRuleResponse" } }, "default": { @@ -9284,18 +11088,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": [ @@ -9303,15 +11105,15 @@ ] } }, - "/namespaces/{namespace}/workflow-count": { + "/namespaces/{namespace}/workflows": { "get": { - "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", - "operationId": "CountWorkflowExecutions", + "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/v1CountWorkflowExecutionsResponse" + "$ref": "#/definitions/v1ListWorkflowExecutionsResponse" } }, "default": { @@ -9328,6 +11130,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", @@ -9340,15 +11156,15 @@ ] } }, - "/namespaces/{namespace}/workflow-rules": { + "/namespaces/{namespace}/workflows/{execution.businessId}/channels/{channel}": { "get": { - "summary": "Return all namespace workflow rules", - "operationId": "ListWorkflowRules", + "summary": "DescribeChannel returns the listeners of a channel and its latest\nnotification.", + "operationId": "DescribeChannel3", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1ListWorkflowRulesResponse" + "$ref": "#/definitions/v1DescribeChannelResponse" } }, "default": { @@ -9366,25 +11182,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" ] - }, + } + }, + "/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": "CreateWorkflowRule", + "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/v1CreateWorkflowRuleResponse" + "$ref": "#/definitions/v1RegisterChannelListenerResponse" } }, "default": { @@ -9401,12 +11244,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" } } ], @@ -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,84 @@ } } }, + "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." + }, + "v1ChannelSubscriptionInfo": { + "type": "object", + "properties": { + "channel": { + "type": "string", + "description": "Channel name." + }, + "kind": { + "$ref": "#/definitions/v1ChannelKind", + "description": "CHANNEL_KIND_INDEPENDENT for a channel the workflow subscribed to with a\nSubscribeNotificationChannel command. CHANNEL_KIND_LINKED for a channel linked to this\nworkflow, which lists it once the channel holds any state." + }, + "subscribedEventId": { + "type": "string", + "format": "int64", + "description": "Independent kind: id of the WorkflowNotificationChannelSubscribed event that recorded the\nsubscription. Zero for the linked kind." + }, + "lastCounter": { + "type": "string", + "format": "int64", + "description": "Highest counter the workflow has accepted from the channel. Zero when none has arrived." + }, + "pendingNotification": { + "$ref": "#/definitions/v1Notification", + "description": "The notification held for the workflow's next Workflow Task, when one is pending." + }, + "scheduledCounter": { + "type": "string", + "format": "int64", + "description": "Counter carried by the scheduled event of a Workflow Task that has not started yet. Zero\notherwise." + }, + "listenerCount": { + "type": "integer", + "format": "int32", + "description": "Linked kind: callback listeners registered on the channel." + }, + "retainedCount": { + "type": "integer", + "format": "int32", + "description": "Linked kind: notifications retained for pollers." + }, + "acceptedCount": { + "type": "string", + "format": "int64", + "description": "Linked kind: notifications the channel has accepted over its life." + } + }, + "description": "A workflow's standing on a notification channel, as reported by DescribeWorkflowExecution." + }, "v1ChildWorkflowExecutionCanceledEventAttributes": { "type": "object", "properties": { @@ -15670,6 +17773,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": { @@ -15916,6 +18047,14 @@ }, "workflowExtendedInfo": { "$ref": "#/definitions/v1WorkflowExecutionExtendedInfo" + }, + "channelSubscriptions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ChannelSubscriptionInfo" + }, + "description": "The notification channels this run stands on: the independent channels it subscribed to and\nthe channels linked to it that hold any state. Empty when there are none." } } }, @@ -16116,10 +18255,14 @@ "EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED", "EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED", "EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED", - "EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED" + "EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED", + "EVENT_TYPE_WORKFLOW_STREAM_SUBSCRIBED", + "EVENT_TYPE_WORKFLOW_STREAM_RECORDS_APPENDED", + "EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_SUBSCRIBED", + "EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_UNSUBSCRIBED" ], "default": "EVENT_TYPE_UNSPECIFIED", - "description": "- EVENT_TYPE_UNSPECIFIED: Place holder and should never appear in a Workflow execution history\n - EVENT_TYPE_WORKFLOW_EXECUTION_STARTED: Workflow execution has been triggered/started\nIt contains Workflow execution inputs, as well as Workflow timeout configurations\n - EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED: Workflow execution has successfully completed and contains Workflow execution results\n - EVENT_TYPE_WORKFLOW_EXECUTION_FAILED: Workflow execution has unsuccessfully completed and contains the Workflow execution error\n - EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT: Workflow execution has timed out by the Temporal Server\nUsually due to the Workflow having not been completed within timeout settings\n - EVENT_TYPE_WORKFLOW_TASK_SCHEDULED: Workflow Task has been scheduled and the SDK client should now be able to process any new history events\n - EVENT_TYPE_WORKFLOW_TASK_STARTED: Workflow Task has started and the SDK client has picked up the Workflow Task and is processing new history events\n - EVENT_TYPE_WORKFLOW_TASK_COMPLETED: Workflow Task has completed\nThe SDK client picked up the Workflow Task and processed new history events\nSDK client may or may not ask the Temporal Server to do additional work, such as:\nEVENT_TYPE_ACTIVITY_TASK_SCHEDULED\nEVENT_TYPE_TIMER_STARTED\nEVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES\nEVENT_TYPE_MARKER_RECORDED\nEVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED\nEVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED\nEVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED\nEVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED\nEVENT_TYPE_WORKFLOW_EXECUTION_FAILED\nEVENT_TYPE_WORKFLOW_EXECUTION_CANCELED\nEVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW\n - EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT: Workflow Task encountered a timeout\nEither an SDK client with a local cache was not available at the time, or it took too long for the SDK client to process the task\n - EVENT_TYPE_WORKFLOW_TASK_FAILED: Workflow Task encountered a failure\nUsually this means that the Workflow was non-deterministic\nHowever, the Workflow reset functionality also uses this event\n - EVENT_TYPE_ACTIVITY_TASK_SCHEDULED: Activity Task was scheduled\nThe SDK client should pick up this activity task and execute\nThis event type contains activity inputs, as well as activity timeout configurations\n - EVENT_TYPE_ACTIVITY_TASK_STARTED: Activity Task has started executing\nThe SDK client has picked up the Activity Task and is processing the Activity invocation\n - EVENT_TYPE_ACTIVITY_TASK_COMPLETED: Activity Task has finished successfully\nThe SDK client has picked up and successfully completed the Activity Task\nThis event type contains Activity execution results\n - EVENT_TYPE_ACTIVITY_TASK_FAILED: Activity Task has finished unsuccessfully\nThe SDK picked up the Activity Task but unsuccessfully completed it\nThis event type contains Activity execution errors\n - EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT: Activity has timed out according to the Temporal Server\nActivity did not complete within the timeout settings\n - EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED: A request to cancel the Activity has occurred\nThe SDK client will be able to confirm cancellation of an Activity during an Activity heartbeat\n - EVENT_TYPE_ACTIVITY_TASK_CANCELED: Activity has been cancelled\n - EVENT_TYPE_TIMER_STARTED: A timer has started\n - EVENT_TYPE_TIMER_FIRED: A timer has fired\n - EVENT_TYPE_TIMER_CANCELED: A time has been cancelled\n - EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED: A request has been made to cancel the Workflow execution\n - EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED: SDK client has confirmed the cancellation request and the Workflow execution has been cancelled\n - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED: Workflow has requested that the Temporal Server try to cancel another Workflow\n - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED: Temporal Server could not cancel the targeted Workflow\nThis is usually because the target Workflow could not be found\n - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED: Temporal Server has successfully requested the cancellation of the target Workflow\n - EVENT_TYPE_MARKER_RECORDED: A marker has been recorded.\nThis event type is transparent to the Temporal Server\nThe Server will only store it and will not try to understand it.\n - EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED: Workflow has received a Signal event\nThe event type contains the Signal name, as well as a Signal payload\n - EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED: Workflow execution has been forcefully terminated\nThis is usually because the terminate Workflow API was called\n - EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW: Workflow has successfully completed and a new Workflow has been started within the same transaction\nContains last Workflow execution results as well as new Workflow execution inputs\n - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED: Temporal Server will try to start a child Workflow\n - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED: Child Workflow execution cannot be started/triggered\nUsually due to a child Workflow ID collision\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED: Child Workflow execution has successfully started/triggered\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED: Child Workflow execution has successfully completed\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED: Child Workflow execution has unsuccessfully completed\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED: Child Workflow execution has been cancelled\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT: Child Workflow execution has timed out by the Temporal Server\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED: Child Workflow execution has been terminated\n - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED: Temporal Server will try to Signal the targeted Workflow\nContains the Signal name, as well as a Signal payload\n - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED: Temporal Server cannot Signal the targeted Workflow\nUsually because the Workflow could not be found\n - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED: Temporal Server has successfully Signaled the targeted Workflow\n - EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES: Workflow search attributes should be updated and synchronized with the visibility store\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED: An update was admitted. Note that not all admitted updates result in this\nevent. See UpdateAdmittedEventOrigin for situations in which this event\nis created.\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ACCEPTED: An update was accepted (i.e. passed validation, perhaps because no validator was defined)\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REJECTED: This event is never written to history.\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_COMPLETED: An update completed\n - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED_EXTERNALLY: Some property or properties of the workflow as a whole have changed by non-workflow code.\nThe distinction of external vs. command-based modification is important so the SDK can\nmaintain determinism when using the command-based approach.\n - EVENT_TYPE_ACTIVITY_PROPERTIES_MODIFIED_EXTERNALLY: Some property or properties of an already-scheduled activity have changed by non-workflow code.\nThe distinction of external vs. command-based modification is important so the SDK can\nmaintain determinism when using the command-based approach.\n - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED: Workflow properties modified by user workflow code\n - EVENT_TYPE_NEXUS_OPERATION_SCHEDULED: A Nexus operation was scheduled using a ScheduleNexusOperation command.\n - EVENT_TYPE_NEXUS_OPERATION_STARTED: An asynchronous Nexus operation was started by a Nexus handler.\n - EVENT_TYPE_NEXUS_OPERATION_COMPLETED: A Nexus operation completed successfully.\n - EVENT_TYPE_NEXUS_OPERATION_FAILED: A Nexus operation failed.\n - EVENT_TYPE_NEXUS_OPERATION_CANCELED: A Nexus operation completed as canceled.\n - EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT: A Nexus operation timed out.\n - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED: A Nexus operation was requested to be canceled using a RequestCancelNexusOperation command.\n - EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED: Workflow execution options updated by user.\n - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_COMPLETED: A cancellation request for a Nexus operation was successfully delivered to the Nexus handler.\n - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED: A cancellation request for a Nexus operation resulted in an error.\n - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED: An event that indicates that the workflow execution has been paused.\n - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED: An event that indicates that the previously paused workflow execution has been unpaused.\n - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED: An event that indicates time skipping advanced time or was disabled automatically after a bound was reached.", + "description": "- EVENT_TYPE_UNSPECIFIED: Place holder and should never appear in a Workflow execution history\n - EVENT_TYPE_WORKFLOW_EXECUTION_STARTED: Workflow execution has been triggered/started\nIt contains Workflow execution inputs, as well as Workflow timeout configurations\n - EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED: Workflow execution has successfully completed and contains Workflow execution results\n - EVENT_TYPE_WORKFLOW_EXECUTION_FAILED: Workflow execution has unsuccessfully completed and contains the Workflow execution error\n - EVENT_TYPE_WORKFLOW_EXECUTION_TIMED_OUT: Workflow execution has timed out by the Temporal Server\nUsually due to the Workflow having not been completed within timeout settings\n - EVENT_TYPE_WORKFLOW_TASK_SCHEDULED: Workflow Task has been scheduled and the SDK client should now be able to process any new history events\n - EVENT_TYPE_WORKFLOW_TASK_STARTED: Workflow Task has started and the SDK client has picked up the Workflow Task and is processing new history events\n - EVENT_TYPE_WORKFLOW_TASK_COMPLETED: Workflow Task has completed\nThe SDK client picked up the Workflow Task and processed new history events\nSDK client may or may not ask the Temporal Server to do additional work, such as:\nEVENT_TYPE_ACTIVITY_TASK_SCHEDULED\nEVENT_TYPE_TIMER_STARTED\nEVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES\nEVENT_TYPE_MARKER_RECORDED\nEVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED\nEVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED\nEVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED\nEVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED\nEVENT_TYPE_WORKFLOW_EXECUTION_FAILED\nEVENT_TYPE_WORKFLOW_EXECUTION_CANCELED\nEVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW\n - EVENT_TYPE_WORKFLOW_TASK_TIMED_OUT: Workflow Task encountered a timeout\nEither an SDK client with a local cache was not available at the time, or it took too long for the SDK client to process the task\n - EVENT_TYPE_WORKFLOW_TASK_FAILED: Workflow Task encountered a failure\nUsually this means that the Workflow was non-deterministic\nHowever, the Workflow reset functionality also uses this event\n - EVENT_TYPE_ACTIVITY_TASK_SCHEDULED: Activity Task was scheduled\nThe SDK client should pick up this activity task and execute\nThis event type contains activity inputs, as well as activity timeout configurations\n - EVENT_TYPE_ACTIVITY_TASK_STARTED: Activity Task has started executing\nThe SDK client has picked up the Activity Task and is processing the Activity invocation\n - EVENT_TYPE_ACTIVITY_TASK_COMPLETED: Activity Task has finished successfully\nThe SDK client has picked up and successfully completed the Activity Task\nThis event type contains Activity execution results\n - EVENT_TYPE_ACTIVITY_TASK_FAILED: Activity Task has finished unsuccessfully\nThe SDK picked up the Activity Task but unsuccessfully completed it\nThis event type contains Activity execution errors\n - EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT: Activity has timed out according to the Temporal Server\nActivity did not complete within the timeout settings\n - EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED: A request to cancel the Activity has occurred\nThe SDK client will be able to confirm cancellation of an Activity during an Activity heartbeat\n - EVENT_TYPE_ACTIVITY_TASK_CANCELED: Activity has been cancelled\n - EVENT_TYPE_TIMER_STARTED: A timer has started\n - EVENT_TYPE_TIMER_FIRED: A timer has fired\n - EVENT_TYPE_TIMER_CANCELED: A time has been cancelled\n - EVENT_TYPE_WORKFLOW_EXECUTION_CANCEL_REQUESTED: A request has been made to cancel the Workflow execution\n - EVENT_TYPE_WORKFLOW_EXECUTION_CANCELED: SDK client has confirmed the cancellation request and the Workflow execution has been cancelled\n - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED: Workflow has requested that the Temporal Server try to cancel another Workflow\n - EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED: Temporal Server could not cancel the targeted Workflow\nThis is usually because the target Workflow could not be found\n - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED: Temporal Server has successfully requested the cancellation of the target Workflow\n - EVENT_TYPE_MARKER_RECORDED: A marker has been recorded.\nThis event type is transparent to the Temporal Server\nThe Server will only store it and will not try to understand it.\n - EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED: Workflow has received a Signal event\nThe event type contains the Signal name, as well as a Signal payload\n - EVENT_TYPE_WORKFLOW_EXECUTION_TERMINATED: Workflow execution has been forcefully terminated\nThis is usually because the terminate Workflow API was called\n - EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW: Workflow has successfully completed and a new Workflow has been started within the same transaction\nContains last Workflow execution results as well as new Workflow execution inputs\n - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_INITIATED: Temporal Server will try to start a child Workflow\n - EVENT_TYPE_START_CHILD_WORKFLOW_EXECUTION_FAILED: Child Workflow execution cannot be started/triggered\nUsually due to a child Workflow ID collision\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED: Child Workflow execution has successfully started/triggered\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_COMPLETED: Child Workflow execution has successfully completed\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED: Child Workflow execution has unsuccessfully completed\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED: Child Workflow execution has been cancelled\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TIMED_OUT: Child Workflow execution has timed out by the Temporal Server\n - EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_TERMINATED: Child Workflow execution has been terminated\n - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_INITIATED: Temporal Server will try to Signal the targeted Workflow\nContains the Signal name, as well as a Signal payload\n - EVENT_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED: Temporal Server cannot Signal the targeted Workflow\nUsually because the Workflow could not be found\n - EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_SIGNALED: Temporal Server has successfully Signaled the targeted Workflow\n - EVENT_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES: Workflow search attributes should be updated and synchronized with the visibility store\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ADMITTED: An update was admitted. Note that not all admitted updates result in this\nevent. See UpdateAdmittedEventOrigin for situations in which this event\nis created.\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_ACCEPTED: An update was accepted (i.e. passed validation, perhaps because no validator was defined)\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_REJECTED: This event is never written to history.\n - EVENT_TYPE_WORKFLOW_EXECUTION_UPDATE_COMPLETED: An update completed\n - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED_EXTERNALLY: Some property or properties of the workflow as a whole have changed by non-workflow code.\nThe distinction of external vs. command-based modification is important so the SDK can\nmaintain determinism when using the command-based approach.\n - EVENT_TYPE_ACTIVITY_PROPERTIES_MODIFIED_EXTERNALLY: Some property or properties of an already-scheduled activity have changed by non-workflow code.\nThe distinction of external vs. command-based modification is important so the SDK can\nmaintain determinism when using the command-based approach.\n - EVENT_TYPE_WORKFLOW_PROPERTIES_MODIFIED: Workflow properties modified by user workflow code\n - EVENT_TYPE_NEXUS_OPERATION_SCHEDULED: A Nexus operation was scheduled using a ScheduleNexusOperation command.\n - EVENT_TYPE_NEXUS_OPERATION_STARTED: An asynchronous Nexus operation was started by a Nexus handler.\n - EVENT_TYPE_NEXUS_OPERATION_COMPLETED: A Nexus operation completed successfully.\n - EVENT_TYPE_NEXUS_OPERATION_FAILED: A Nexus operation failed.\n - EVENT_TYPE_NEXUS_OPERATION_CANCELED: A Nexus operation completed as canceled.\n - EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT: A Nexus operation timed out.\n - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED: A Nexus operation was requested to be canceled using a RequestCancelNexusOperation command.\n - EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED: Workflow execution options updated by user.\n - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_COMPLETED: A cancellation request for a Nexus operation was successfully delivered to the Nexus handler.\n - EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUEST_FAILED: A cancellation request for a Nexus operation resulted in an error.\n - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED: An event that indicates that the workflow execution has been paused.\n - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED: An event that indicates that the previously paused workflow execution has been unpaused.\n - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED: An event that indicates time skipping advanced time or was disabled automatically after a bound was reached.\n - EVENT_TYPE_WORKFLOW_STREAM_SUBSCRIBED: A Workflow subscribed to a stream. Recorded once per subscription, not\nper record: the offsets a task consumed ride WorkflowTaskCompleted and\nthe payloads never enter History at all.\n - EVENT_TYPE_WORKFLOW_STREAM_RECORDS_APPENDED: A Workflow appended a batch of records to a stream. Recorded per\nbatch, and carrying only the offset range it landed at: the bodies go to\nthe stream's own log, never into History.\n - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_SUBSCRIBED: A Workflow became a listener of a notification channel for its run.\nThe notifications themselves ride the WorkflowTaskScheduled event.\n - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_UNSUBSCRIBED: A Workflow stopped listening on a notification channel for its run.\nRecorded for every UnsubscribeNotificationChannel command, including one\nnaming a channel the run was not subscribed to.", "title": "Whenever this list of events is changed do change the function shouldBufferEvent in mutableStateBuilder.go to make sure to do the correct event ordering" }, "v1Execution": { @@ -16786,6 +18929,18 @@ }, "workflowExecutionTimeSkippingTransitionedEventAttributes": { "$ref": "#/definitions/v1WorkflowExecutionTimeSkippingTransitionedEventAttributes" + }, + "workflowStreamSubscribedEventAttributes": { + "$ref": "#/definitions/v1WorkflowStreamSubscribedEventAttributes" + }, + "workflowStreamRecordsAppendedEventAttributes": { + "$ref": "#/definitions/v1WorkflowStreamRecordsAppendedEventAttributes" + }, + "workflowNotificationChannelSubscribedEventAttributes": { + "$ref": "#/definitions/v1WorkflowNotificationChannelSubscribedEventAttributes" + }, + "workflowNotificationChannelUnsubscribedEventAttributes": { + "$ref": "#/definitions/v1WorkflowNotificationChannelUnsubscribedEventAttributes" } }, "description": "History events are the method by which Temporal SDKs advance (or recreate) workflow state.\nSee the `EventType` enum for more info about what each event is for." @@ -18085,6 +20240,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 +20619,18 @@ } } }, + "v1PollChannelResponse": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Notification" + } + } + } + }, "v1PollNexusOperationExecutionResponse": { "type": "object", "properties": { @@ -18560,6 +20768,14 @@ "pollerGroupsInfo": { "$ref": "#/definitions/v1PollerGroupsInfo", "description": "The weighted, versioned list of poller groups IDs that client should use for future polls to\nthis task queue. Client should ignore this if it has already applied a snapshot with a\nversion greater than or equal to `poller_groups_info.version`. Client is expected to:\n 1. Maintain minimum number of pollers no less than the number of groups.\n 2. Try to assign the next poll to a group without any pending polls,\n 3. If every group has some pending polls, assign the next poll to a group randomly\n according to the weights." + }, + "streamSlices": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1StreamSlice" + }, + "description": "Stream data attached to this task. Delivered out of band so the payloads\nnever enter History; only the offset ranges are recorded there." } } }, @@ -18809,6 +21025,14 @@ "v1RecordWorkerHeartbeatResponse": { "type": "object" }, + "v1RegisterChannelListenerResponse": { + "type": "object", + "properties": { + "listenerId": { + "type": "string" + } + } + }, "v1RegisterNamespaceRequest": { "type": "object", "properties": { @@ -20049,6 +22273,111 @@ } } }, + "v1StreamRange": { + "type": "object", + "properties": { + "streamId": { + "type": "string", + "description": "The stream, as the subscribing command addressed it: either the name of\na stream the consuming Workflow owns or the id of one in another\nexecution." + }, + "fromOffset": { + "type": "string", + "format": "int64", + "description": "Inclusive." + }, + "toOffset": { + "type": "string", + "format": "int64", + "description": "Exclusive." + } + }, + "description": "The offsets a Workflow Task consumed, without the payloads. Recorded on\nWorkflowTaskCompleted so History grows with Workflow Tasks rather than with\nrecords." + }, + "v1StreamRecord": { + "type": "object", + "properties": { + "body": { + "$ref": "#/definitions/v1Payload", + "description": "The value the producer published, stored as sent.\n\nA payload codec applies on the paths this API owns: the append command on\nRespondWorkflowTaskCompleted, and the slices on PollWorkflowTaskQueue.\nRecords a producer writes or reads through the stream service take a\ndifferent path, whose messages are not part of this API yet and so are\noutside what a codec-applying proxy walks." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1Payload" + }, + "description": "Producer-supplied provenance, stored as sent." + }, + "topic": { + "type": "string", + "description": "Producer-supplied grouping label, stored as sent." + }, + "kind": { + "$ref": "#/definitions/v1StreamRecordKind", + "description": "How to read this record. Unspecified is read as DATA." + }, + "producerId": { + "type": "string", + "description": "Who wrote the record. Empty when the owning Workflow did." + }, + "attempt": { + "type": "string", + "format": "int64", + "description": "The producer's attempt. Readers treat a later attempt by the same\nproducer as superseding what the earlier one wrote." + }, + "sequence": { + "type": "string", + "format": "int64", + "description": "The producer's position within its attempt, zero when it does not number\nits records. Stored as sent; the server does not assign, validate or\norder by it, and the stream's own offsets are what order a read." + } + }, + "description": "One entry in a stream. The record is the wire format: stores keep it\nserialized as is and readers in every language decode the same bytes." + }, + "v1StreamRecordKind": { + "type": "string", + "enum": [ + "STREAM_RECORD_KIND_UNSPECIFIED", + "STREAM_RECORD_KIND_DATA", + "STREAM_RECORD_KIND_FINISH" + ], + "default": "STREAM_RECORD_KIND_UNSPECIFIED", + "description": "What a record means to a reader. Kept on the record itself so every store\nand every language reads it the same way without a private envelope.\n\n - STREAM_RECORD_KIND_UNSPECIFIED: Read as DATA.\n - STREAM_RECORD_KIND_DATA: A value the producer published; `body` carries it.\n - STREAM_RECORD_KIND_FINISH: The producer named by `producer_id` writes nothing more on `topic`.\nSays nothing about that producer's outcome and does not end the stream." + }, + "v1StreamSlice": { + "type": "object", + "properties": { + "streamId": { + "type": "string", + "description": "The stream, as the subscribing command addressed it: either the name of\na stream the consuming Workflow owns or the id of one in another\nexecution." + }, + "runId": { + "type": "string", + "description": "Run id of the execution that owns the stream. Set on both a slice for the\ntask being started and a re-supplied one." + }, + "fromOffset": { + "type": "string", + "format": "int64", + "description": "Inclusive." + }, + "toOffset": { + "type": "string", + "format": "int64", + "description": "Exclusive. Equal to from_offset when the subscription observed nothing,\nwhich is a fact replay has to reproduce rather than an absence of one." + }, + "records": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1StreamRecord" + } + }, + "workflowTaskCompletedEventId": { + "type": "string", + "format": "int64", + "description": "The WorkflowTaskCompleted event whose consumed_stream_ranges recorded\nthis range. Set only when the server is re-supplying a range for a task\nbeing replayed; a slice for the task now being started leaves it unset,\nbecause the event closing that task does not exist yet.\n\nReplay needs this because a Workflow Task response carries one slice set\nwhile a cache miss replays every prior task, so the ranges have to be\nmatched to the events that recorded them rather than to the response." + } + }, + "description": "A contiguous range of a stream delivered to a Workflow Task, along with the\noffsets it covers. The offsets are what History records; the records\nthemselves are never written to History." + }, "v1StructuredCalendarSpec": { "type": "object", "properties": { @@ -20608,6 +22937,9 @@ "type": "object", "description": "Response to a successful UnpauseWorkflowExecution request." }, + "v1UnregisterChannelListenerResponse": { + "type": "object" + }, "v1UpdateActivityExecutionOptionsResponse": { "type": "object", "properties": { @@ -22307,6 +24639,52 @@ "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." + }, + "v1WorkflowNotificationChannelSubscribedEventAttributes": { + "type": "object", + "properties": { + "workflowTaskCompletedEventId": { + "type": "string", + "format": "int64", + "description": "The WorkflowTaskCompleted event of the task whose command created this\nsubscription." + }, + "channel": { + "type": "string", + "description": "The channel the Workflow listens on for the rest of this run." + } + } + }, + "v1WorkflowNotificationChannelUnsubscribedEventAttributes": { + "type": "object", + "properties": { + "workflowTaskCompletedEventId": { + "type": "string", + "format": "int64", + "description": "The WorkflowTaskCompleted event of the task whose command ended this\nsubscription." + }, + "channel": { + "type": "string", + "description": "The channel the Workflow stopped listening on." + }, + "subscribedEventId": { + "type": "string", + "format": "int64", + "description": "The WorkflowNotificationChannelSubscribed event that recorded the\nsubscription this command ended. Zero when the run held no subscription\nfor the channel." + } + } + }, "v1WorkflowPropertiesModifiedEventAttributes": { "type": "object", "properties": { @@ -22425,6 +24803,49 @@ } } }, + "v1WorkflowStreamRecordsAppendedEventAttributes": { + "type": "object", + "properties": { + "workflowTaskCompletedEventId": { + "type": "string", + "format": "int64", + "description": "The WorkflowTaskCompleted event of the task whose command appended this\nbatch." + }, + "streamId": { + "type": "string", + "description": "Name of the stream the Workflow appended to." + }, + "fromOffset": { + "type": "string", + "format": "int64", + "description": "Inclusive. Same range vocabulary as StreamRange and StreamSlice, so a\nreader does not have to remember which of the three counts and which\nbounds." + }, + "toOffset": { + "type": "string", + "format": "int64", + "description": "Exclusive. With from_offset this names the range without carrying any of\nit, which is what keeps this event a fixed size no matter how large the\nbatch or its payloads are." + } + } + }, + "v1WorkflowStreamSubscribedEventAttributes": { + "type": "object", + "properties": { + "workflowTaskCompletedEventId": { + "type": "string", + "format": "int64", + "description": "The WorkflowTaskCompleted event of the task whose command created this\nsubscription." + }, + "streamId": { + "type": "string", + "description": "The stream the Workflow subscribed to, as the command addressed it:\neither the name of a stream this Workflow owns or the id of one in\nanother execution." + }, + "startOffset": { + "type": "string", + "format": "int64", + "description": "The offset the subscription actually starts from. Resolved by the server\nwhen the subscription is registered and recorded here, so replay reads\nthe resolved value rather than resolving it again against a stream that\nhas since moved." + } + } + }, "v1WorkflowTaskCompletedEventAttributes": { "type": "object", "properties": { @@ -22477,6 +24898,14 @@ "deploymentVersion": { "$ref": "#/definitions/v1WorkerDeploymentVersion", "description": "The Worker Deployment Version that completed this task. Must be set if `versioning_behavior`\nis set. This value updates workflow execution's `versioning_info.deployment_version`." + }, + "consumedStreamRanges": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1StreamRange" + }, + "description": "Offset ranges this Workflow Task consumed from streams it subscribes to.\nRecorded on every task where a subscription is active, including when it\nobserved nothing: an empty range is a fact replay must reproduce, and\nomitting it would let replay deliver records the Workflow did not have." } } }, @@ -22553,10 +24982,15 @@ "WORKFLOW_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE", "WORKFLOW_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE", "WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_PAUSE_REQUESTED_BEFORE_TASK_STARTED", - "WORKFLOW_TASK_FAILED_CAUSE_REQUEST_TOO_LARGE" + "WORKFLOW_TASK_FAILED_CAUSE_REQUEST_TOO_LARGE", + "WORKFLOW_TASK_FAILED_CAUSE_BAD_APPEND_STREAM_RECORDS_ATTRIBUTES", + "WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_STREAM_ATTRIBUTES", + "WORKFLOW_TASK_FAILED_CAUSE_STREAM_RANGE_UNAVAILABLE", + "WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES", + "WORKFLOW_TASK_FAILED_CAUSE_BAD_UNSUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES" ], "default": "WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED", - "description": "Workflow tasks can fail for various reasons. Note that some of these reasons can only originate\nfrom the server, and some of them can only originate from the SDK/worker.\n\n - WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND: Between starting and completing the workflow task (with a workflow completion command), some\nnew command (like a signal) was processed into workflow history. The outstanding task will be\nfailed with this reason, and a worker must pick up a new task.\n - WORKFLOW_TASK_FAILED_CAUSE_RESET_STICKY_TASK_QUEUE: The worker wishes to fail the task and have the next one be generated on a normal, not sticky\nqueue. Generally workers should prefer to use the explicit `ResetStickyTaskQueue` RPC call.\n - WORKFLOW_TASK_FAILED_CAUSE_NON_DETERMINISTIC_ERROR: The worker encountered a mismatch while replaying history between what was expected, and\nwhat the workflow code actually did.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_CHILD_WORKFLOWS_LIMIT_EXCEEDED: We send the below error codes to users when their requests would violate a size constraint\nof their workflow. We do this to ensure that the state of their workflow does not become too\nlarge because that can cause severe performance degradation. You can modify the thresholds for\neach of these errors within your dynamic config.\n\nSpawning a new child workflow would cause this workflow to exceed its limit of pending child\nworkflows.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_ACTIVITIES_LIMIT_EXCEEDED: Starting a new activity would cause this workflow to exceed its limit of pending activities\nthat we track.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_SIGNALS_LIMIT_EXCEEDED: A workflow has a buffer of signals that have not yet reached their destination. We return this\nerror when sending a new signal would exceed the capacity of this buffer.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_REQUEST_CANCEL_LIMIT_EXCEEDED: Similarly, we have a buffer of pending requests to cancel other workflows. We return this error\nwhen our capacity for pending cancel requests is already reached.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_UPDATE_WORKFLOW_EXECUTION_MESSAGE: Workflow execution update message (update.Acceptance, update.Rejection, or update.Response)\nhas wrong format, or missing required fields.\n - WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_UPDATE: Similar to WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND, but for updates.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES: A workflow task completed with an invalid ScheduleNexusOperation command.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_NEXUS_OPERATIONS_LIMIT_EXCEEDED: A workflow task completed requesting to schedule a Nexus Operation exceeding the server configured limit.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_NEXUS_OPERATION_ATTRIBUTES: A workflow task completed with an invalid RequestCancelNexusOperation command.\n - WORKFLOW_TASK_FAILED_CAUSE_FEATURE_DISABLED: A workflow task completed requesting a feature that's disabled on the server (either system wide or - typically -\nfor the workflow's namespace).\nCheck the workflow task failure message for more information.\n - WORKFLOW_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE: A workflow task failed because a grpc message was too large.\n - WORKFLOW_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE: A workflow task failed because payloads were too large.\n - WORKFLOW_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE: A workflow task failed because an external storage operation failed.\nCheck the workflow task failure message for more information.\n - WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_PAUSE_REQUESTED_BEFORE_TASK_STARTED: A workflow task is failed because the workflow is paused before the task is started.\n - WORKFLOW_TASK_FAILED_CAUSE_REQUEST_TOO_LARGE: A workflow task failed because the request exceeded a size limit." + "description": "Workflow tasks can fail for various reasons. Note that some of these reasons can only originate\nfrom the server, and some of them can only originate from the SDK/worker.\n\n - WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND: Between starting and completing the workflow task (with a workflow completion command), some\nnew command (like a signal) was processed into workflow history. The outstanding task will be\nfailed with this reason, and a worker must pick up a new task.\n - WORKFLOW_TASK_FAILED_CAUSE_RESET_STICKY_TASK_QUEUE: The worker wishes to fail the task and have the next one be generated on a normal, not sticky\nqueue. Generally workers should prefer to use the explicit `ResetStickyTaskQueue` RPC call.\n - WORKFLOW_TASK_FAILED_CAUSE_NON_DETERMINISTIC_ERROR: The worker encountered a mismatch while replaying history between what was expected, and\nwhat the workflow code actually did.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_CHILD_WORKFLOWS_LIMIT_EXCEEDED: We send the below error codes to users when their requests would violate a size constraint\nof their workflow. We do this to ensure that the state of their workflow does not become too\nlarge because that can cause severe performance degradation. You can modify the thresholds for\neach of these errors within your dynamic config.\n\nSpawning a new child workflow would cause this workflow to exceed its limit of pending child\nworkflows.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_ACTIVITIES_LIMIT_EXCEEDED: Starting a new activity would cause this workflow to exceed its limit of pending activities\nthat we track.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_SIGNALS_LIMIT_EXCEEDED: A workflow has a buffer of signals that have not yet reached their destination. We return this\nerror when sending a new signal would exceed the capacity of this buffer.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_REQUEST_CANCEL_LIMIT_EXCEEDED: Similarly, we have a buffer of pending requests to cancel other workflows. We return this error\nwhen our capacity for pending cancel requests is already reached.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_UPDATE_WORKFLOW_EXECUTION_MESSAGE: Workflow execution update message (update.Acceptance, update.Rejection, or update.Response)\nhas wrong format, or missing required fields.\n - WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_UPDATE: Similar to WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND, but for updates.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES: A workflow task completed with an invalid ScheduleNexusOperation command.\n - WORKFLOW_TASK_FAILED_CAUSE_PENDING_NEXUS_OPERATIONS_LIMIT_EXCEEDED: A workflow task completed requesting to schedule a Nexus Operation exceeding the server configured limit.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_NEXUS_OPERATION_ATTRIBUTES: A workflow task completed with an invalid RequestCancelNexusOperation command.\n - WORKFLOW_TASK_FAILED_CAUSE_FEATURE_DISABLED: A workflow task completed requesting a feature that's disabled on the server (either system wide or - typically -\nfor the workflow's namespace).\nCheck the workflow task failure message for more information.\n - WORKFLOW_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE: A workflow task failed because a grpc message was too large.\n - WORKFLOW_TASK_FAILED_CAUSE_PAYLOADS_TOO_LARGE: A workflow task failed because payloads were too large.\n - WORKFLOW_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE: A workflow task failed because an external storage operation failed.\nCheck the workflow task failure message for more information.\n - WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_PAUSE_REQUESTED_BEFORE_TASK_STARTED: A workflow task is failed because the workflow is paused before the task is started.\n - WORKFLOW_TASK_FAILED_CAUSE_REQUEST_TOO_LARGE: A workflow task failed because the request exceeded a size limit.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_APPEND_STREAM_RECORDS_ATTRIBUTES: A workflow task completed with an invalid AppendStreamRecords command.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_STREAM_ATTRIBUTES: A workflow task completed with an invalid SubscribeStream command.\n - WORKFLOW_TASK_FAILED_CAUSE_STREAM_RANGE_UNAVAILABLE: A workflow task could not be started because a stream range it consumed and recorded in\nHistory can no longer be served, for example after truncation or because it exceeds the\nreplay bound. Check the workflow task failure message for more information.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES: A SubscribeNotificationChannel command named an empty or too-long channel, or hit a\nsubscription or listener limit.\n - WORKFLOW_TASK_FAILED_CAUSE_BAD_UNSUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES: An UnsubscribeNotificationChannel command named an empty or too-long channel." }, "v1WorkflowTaskFailedEventAttributes": { "type": "object", @@ -22620,6 +25054,14 @@ "type": "integer", "format": "int32", "title": "Starting at 1, how many attempts there have been to complete this task" + }, + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Notification" + }, + "description": "Notifications for channels this Workflow listens to, folded per channel\nsince the last task was scheduled. In History so a Workflow may act on\nthem deterministically and replay sees the same." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 2aa7c45bf..d960c88e1 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": @@ -6383,7 +7530,275 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StopBatchOperationRequest' + $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 + 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}/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' + /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' + /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": @@ -6391,7 +7806,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StopBatchOperationResponse' + $ref: '#/components/schemas/NotifyChannelResponse' default: description: Default error response content: @@ -8489,76 +9904,369 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DescribeWorkflowRuleResponse' + $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 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteWorkflowRuleResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows: + get: + tags: + - WorkflowService + 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: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListWorkflowExecutionsResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workflows/{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' + /namespaces/{namespace}/workflows/{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}/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' + /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' - delete: + /namespaces/{namespace}/workflows/{execution.business_id}/channels/{notification.channel}/notify: + post: tags: - WorkflowService - description: Delete rule by rule id - operationId: DeleteWorkflowRule + 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: ruleId + - name: execution.business_id in: path - description: ID of the rule to delete. Unique within the namespace. required: true schema: type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteWorkflowRuleResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workflows: - get: - tags: - - WorkflowService - description: ListWorkflowExecutions is a visibility API to list workflow executions in a specific namespace. - operationId: ListWorkflowExecutions - parameters: - - name: namespace + - name: notification.channel 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: - 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,68 @@ 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. + ChannelSubscriptionInfo: + type: object + properties: + channel: + type: string + description: Channel name. + kind: + enum: + - CHANNEL_KIND_UNSPECIFIED + - CHANNEL_KIND_INDEPENDENT + - CHANNEL_KIND_LINKED + type: string + description: |- + CHANNEL_KIND_INDEPENDENT for a channel the workflow subscribed to with a + SubscribeNotificationChannel command. CHANNEL_KIND_LINKED for a channel linked to this + workflow, which lists it once the channel holds any state. + format: enum + subscribedEventId: + type: string + description: |- + Independent kind: id of the WorkflowNotificationChannelSubscribed event that recorded the + subscription. Zero for the linked kind. + lastCounter: + type: string + description: Highest counter the workflow has accepted from the channel. Zero when none has arrived. + pendingNotification: + allOf: + - $ref: '#/components/schemas/Notification' + description: The notification held for the workflow's next Workflow Task, when one is pending. + scheduledCounter: + type: string + description: |- + Counter carried by the scheduled event of a Workflow Task that has not started yet. Zero + otherwise. + listenerCount: + type: integer + description: 'Linked kind: callback listeners registered on the channel.' + format: int32 + retainedCount: + type: integer + description: 'Linked kind: notifications retained for pollers.' + format: int32 + acceptedCount: + type: string + description: 'Linked kind: notifications the channel has accepted over its life.' + description: A workflow's standing on a notification channel, as reported by DescribeWorkflowExecution. ChildWorkflowExecutionCanceledEventAttributes: type: object properties: @@ -11867,6 +13637,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: @@ -12131,6 +13931,13 @@ components: $ref: '#/components/schemas/PendingNexusOperationInfo' workflowExtendedInfo: $ref: '#/components/schemas/WorkflowExecutionExtendedInfo' + channelSubscriptions: + type: array + items: + $ref: '#/components/schemas/ChannelSubscriptionInfo' + description: |- + The notification channels this run stands on: the independent channels it subscribed to and + the channels linked to it that hold any state. Empty when there are none. DescribeWorkflowRuleResponse: type: object properties: @@ -12878,6 +14685,10 @@ components: - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED + - EVENT_TYPE_WORKFLOW_STREAM_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_STREAM_RECORDS_APPENDED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_UNSUBSCRIBED type: string format: enum version: @@ -13043,6 +14854,14 @@ components: $ref: '#/components/schemas/WorkflowExecutionUnpausedEventAttributes' workflowExecutionTimeSkippingTransitionedEventAttributes: $ref: '#/components/schemas/WorkflowExecutionTimeSkippingTransitionedEventAttributes' + workflowStreamSubscribedEventAttributes: + $ref: '#/components/schemas/WorkflowStreamSubscribedEventAttributes' + workflowStreamRecordsAppendedEventAttributes: + $ref: '#/components/schemas/WorkflowStreamRecordsAppendedEventAttributes' + workflowNotificationChannelSubscribedEventAttributes: + $ref: '#/components/schemas/WorkflowNotificationChannelSubscribedEventAttributes' + workflowNotificationChannelUnsubscribedEventAttributes: + $ref: '#/components/schemas/WorkflowNotificationChannelUnsubscribedEventAttributes' description: |- History events are the method by which Temporal SDKs advance (or recreate) workflow state. See the `EventType` enum for more info about what each event is for. @@ -14240,6 +16059,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 +16583,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: @@ -14853,6 +16756,13 @@ components: 2. Try to assign the next poll to a group without any pending polls, 3. If every group has some pending polls, assign the next poll to a group randomly according to the weights. + streamSlices: + type: array + items: + $ref: '#/components/schemas/StreamSlice' + description: |- + Stream data attached to this task. Delivered out of band so the payloads + never enter History; only the offset ranges are recorded there. PollerGroupInfo: type: object properties: @@ -15249,6 +17159,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: @@ -15529,6 +17469,10 @@ components: - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED + - EVENT_TYPE_WORKFLOW_STREAM_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_STREAM_RECORDS_APPENDED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_UNSUBSCRIBED type: string description: The event type of the history event generated by the request. format: enum @@ -17680,6 +19624,124 @@ components: type: type: string description: The type of the driver, required. + StreamRange: + type: object + properties: + streamId: + type: string + description: |- + The stream, as the subscribing command addressed it: either the name of + a stream the consuming Workflow owns or the id of one in another + execution. + fromOffset: + type: string + description: |- + Inclusive. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + toOffset: + type: string + description: |- + Exclusive. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + description: |- + The offsets a Workflow Task consumed, without the payloads. Recorded on + WorkflowTaskCompleted so History grows with Workflow Tasks rather than with + records. + StreamRecord: + type: object + properties: + body: + allOf: + - $ref: '#/components/schemas/Payload' + description: |- + The value the producer published, stored as sent. + + A payload codec applies on the paths this API owns: the append command on + RespondWorkflowTaskCompleted, and the slices on PollWorkflowTaskQueue. + Records a producer writes or reads through the stream service take a + different path, whose messages are not part of this API yet and so are + outside what a codec-applying proxy walks. + metadata: + type: object + additionalProperties: + $ref: '#/components/schemas/Payload' + description: Producer-supplied provenance, stored as sent. + topic: + type: string + description: Producer-supplied grouping label, stored as sent. + kind: + enum: + - STREAM_RECORD_KIND_UNSPECIFIED + - STREAM_RECORD_KIND_DATA + - STREAM_RECORD_KIND_FINISH + type: string + description: How to read this record. Unspecified is read as DATA. + format: enum + producerId: + type: string + description: Who wrote the record. Empty when the owning Workflow did. + attempt: + type: string + description: |- + The producer's attempt. Readers treat a later attempt by the same + producer as superseding what the earlier one wrote. + sequence: + type: string + description: |- + The producer's position within its attempt, zero when it does not number + its records. Stored as sent; the server does not assign, validate or + order by it, and the stream's own offsets are what order a read. + description: |- + One entry in a stream. The record is the wire format: stores keep it + serialized as is and readers in every language decode the same bytes. + StreamSlice: + type: object + properties: + streamId: + type: string + description: |- + The stream, as the subscribing command addressed it: either the name of + a stream the consuming Workflow owns or the id of one in another + execution. + runId: + type: string + description: |- + Run id of the execution that owns the stream. Set on both a slice for the + task being started and a re-supplied one. + fromOffset: + type: string + description: |- + Inclusive. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + toOffset: + type: string + description: |- + Exclusive. Equal to from_offset when the subscription observed nothing, + which is a fact replay has to reproduce rather than an absence of one. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + records: + type: array + items: + $ref: '#/components/schemas/StreamRecord' + workflowTaskCompletedEventId: + type: string + description: |- + The WorkflowTaskCompleted event whose consumed_stream_ranges recorded + this range. Set only when the server is re-supplying a range for a task + being replayed; a slice for the task now being started leaves it unset, + because the event closing that task does not exist yet. + + Replay needs this because a Workflow Task response carries one slice set + while a cache miss replays every prior task, so the ranges have to be + matched to the events that recorded them rather than to the response. + description: |- + A contiguous range of a stream delivered to a Workflow Task, along with the + offsets it covers. The offsets are what History records; the records + themselves are never written to History. StructuredCalendarSpec: type: object properties: @@ -18366,6 +20428,9 @@ components: type: object properties: {} description: Response to a successful UnpauseWorkflowExecution request. + UnregisterChannelListenerResponse: + type: object + properties: {} UpdateActivityExecutionOptionsRequest: type: object properties: @@ -19830,6 +21895,10 @@ components: - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED + - EVENT_TYPE_WORKFLOW_STREAM_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_STREAM_RECORDS_APPENDED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_UNSUBSCRIBED type: string format: enum description: EventReference is a direct reference to a history event through the event ID. @@ -19901,6 +21970,10 @@ components: - EVENT_TYPE_WORKFLOW_EXECUTION_PAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED - EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED + - EVENT_TYPE_WORKFLOW_STREAM_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_STREAM_RECORDS_APPENDED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_SUBSCRIBED + - EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_UNSUBSCRIBED type: string format: enum description: RequestIdReference is a indirect reference to a history event through the request ID. @@ -20886,6 +22959,45 @@ 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. + WorkflowNotificationChannelSubscribedEventAttributes: + type: object + properties: + workflowTaskCompletedEventId: + type: string + description: |- + The WorkflowTaskCompleted event of the task whose command created this + subscription. + channel: + type: string + description: The channel the Workflow listens on for the rest of this run. + WorkflowNotificationChannelUnsubscribedEventAttributes: + type: object + properties: + workflowTaskCompletedEventId: + type: string + description: |- + The WorkflowTaskCompleted event of the task whose command ended this + subscription. + channel: + type: string + description: The channel the Workflow stopped listening on. + subscribedEventId: + type: string + description: |- + The WorkflowNotificationChannelSubscribed event that recorded the + subscription this command ended. Zero when the run held no subscription + for the channel. WorkflowPropertiesModifiedEventAttributes: type: object properties: @@ -21023,6 +23135,54 @@ components: * BETWEEN ... AND STARTS_WITH description: Activity trigger will be triggered when an activity is about to start. + WorkflowStreamRecordsAppendedEventAttributes: + type: object + properties: + workflowTaskCompletedEventId: + type: string + description: |- + The WorkflowTaskCompleted event of the task whose command appended this + batch. + streamId: + type: string + description: Name of the stream the Workflow appended to. + fromOffset: + type: string + description: |- + Inclusive. Same range vocabulary as StreamRange and StreamSlice, so a + reader does not have to remember which of the three counts and which + bounds. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + toOffset: + type: string + description: |- + Exclusive. With from_offset this names the range without carrying any of + it, which is what keeps this event a fixed size no matter how large the + batch or its payloads are. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + WorkflowStreamSubscribedEventAttributes: + type: object + properties: + workflowTaskCompletedEventId: + type: string + description: |- + The WorkflowTaskCompleted event of the task whose command created this + subscription. + streamId: + type: string + description: |- + The stream the Workflow subscribed to, as the command addressed it: + either the name of a stream this Workflow owns or the id of one in + another execution. + startOffset: + type: string + description: |- + The offset the subscription actually starts from. Resolved by the server + when the subscription is registered and recorded here, so replay reads + the resolved value rather than resolving it again against a stream that + has since moved. WorkflowTaskCompletedEventAttributes: type: object properties: @@ -21094,6 +23254,15 @@ components: description: |- The Worker Deployment Version that completed this task. Must be set if `versioning_behavior` is set. This value updates workflow execution's `versioning_info.deployment_version`. + consumedStreamRanges: + type: array + items: + $ref: '#/components/schemas/StreamRange' + description: |- + Offset ranges this Workflow Task consumed from streams it subscribes to. + Recorded on every task where a subscription is active, including when it + observed nothing: an empty range is a fact replay must reproduce, and + omitting it would let replay deliver records the Workflow did not have. WorkflowTaskCompletedMetadata: type: object properties: @@ -21201,6 +23370,11 @@ components: - WORKFLOW_TASK_FAILED_CAUSE_EXTERNAL_STORAGE_FAILURE - WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_PAUSE_REQUESTED_BEFORE_TASK_STARTED - WORKFLOW_TASK_FAILED_CAUSE_REQUEST_TOO_LARGE + - WORKFLOW_TASK_FAILED_CAUSE_BAD_APPEND_STREAM_RECORDS_ATTRIBUTES + - WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_STREAM_ATTRIBUTES + - WORKFLOW_TASK_FAILED_CAUSE_STREAM_RANGE_UNAVAILABLE + - WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES + - WORKFLOW_TASK_FAILED_CAUSE_BAD_UNSUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES type: string format: enum failure: @@ -21255,6 +23429,14 @@ components: type: integer description: Starting at 1, how many attempts there have been to complete this task format: int32 + notifications: + type: array + items: + $ref: '#/components/schemas/Notification' + description: |- + Notifications for channels this Workflow listens to, folded per channel + since the last task was scheduled. In History so a Workflow may act on + them deterministically and replay sees the same. WorkflowTaskStartedEventAttributes: type: object properties: diff --git a/temporal/api/command/v1/message.proto b/temporal/api/command/v1/message.proto index ee839115b..aadc8f89d 100644 --- a/temporal/api/command/v1/message.proto +++ b/temporal/api/command/v1/message.proto @@ -14,6 +14,7 @@ import "google/protobuf/duration.proto"; import "temporal/api/enums/v1/workflow.proto"; import "temporal/api/enums/v1/command_type.proto"; import "temporal/api/common/v1/message.proto"; +import "temporal/api/stream/v1/message.proto"; import "temporal/api/failure/v1/message.proto"; import "temporal/api/taskqueue/v1/message.proto"; import "temporal/api/workflow/v1/message.proto"; @@ -324,5 +325,68 @@ message Command { ScheduleNexusOperationCommandAttributes schedule_nexus_operation_command_attributes = 18; RequestCancelNexusOperationCommandAttributes request_cancel_nexus_operation_command_attributes = 19; + AppendStreamRecordsCommandAttributes append_stream_records_command_attributes = 20; + SubscribeStreamCommandAttributes subscribe_stream_command_attributes = 21; + SubscribeNotificationChannelCommandAttributes + subscribe_notification_channel_command_attributes = 22; + UnsubscribeNotificationChannelCommandAttributes + unsubscribe_notification_channel_command_attributes = 23; } } + +// Appends records to a stream the Workflow owns. Applied inside the Workflow +// Task's own commit. Produces one `WorkflowStreamRecordsAppended` event +// carrying the offset range and none of the payload; it schedules no further +// work. +message AppendStreamRecordsCommandAttributes { + // Name of a stream this Workflow owns, scoped to the Workflow. Created on + // first use. Empty means the Workflow's default output stream. A Workflow + // cannot append to a stream in another execution, so this is never the id + // of a standalone stream. + string stream_name = 1; + // Stored in order. The server sets `producer_id` to empty on each record, + // because the owning Workflow is the producer here. + repeated temporal.api.stream.v1.StreamRecord records = 2; +} + +// Subscribe this Workflow to a stream, so later Workflow Tasks carry the ranges +// it has not consumed yet. +// +// The stream's addressing is resolved by the server rather than supplied here. +// A Workflow cannot look it up without doing I/O, and a value it carried would +// be a reading rather than a fact, so it could differ on replay. +message SubscribeStreamCommandAttributes { + // Stream to consume, named either way round: a stream this Workflow owns + // by the name it appends under, a stream in another execution by its id. + // The server tries them in that order, so a Workflow that owns a stream + // under this name cannot reach a standalone stream with the same id. When + // neither exists the Workflow gets a stream of its own by that name, which + // is how a reader subscribes before the first record is written. + string stream_name_or_id = 1; + // Where to start, as an absolute offset. Read only when `start_position` + // is unset. A negative value is refused: the head of the stream is asked + // for with `start_position.tail`. + int64 start_offset = 2; + // Where to start. The server resolves it once, when it registers the + // subscription, and records the resolved absolute offset on the subscribed + // event, so replay does not resolve it again. Setting it together with a + // non-zero `start_offset` fails the command. + temporal.api.stream.v1.StreamStartPosition start_position = 3; +} + +// Makes the Workflow a listener of a notification channel for this run. The +// next notifications on the channel arrive on the scheduled event of a Workflow +// Task. The subscription ends with the run, and a successor subscribes again. +message SubscribeNotificationChannelCommandAttributes { + // The channel to listen on, as the writers name it. + string channel = 1; +} + +// Ends the run's subscription to a notification channel. Notifications already +// recorded on a scheduled event still reach that Workflow Task; later ones do +// not. A command naming a channel the run is not subscribed to records its +// event and changes nothing, so replay matches every command to an event. +message UnsubscribeNotificationChannelCommandAttributes { + // The channel to stop listening on, as the writers name it. + string channel = 1; +} diff --git a/temporal/api/enums/v1/command_type.proto b/temporal/api/enums/v1/command_type.proto index 067d95391..629a26528 100644 --- a/temporal/api/enums/v1/command_type.proto +++ b/temporal/api/enums/v1/command_type.proto @@ -29,4 +29,8 @@ enum CommandType { COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES = 16; COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION = 17; COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION = 18; + COMMAND_TYPE_APPEND_STREAM_RECORDS = 19; + COMMAND_TYPE_SUBSCRIBE_STREAM = 20; + COMMAND_TYPE_SUBSCRIBE_NOTIFICATION_CHANNEL = 21; + COMMAND_TYPE_UNSUBSCRIBE_NOTIFICATION_CHANNEL = 22; } diff --git a/temporal/api/enums/v1/event_type.proto b/temporal/api/enums/v1/event_type.proto index b879f51e8..815e1aebe 100644 --- a/temporal/api/enums/v1/event_type.proto +++ b/temporal/api/enums/v1/event_type.proto @@ -175,4 +175,19 @@ enum EventType { EVENT_TYPE_WORKFLOW_EXECUTION_UNPAUSED = 59; // An event that indicates time skipping advanced time or was disabled automatically after a bound was reached. EVENT_TYPE_WORKFLOW_EXECUTION_TIME_SKIPPING_TRANSITIONED = 60; + // A Workflow subscribed to a stream. Recorded once per subscription, not + // per record: the offsets a task consumed ride WorkflowTaskCompleted and + // the payloads never enter History at all. + EVENT_TYPE_WORKFLOW_STREAM_SUBSCRIBED = 61; + // A Workflow appended a batch of records to a stream. Recorded per + // batch, and carrying only the offset range it landed at: the bodies go to + // the stream's own log, never into History. + EVENT_TYPE_WORKFLOW_STREAM_RECORDS_APPENDED = 62; + // A Workflow became a listener of a notification channel for its run. + // The notifications themselves ride the WorkflowTaskScheduled event. + EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_SUBSCRIBED = 63; + // A Workflow stopped listening on a notification channel for its run. + // Recorded for every UnsubscribeNotificationChannel command, including one + // naming a channel the run was not subscribed to. + EVENT_TYPE_WORKFLOW_NOTIFICATION_CHANNEL_UNSUBSCRIBED = 64; } diff --git a/temporal/api/enums/v1/failed_cause.proto b/temporal/api/enums/v1/failed_cause.proto index f902aa9a1..9ff4c9a53 100644 --- a/temporal/api/enums/v1/failed_cause.proto +++ b/temporal/api/enums/v1/failed_cause.proto @@ -90,6 +90,19 @@ enum WorkflowTaskFailedCause { WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_PAUSE_REQUESTED_BEFORE_TASK_STARTED = 39; // A workflow task failed because the request exceeded a size limit. WORKFLOW_TASK_FAILED_CAUSE_REQUEST_TOO_LARGE = 40; + // A workflow task completed with an invalid AppendStreamRecords command. + WORKFLOW_TASK_FAILED_CAUSE_BAD_APPEND_STREAM_RECORDS_ATTRIBUTES = 41; + // A workflow task completed with an invalid SubscribeStream command. + WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_STREAM_ATTRIBUTES = 42; + // A workflow task could not be started because a stream range it consumed and recorded in + // History can no longer be served, for example after truncation or because it exceeds the + // replay bound. Check the workflow task failure message for more information. + WORKFLOW_TASK_FAILED_CAUSE_STREAM_RANGE_UNAVAILABLE = 43; + // A SubscribeNotificationChannel command named an empty or too-long channel, or hit a + // subscription or listener limit. + WORKFLOW_TASK_FAILED_CAUSE_BAD_SUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES = 44; + // An UnsubscribeNotificationChannel command named an empty or too-long channel. + WORKFLOW_TASK_FAILED_CAUSE_BAD_UNSUBSCRIBE_NOTIFICATION_CHANNEL_ATTRIBUTES = 45; } // Activity tasks can fail for various reasons. Note that some of these reasons can only originate diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index b40324d68..553683100 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -17,6 +17,8 @@ import "temporal/api/enums/v1/failed_cause.proto"; import "temporal/api/enums/v1/update.proto"; import "temporal/api/enums/v1/workflow.proto"; import "temporal/api/common/v1/message.proto"; +import "temporal/api/stream/v1/message.proto"; +import "temporal/api/notification/v1/message.proto"; import "temporal/api/deployment/v1/message.proto"; import "temporal/api/failure/v1/message.proto"; import "temporal/api/taskqueue/v1/message.proto"; @@ -302,6 +304,10 @@ message WorkflowTaskScheduledEventAttributes { google.protobuf.Duration start_to_close_timeout = 2; // Starting at 1, how many attempts there have been to complete this task int32 attempt = 3; + // Notifications for channels this Workflow listens to, folded per channel + // since the last task was scheduled. In History so a Workflow may act on + // them deterministically and replay sees the same. + repeated temporal.api.notification.v1.Notification notifications = 4; } message WorkflowTaskStartedEventAttributes { @@ -379,6 +385,16 @@ message WorkflowTaskCompletedEventAttributes { // The Worker Deployment Version that completed this task. Must be set if `versioning_behavior` // is set. This value updates workflow execution's `versioning_info.deployment_version`. temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 11; + + // Offset ranges this Workflow Task consumed from streams it subscribes to. + // Recorded on every task where a subscription is active, including when it + // observed nothing: an empty range is a fact replay must reproduce, and + // omitting it would let replay deliver records the Workflow did not have. + repeated temporal.api.stream.v1.StreamRange consumed_stream_ranges = 20; + + // Held for fields added on the main line, so a rebase does not land one of + // them on a number this fork already writes. + reserved 14 to 19; } message WorkflowTaskTimedOutEventAttributes { @@ -955,6 +971,61 @@ message ActivityPropertiesModifiedExternallyEventAttributes { temporal.api.common.v1.RetryPolicy new_retry_policy = 2; } +message WorkflowStreamSubscribedEventAttributes { + // The WorkflowTaskCompleted event of the task whose command created this + // subscription. + int64 workflow_task_completed_event_id = 1; + // The stream the Workflow subscribed to, as the command addressed it: + // either the name of a stream this Workflow owns or the id of one in + // another execution. + string stream_id = 2; + // The offset the subscription actually starts from. Resolved by the server + // when the subscription is registered and recorded here, so replay reads + // the resolved value rather than resolving it again against a stream that + // has since moved. + int64 start_offset = 3; +} + +message WorkflowNotificationChannelSubscribedEventAttributes { + // The WorkflowTaskCompleted event of the task whose command created this + // subscription. + int64 workflow_task_completed_event_id = 1; + // The channel the Workflow listens on for the rest of this run. + string channel = 2; +} + +message WorkflowNotificationChannelUnsubscribedEventAttributes { + // The WorkflowTaskCompleted event of the task whose command ended this + // subscription. + int64 workflow_task_completed_event_id = 1; + // The channel the Workflow stopped listening on. + string channel = 2; + // The WorkflowNotificationChannelSubscribed event that recorded the + // subscription this command ended. Zero when the run held no subscription + // for the channel. + int64 subscribed_event_id = 3; +} + +message WorkflowStreamRecordsAppendedEventAttributes { + // The WorkflowTaskCompleted event of the task whose command appended this + // batch. + int64 workflow_task_completed_event_id = 1; + // Name of the stream the Workflow appended to. + string stream_id = 2; + // Inclusive. Same range vocabulary as StreamRange and StreamSlice, so a + // reader does not have to remember which of the three counts and which + // bounds. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + int64 from_offset = 3; + // Exclusive. With from_offset this names the range without carrying any of + // it, which is what keeps this event a fixed size no matter how large the + // batch or its payloads are. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + int64 to_offset = 4; +} + message WorkflowExecutionUpdateAcceptedEventAttributes { // The instance ID of the update protocol that generated this event. string protocol_instance_id = 1; @@ -1278,6 +1349,12 @@ message HistoryEvent { WorkflowExecutionPausedEventAttributes workflow_execution_paused_event_attributes = 63; WorkflowExecutionUnpausedEventAttributes workflow_execution_unpaused_event_attributes = 64; WorkflowExecutionTimeSkippingTransitionedEventAttributes workflow_execution_time_skipping_transitioned_event_attributes = 65; + WorkflowStreamSubscribedEventAttributes workflow_stream_subscribed_event_attributes = 66; + WorkflowStreamRecordsAppendedEventAttributes workflow_stream_records_appended_event_attributes = 67; + WorkflowNotificationChannelSubscribedEventAttributes + workflow_notification_channel_subscribed_event_attributes = 68; + WorkflowNotificationChannelUnsubscribedEventAttributes + workflow_notification_channel_unsubscribed_event_attributes = 69; } } 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/stream/v1/message.proto b/temporal/api/stream/v1/message.proto new file mode 100644 index 000000000..e6a8fab2d --- /dev/null +++ b/temporal/api/stream/v1/message.proto @@ -0,0 +1,121 @@ +syntax = "proto3"; + +package temporal.api.stream.v1; + +option go_package = "go.temporal.io/api/stream/v1;stream"; +option java_package = "io.temporal.api.stream.v1"; +option java_multiple_files = true; +option java_outer_classname = "MessageProto"; +option ruby_package = "Temporalio::Api::Stream::V1"; +option csharp_namespace = "Temporalio.Api.Stream.V1"; + +import "temporal/api/common/v1/message.proto"; + +// One entry in a stream. The record is the wire format: stores keep it +// serialized as is and readers in every language decode the same bytes. +message StreamRecord { + // The value the producer published, stored as sent. + // + // A payload codec applies on the paths this API owns: the append command on + // RespondWorkflowTaskCompleted, and the slices on PollWorkflowTaskQueue. + // Records a producer writes or reads through the stream service take a + // different path, whose messages are not part of this API yet and so are + // outside what a codec-applying proxy walks. + temporal.api.common.v1.Payload body = 1; + // Producer-supplied provenance, stored as sent. + map metadata = 2; + // Producer-supplied grouping label, stored as sent. + string topic = 3; + // How to read this record. Unspecified is read as DATA. + StreamRecordKind kind = 4; + // Who wrote the record. Empty when the owning Workflow did. + string producer_id = 5; + // The producer's attempt. Readers treat a later attempt by the same + // producer as superseding what the earlier one wrote. + int64 attempt = 6; + // The producer's position within its attempt, zero when it does not number + // its records. Stored as sent; the server does not assign, validate or + // order by it, and the stream's own offsets are what order a read. + int64 sequence = 7; +} + +// A contiguous range of a stream delivered to a Workflow Task, along with the +// offsets it covers. The offsets are what History records; the records +// themselves are never written to History. +message StreamSlice { + // The stream, as the subscribing command addressed it: either the name of + // a stream the consuming Workflow owns or the id of one in another + // execution. + string stream_id = 1; + // Run id of the execution that owns the stream. Set on both a slice for the + // task being started and a re-supplied one. + string run_id = 2; + // Inclusive. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + int64 from_offset = 3; + // Exclusive. Equal to from_offset when the subscription observed nothing, + // which is a fact replay has to reproduce rather than an absence of one. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + int64 to_offset = 4; + repeated StreamRecord records = 5; + // The WorkflowTaskCompleted event whose consumed_stream_ranges recorded + // this range. Set only when the server is re-supplying a range for a task + // being replayed; a slice for the task now being started leaves it unset, + // because the event closing that task does not exist yet. + // + // Replay needs this because a Workflow Task response carries one slice set + // while a cache miss replays every prior task, so the ranges have to be + // matched to the events that recorded them rather than to the response. + int64 workflow_task_completed_event_id = 6; +} + +// The offsets a Workflow Task consumed, without the payloads. Recorded on +// WorkflowTaskCompleted so History grows with Workflow Tasks rather than with +// records. +message StreamRange { + // The stream, as the subscribing command addressed it: either the name of + // a stream the consuming Workflow owns or the id of one in another + // execution. + string stream_id = 1; + // Inclusive. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + int64 from_offset = 2; + // Exclusive. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: "from" and "to" name a half-open offset range. --) + int64 to_offset = 3; +} + +// Where a new subscription or read begins. The server resolves it against the +// stream as it stands in the same transaction that registers the reader, so +// the result does not race with appends or truncation, and records the +// resolved absolute offset. +message StreamStartPosition { + oneof position { + // Absolute and inclusive. Refused when below the stream's floor. + int64 offset = 1; + // The last N records the stream holds, or all of them when it holds + // fewer. Counts records of every kind. Must be positive. + int64 last_n = 2; + // The oldest record the stream still holds. Must be true. + bool earliest = 3; + // Only records appended after registration: the stream's head offset. + // Must be true. + bool tail = 4; + } +} + +// What a record means to a reader. Kept on the record itself so every store +// and every language reads it the same way without a private envelope. +enum StreamRecordKind { + // Read as DATA. + STREAM_RECORD_KIND_UNSPECIFIED = 0; + // A value the producer published; `body` carries it. + STREAM_RECORD_KIND_DATA = 1; + // The producer named by `producer_id` writes nothing more on `topic`. + // Says nothing about that producer's outcome and does not end the stream. + STREAM_RECORD_KIND_FINISH = 2; +} diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index cf763aa12..1cb3e5eba 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -21,6 +21,7 @@ import "temporal/api/enums/v1/workflow.proto"; import "temporal/api/common/v1/message.proto"; import "temporal/api/deployment/v1/message.proto"; import "temporal/api/failure/v1/message.proto"; +import "temporal/api/notification/v1/message.proto"; import "temporal/api/taskqueue/v1/message.proto"; import "temporal/api/sdk/v1/user_metadata.proto"; @@ -586,6 +587,32 @@ message NexusOperationCancellationInfo { string blocked_reason = 7; } +// A workflow's standing on a notification channel, as reported by DescribeWorkflowExecution. +message ChannelSubscriptionInfo { + // Channel name. + string channel = 1; + // CHANNEL_KIND_INDEPENDENT for a channel the workflow subscribed to with a + // SubscribeNotificationChannel command. CHANNEL_KIND_LINKED for a channel linked to this + // workflow, which lists it once the channel holds any state. + temporal.api.notification.v1.ChannelKind kind = 2; + // Independent kind: id of the WorkflowNotificationChannelSubscribed event that recorded the + // subscription. Zero for the linked kind. + int64 subscribed_event_id = 3; + // Highest counter the workflow has accepted from the channel. Zero when none has arrived. + int64 last_counter = 4; + // The notification held for the workflow's next Workflow Task, when one is pending. + temporal.api.notification.v1.Notification pending_notification = 5; + // Counter carried by the scheduled event of a Workflow Task that has not started yet. Zero + // otherwise. + int64 scheduled_counter = 6; + // Linked kind: callback listeners registered on the channel. + int32 listener_count = 7; + // Linked kind: notifications retained for pollers. + int32 retained_count = 8; + // Linked kind: notifications the channel has accepted over its life. + int64 accepted_count = 9; +} + message WorkflowExecutionOptions { // If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion. VersioningOverride versioning_override = 1; diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 1aae988d8..d69732a71 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -24,6 +24,8 @@ 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/stream/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"; @@ -384,6 +386,13 @@ message PollWorkflowTaskQueueResponse { // 3. If every group has some pending polls, assign the next poll to a group randomly // according to the weights. temporal.api.taskqueue.v1.PollerGroupsInfo poller_groups_info = 19; + + // Stream data attached to this task. Delivered out of band so the payloads + // never enter History; only the offset ranges are recorded there. + repeated temporal.api.stream.v1.StreamSlice stream_slices = 20; + + // Used once by a repeated field this fork has since removed. + reserved 21; } message RespondWorkflowTaskCompletedRequest { @@ -880,6 +889,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; @@ -1212,6 +1327,9 @@ message DescribeWorkflowExecutionResponse { repeated temporal.api.workflow.v1.CallbackInfo callbacks = 6; repeated temporal.api.workflow.v1.PendingNexusOperationInfo pending_nexus_operations = 7; temporal.api.workflow.v1.WorkflowExecutionExtendedInfo workflow_extended_info = 8; + // The notification channels this run stands on: the independent channels it subscribed to and + // the channels linked to it that hold any state. Empty when there are none. + repeated temporal.api.workflow.v1.ChannelSubscriptionInfo channel_subscriptions = 9; } // (-- api-linter: core::0203::optional=disabled diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 34f6a73f6..b2ec8a5e9 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -483,6 +483,142 @@ 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: "*" + } + }; + } + + // 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: "*" + } + }; + } + + // 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}" + } + }; + } + + // 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" + } + }; + } + + // 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}" + } + }; + } + // SignalWithStartWorkflowExecution is used to ensure a signal is sent to a workflow, even if // it isn't yet started. //