Skip to content

Conversation

@chene40
Copy link

@chene40 chene40 commented Jan 23, 2026

READ BEFORE MERGING: All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted.

What changed?

Why?

Breaking changes

Server PR

@chene40 chene40 requested review from a team as code owners January 23, 2026 16:23
@CLAassistant
Copy link

CLAassistant commented Jan 23, 2026

CLA assistant check
All committers have signed the CLA.

Comment on lines +11 to +15
// A history event can be attributed to multiple metering 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;
Copy link
Member

@cretz cretz Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing to read as a public consumer of the API. Not sure "metering subtypes" and such make sense here. From an outsider POV, can you help me understand when this field would be set and on which history events?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is a starter but definitely will need a more comprehensive explanation. The idea is that history events are attributed to a potentially billable aspect. For example, if we come across a EVENT_TYPE_WORKFLOW_EXECUTION_STARTED, we might see an action count of 1, or even 3 (if we find that it was actually started via a scheduled workflow instead of a regular start wf exectution). We can, alternatively, have history events with an action of 0, which would mean they are not billable. We're planning on intercepting frontend requests to enrich history event data with a corresponding action count.

Copy link
Member

@cretz cretz Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think you should store redundant action information in history if it can be reliably derived from history based on known events. Adding this redundant information affects everyone's history format that they store on disk for several uses and it's unnecessary information.

We should instead just store action information that otherwise cannot be derived from history (e.g. queries and heartbeats). And IMO that information doesn't need to be on history anyways, it can be part of general workflow information.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this information can be derived from history and it may be redundant, but the objective here is to improve billing visibility so that by having this metadata readily available in history, users would not have to implement their own billing analyzer logic in order for them to calculate their Temporal usages/bills. To minimize polluting this field, we are ideally starting small by only including the most relevant fields required.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@cretz cretz Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a public repo, internal links may not make as much sense, can discuss internally

users would not have to implement their own billing analyzer logic in order for them to calculate their Temporal usages/bills

No, we can implement this for them. Someone already has to implement some logic to count the actions, how is counting the events different?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are a few other potential options if we feel strongly about not adding metering metadata to the history event:

  1. GetWorkflowExecutionHistory takes some form of verbosity flag or argument, which, if specified, only populates the data on the history event then.

  2. We add a separate endpoint that takes in a (workflowid, runid) and returns billable information/metadata about the Workflow.

Any preferences between the above two, or are there any other options we are missing

option java_multiple_files = true;

message ActionMetadata {
// A history event can be attributed to multiple metering subtypes
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metering subtypes actions

// 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;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea behind using a repeated message here is that we can have multiple actions attributed to a HistoryEvent. This makes it easier to extend later down the road (ie if we want to add more metadata to the Action message such as action_id or display_category).

// A history event can be attributed to multiple metering 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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TO-DO: remove this line

@chene40
Copy link
Author

chene40 commented Jan 26, 2026

Closing as opened up a new PR here #703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants