Query List of Connected Activity/Workflow Workers in Temporal

Hi!

Is there a way for a client to query Temporal for connected activity or workflow workers within the same namespace? In different namespaces?

Thanks!

Not exactly. There is an advanced API my_client.worker_service.describe_task_queue(temporalio.api.workflowservice.v1.DescribeTaskQueueRequest(... but it is low level and it is eventually consistent (i.e. some pollers on the result may no longer be polling). Usually there are other approaches to these problems. Can you describe your use case?

Hi!

One use case would be to check if a workflow name is correct or available. There could be a service that checks for deployed workflow workers/workflows so that an invalid workflow name can be rejected even before the workflow is started. In the same light, the same service can also be queried by users so that the user can see what workflows they can trigger.

Thanks!

While not yet implemented in Python, Temporal supports dynamic workflows (i.e. catch-all workflows that aren’t tied to any name). And some SDKs support registering workflows on a worker after the worker has started. And technically, especially during a rolling deployment, different workers on the same task queue may have different workflows.

There is currently no mechanism to obtain known workflows for a task queue or worker, and any such mechanism couldn’t be 100% accurate anyways. It is recommended that you maintain your known workflow list in code your own preferred way. You can use tests and either class references or constant string names to ensure your known set.

1 Like