Skip to content

Add CountWorkers API#729

Open
rkannan82 wants to merge 5 commits into
mainfrom
kannan/count-workers
Open

Add CountWorkers API#729
rkannan82 wants to merge 5 commits into
mainfrom
kannan/count-workers

Conversation

@rkannan82
Copy link
Copy Markdown
Contributor

@rkannan82 rkannan82 commented Mar 11, 2026

What

Add CountWorkers RPC to WorkflowService for counting workers matching a query filter.

  • Request: namespace + query + include_system_workers (same filter fields as ListWorkers)
  • Response: int64 count
  • HTTP route: GET /namespaces/{namespace}/worker-count

Server PR

Why

The worker UI needs to display a total worker count (e.g. in tabs) without fetching the full list. Follows the established pattern used by CountWorkflowExecutions, CountSchedules, and CountActivityExecutions.

How did you test it?

  • built (make ci-build)
  • passes buf linting and breaking change checks
  • regenerated OpenAPI specs

Add CountWorkers RPC for counting workers matching a query filter.
Follows the same pattern as CountWorkflowExecutions, CountSchedules,
and CountActivityExecutions.

Made-with: Cursor
Comment thread temporal/api/workflowservice/v1/request_response.proto Outdated
Comment thread openapi/openapiv2.json Outdated
rkannan82 and others added 4 commits June 4, 2026 15:09
The worker registry counts workers via an in-memory scan, unlike
Elasticsearch-backed CountWorkflowExecutions which can return
approximate counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts:
#	openapi/openapiv2.json
#	openapi/openapiv3.yaml
Matches the same field in ListWorkersRequest so count and list
behave consistently for system workers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 requested review from ShahabT and Sushisource June 4, 2026 22:34
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.

4 participants