diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 4e83aaf2..5f67625c 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10045,6 +10045,28 @@ } } }, + "v1Action": { + "type": "object", + "properties": { + "actionCount": { + "type": "integer", + "format": "int32" + } + } + }, + "v1ActionMetadata": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Action" + }, + "description": "A history event can be attributed to multiple actions\nEx. EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, which is used by both Start\nWorkflow and Scheduled Workflow actions." + } + } + }, "v1ActivityExecutionInfo": { "type": "object", "properties": { @@ -12461,6 +12483,10 @@ }, "description": "Links associated with the event." }, + "serverMetadata": { + "$ref": "#/definitions/v1ServerMetadata", + "description": "The event details. The type must match that in `event_type`.\nActions metering metadata for the event." + }, "workflowExecutionStartedEventAttributes": { "$ref": "#/definitions/v1WorkflowExecutionStartedEventAttributes" }, @@ -14989,6 +15015,18 @@ } } }, + "v1ServerMetadata": { + "type": "object", + "properties": { + "actionMetadata": { + "$ref": "#/definitions/v1ActionMetadata" + }, + "eventSize": { + "type": "integer", + "format": "int32" + } + } + }, "v1SetCurrentDeploymentResponse": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 84115cc6..73004e75 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7237,6 +7237,23 @@ paths: $ref: '#/components/schemas/Status' components: schemas: + Action: + type: object + properties: + actionCount: + type: integer + format: int32 + ActionMetadata: + type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/Action' + description: |- + A history event can be attributed to multiple actions + Ex. EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, which is used by both Start + Workflow and Scheduled Workflow actions. ActivityExecutionInfo: type: object properties: @@ -9707,6 +9724,12 @@ components: items: $ref: '#/components/schemas/Link' description: Links associated with the event. + serverMetadata: + allOf: + - $ref: '#/components/schemas/ServerMetadata' + description: |- + The event details. The type must match that in `event_type`. + Actions metering metadata for the event. workflowExecutionStartedEventAttributes: $ref: '#/components/schemas/WorkflowExecutionStartedEventAttributes' workflowExecutionCompletedEventAttributes: @@ -12612,6 +12635,14 @@ components: properties: nonRetryable: type: boolean + ServerMetadata: + type: object + properties: + actionMetadata: + $ref: '#/components/schemas/ActionMetadata' + eventSize: + type: integer + format: int32 SetCurrentDeploymentRequest: type: object properties: diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 4243baab..b3f504c3 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -24,6 +24,7 @@ import "temporal/api/update/v1/message.proto"; import "temporal/api/workflow/v1/message.proto"; import "temporal/api/sdk/v1/task_complete_metadata.proto"; import "temporal/api/sdk/v1/user_metadata.proto"; +import "temporal/api/server/v1/message.proto"; // Always the first event in workflow history message WorkflowExecutionStartedEventAttributes { @@ -1115,6 +1116,9 @@ message HistoryEvent { // Links associated with the event. repeated temporal.api.common.v1.Link links = 302; // The event details. The type must match that in `event_type`. + // Actions metering metadata for the event. + temporal.api.server.v1.ServerMetadata server_metadata = 303; + oneof attributes { WorkflowExecutionStartedEventAttributes workflow_execution_started_event_attributes = 6; WorkflowExecutionCompletedEventAttributes workflow_execution_completed_event_attributes = 7; diff --git a/temporal/api/server/v1/message.proto b/temporal/api/server/v1/message.proto new file mode 100644 index 00000000..036ac9c6 --- /dev/null +++ b/temporal/api/server/v1/message.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package temporal.api.server.v1; + +option go_package = "go.temporal.io/api/server/v1;server"; +option java_package = "io.temporal.api.server.v1"; +option java_outer_classname = "MessageProto"; +option java_multiple_files = true; + +message ActionMetadata { + // A history event can be attributed to multiple actions + // Ex. EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, which is used by both Start + // Workflow and Scheduled Workflow actions. + repeated Action actions = 1; +} + +message Action { + int32 action_count = 1; +} + +message ServerMetadata { + ActionMetadata action_metadata = 1; + int32 event_size = 2; +} \ No newline at end of file