What is Best Way to Limit a Workflow from Even Starting in Go and Python

There are the following four options for a Worker (in python):

  • max_concurrent_workflow_tasks
  • max_concurrent_workflow_task_polls
  • max_concurrent_activities
  • max_concurrent_activity_task_polls

what is the equivalent idea for “max_concurrent_workflows”? I have a worker with a GPU that can only run 1 ML task at any 1 time. I would like it to only run 1 workflow and any of its child workflows at any 1 time. What is the best way to achieve this?

Thanks for any help!

I would create a mutex workflow that manages that GPU. Before running anything at that GPU that workflow would need to grant the permission. See samples-go/mutex at main · temporalio/samples-go · GitHub