From 7b76cb61eb05ee6865eead79e0cf5cf231ec20de Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 23 Jan 2026 11:21:49 -0500 Subject: [PATCH 1/6] feat: actions metering metadata proto definition --- temporal/api/history/v1/message.proto | 3 +++ temporal/api/server/v1/message.proto | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 temporal/api/server/v1/message.proto diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 4243baab..4bb3693e 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -1115,6 +1115,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`. + + temporal.api.server.v1.ActionsMetering action_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..01c6d814 --- /dev/null +++ b/temporal/api/server/v1/message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package temporal.api.server.v1; + +message ActionsMetering { + // A history event can be attributed to multiple metering subtypes + // Ex: EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED is used for both + // grpc:SignalWorkflowExecution and grpc:SignalWithStartWorkflowExecution subtypes. + repeated Action actions = 1; +} + +message Action { + string id = 1; + int32 actionCount = 2; +} \ No newline at end of file From 0a9722e95b7567a521ac1fdc6bf3acd265a85562 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 23 Jan 2026 11:47:16 -0500 Subject: [PATCH 2/6] fix: resolve lint issues --- buf.lock | 13 ------------- temporal/api/history/v1/message.proto | 1 + temporal/api/server/v1/message.proto | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 buf.lock diff --git a/buf.lock b/buf.lock deleted file mode 100644 index fccbfb89..00000000 --- a/buf.lock +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 28151c0d0a1641bf938a7672c500e01d - digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de - - remote: buf.build - owner: grpc-ecosystem - repository: grpc-gateway - commit: 048ae6ff94ca4476b3225904b1078fad - digest: shake256:e5250bf2d999516c02206d757502b902e406f35c099d0e869dc3e4f923f6870fe0805a9974c27df0695462937eae90cd4d9db90bb9a03489412560baa74a87b6 diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 4bb3693e..986eac9e 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 { diff --git a/temporal/api/server/v1/message.proto b/temporal/api/server/v1/message.proto index 01c6d814..1661ac92 100644 --- a/temporal/api/server/v1/message.proto +++ b/temporal/api/server/v1/message.proto @@ -11,5 +11,5 @@ message ActionsMetering { message Action { string id = 1; - int32 actionCount = 2; + int32 action_count = 2; } \ No newline at end of file From 4333a2803443f86ce431f876e4820e21162283c6 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 23 Jan 2026 11:48:08 -0500 Subject: [PATCH 3/6] fix: restore buf.lock file --- buf.lock | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 buf.lock diff --git a/buf.lock b/buf.lock new file mode 100644 index 00000000..56d9b7fd --- /dev/null +++ b/buf.lock @@ -0,0 +1,13 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 28151c0d0a1641bf938a7672c500e01d + digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de + - remote: buf.build + owner: grpc-ecosystem + repository: grpc-gateway + commit: 048ae6ff94ca4476b3225904b1078fad + digest: shake256:e5250bf2d999516c02206d757502b902e406f35c099d0e869dc3e4f923f6870fe0805a9974c27df0695462937eae90cd4d9db90bb9a03489412560baa74a87b6 \ No newline at end of file From 43c6f36ea33bd0989f4f4d2461dcdcbbfdaa03ca Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 23 Jan 2026 12:33:49 -0500 Subject: [PATCH 4/6] fix: resolve make build errs --- buf.lock | 2 +- openapi/openapiv2.json | 29 +++++++++++++++++++++++++++ openapi/openapiv3.yaml | 23 +++++++++++++++++++++ temporal/api/history/v1/message.proto | 3 +-- temporal/api/server/v1/message.proto | 5 +++++ 5 files changed, 59 insertions(+), 3 deletions(-) diff --git a/buf.lock b/buf.lock index 56d9b7fd..fccbfb89 100644 --- a/buf.lock +++ b/buf.lock @@ -10,4 +10,4 @@ deps: owner: grpc-ecosystem repository: grpc-gateway commit: 048ae6ff94ca4476b3225904b1078fad - digest: shake256:e5250bf2d999516c02206d757502b902e406f35c099d0e869dc3e4f923f6870fe0805a9974c27df0695462937eae90cd4d9db90bb9a03489412560baa74a87b6 \ No newline at end of file + digest: shake256:e5250bf2d999516c02206d757502b902e406f35c099d0e869dc3e4f923f6870fe0805a9974c27df0695462937eae90cd4d9db90bb9a03489412560baa74a87b6 diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 4e83aaf2..6c25e4d8 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10045,6 +10045,31 @@ } } }, + "v1Action": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "actionCount": { + "type": "integer", + "format": "int32" + } + } + }, + "v1ActionsMetering": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Action" + }, + "description": "A history event can be attributed to multiple metering subtypes\nEx: EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED is used for both\ngrpc:SignalWorkflowExecution and grpc:SignalWithStartWorkflowExecution subtypes." + } + } + }, "v1ActivityExecutionInfo": { "type": "object", "properties": { @@ -12461,6 +12486,10 @@ }, "description": "Links associated with the event." }, + "actionMetadata": { + "$ref": "#/definitions/v1ActionsMetering", + "description": "Actions metering metadata for the event." + }, "workflowExecutionStartedEventAttributes": { "$ref": "#/definitions/v1WorkflowExecutionStartedEventAttributes" }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 84115cc6..5d343927 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7237,6 +7237,25 @@ paths: $ref: '#/components/schemas/Status' components: schemas: + Action: + type: object + properties: + id: + type: string + actionCount: + type: integer + format: int32 + ActionsMetering: + type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/Action' + description: |- + A history event can be attributed to multiple metering subtypes + Ex: EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED is used for both + grpc:SignalWorkflowExecution and grpc:SignalWithStartWorkflowExecution subtypes. ActivityExecutionInfo: type: object properties: @@ -9707,6 +9726,10 @@ components: items: $ref: '#/components/schemas/Link' description: Links associated with the event. + actionMetadata: + allOf: + - $ref: '#/components/schemas/ActionsMetering' + description: Actions metering metadata for the event. workflowExecutionStartedEventAttributes: $ref: '#/components/schemas/WorkflowExecutionStartedEventAttributes' workflowExecutionCompletedEventAttributes: diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 986eac9e..a675b013 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -1115,8 +1115,7 @@ message HistoryEvent { temporal.api.sdk.v1.UserMetadata user_metadata = 301; // 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.ActionsMetering action_metadata = 303; oneof attributes { diff --git a/temporal/api/server/v1/message.proto b/temporal/api/server/v1/message.proto index 1661ac92..5ad9c6a8 100644 --- a/temporal/api/server/v1/message.proto +++ b/temporal/api/server/v1/message.proto @@ -2,6 +2,11 @@ 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 ActionsMetering { // A history event can be attributed to multiple metering subtypes // Ex: EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED is used for both From 9f110738ca8054ecfce819b6764b72f010cd0c7d Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 23 Jan 2026 12:41:40 -0500 Subject: [PATCH 5/6] chore: only emit action count in Actions message --- openapi/openapiv2.json | 3 --- openapi/openapiv3.yaml | 2 -- temporal/api/server/v1/message.proto | 3 +-- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 6c25e4d8..0b959bf9 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10048,9 +10048,6 @@ "v1Action": { "type": "object", "properties": { - "id": { - "type": "string" - }, "actionCount": { "type": "integer", "format": "int32" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 5d343927..9aa4fc8a 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7240,8 +7240,6 @@ components: Action: type: object properties: - id: - type: string actionCount: type: integer format: int32 diff --git a/temporal/api/server/v1/message.proto b/temporal/api/server/v1/message.proto index 5ad9c6a8..43139b90 100644 --- a/temporal/api/server/v1/message.proto +++ b/temporal/api/server/v1/message.proto @@ -15,6 +15,5 @@ message ActionsMetering { } message Action { - string id = 1; - int32 action_count = 2; + int32 action_count = 1; } \ No newline at end of file From 355166e8bb8ea36a11e897a46467c99fee8c7bc9 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 23 Jan 2026 13:24:57 -0500 Subject: [PATCH 6/6] fix: update message name and comments --- openapi/openapiv2.json | 6 +++--- openapi/openapiv3.yaml | 9 +++++---- temporal/api/history/v1/message.proto | 2 +- temporal/api/server/v1/message.proto | 7 ++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 0b959bf9..8cac8643 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10054,7 +10054,7 @@ } } }, - "v1ActionsMetering": { + "v1ActionMetadata": { "type": "object", "properties": { "actions": { @@ -10063,7 +10063,7 @@ "type": "object", "$ref": "#/definitions/v1Action" }, - "description": "A history event can be attributed to multiple metering subtypes\nEx: EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED is used for both\ngrpc:SignalWorkflowExecution and grpc:SignalWithStartWorkflowExecution subtypes." + "title": "A history event can be attributed to multiple metering subtypes\nEx. EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, which is used by both Start\nWorkflow Execution and Scheduled Workflow Executions.\ngrpc:StartWorkflowExecution and grpc:StartWorkflowExecution.Scheduled.Adjusted" } } }, @@ -12484,7 +12484,7 @@ "description": "Links associated with the event." }, "actionMetadata": { - "$ref": "#/definitions/v1ActionsMetering", + "$ref": "#/definitions/v1ActionMetadata", "description": "Actions metering metadata for the event." }, "workflowExecutionStartedEventAttributes": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 9aa4fc8a..688942a4 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7243,7 +7243,7 @@ components: actionCount: type: integer format: int32 - ActionsMetering: + ActionMetadata: type: object properties: actions: @@ -7252,8 +7252,9 @@ components: $ref: '#/components/schemas/Action' description: |- A history event can be attributed to multiple metering subtypes - Ex: EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED is used for both - grpc:SignalWorkflowExecution and grpc:SignalWithStartWorkflowExecution subtypes. + Ex. EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, which is used by both Start + Workflow Execution and Scheduled Workflow Executions. + grpc:StartWorkflowExecution and grpc:StartWorkflowExecution.Scheduled.Adjusted ActivityExecutionInfo: type: object properties: @@ -9726,7 +9727,7 @@ components: description: Links associated with the event. actionMetadata: allOf: - - $ref: '#/components/schemas/ActionsMetering' + - $ref: '#/components/schemas/ActionMetadata' description: Actions metering metadata for the event. workflowExecutionStartedEventAttributes: $ref: '#/components/schemas/WorkflowExecutionStartedEventAttributes' diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index a675b013..646dfb6c 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -1116,7 +1116,7 @@ message HistoryEvent { // Links associated with the event. repeated temporal.api.common.v1.Link links = 302; // Actions metering metadata for the event. - temporal.api.server.v1.ActionsMetering action_metadata = 303; + temporal.api.server.v1.ActionMetadata action_metadata = 303; oneof attributes { WorkflowExecutionStartedEventAttributes workflow_execution_started_event_attributes = 6; diff --git a/temporal/api/server/v1/message.proto b/temporal/api/server/v1/message.proto index 43139b90..ceb0b106 100644 --- a/temporal/api/server/v1/message.proto +++ b/temporal/api/server/v1/message.proto @@ -7,10 +7,11 @@ option java_package = "io.temporal.api.server.v1"; option java_outer_classname = "MessageProto"; option java_multiple_files = true; -message ActionsMetering { +message ActionMetadata { // A history event can be attributed to multiple metering subtypes - // Ex: EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED is used for both - // grpc:SignalWorkflowExecution and grpc:SignalWithStartWorkflowExecution subtypes. + // Ex. EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, which is used by both Start + // Workflow Execution and Scheduled Workflow Executions. + // grpc:StartWorkflowExecution and grpc:StartWorkflowExecution.Scheduled.Adjusted repeated Action actions = 1; }