Skip to content

Commit 97ca6e4

Browse files
authored
Add group by support to count API (#303)
1 parent 5f21c72 commit 97ca6e4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,21 @@ message CountWorkflowExecutionsRequest {
781781
}
782782

783783
message CountWorkflowExecutionsResponse {
784+
// If `query` is not grouping by any field, the count is an approximate number
785+
// of workflows that matches the query.
786+
// If `query` is grouping by a field, the count is simply the sum of the counts
787+
// of the groups returned in the response. This number can be smaller than the
788+
// total number of workflows matching the query.
784789
int64 count = 1;
790+
791+
// `groups` contains the groups if the request is grouping by a field.
792+
// The list might not be complete, and the counts of each group is approximate.
793+
repeated AggregationGroup groups = 2;
794+
795+
message AggregationGroup {
796+
repeated temporal.api.common.v1.Payload group_values = 1;
797+
int64 count = 2;
798+
}
785799
}
786800

787801
message GetSearchAttributesRequest {

0 commit comments

Comments
 (0)