I can't find any info on the docs on how to create...
# ask-community
f
I can't find any info on the docs on how to create work pools via code, I'm currently using subprocesses to invoke a cli command in order to create the workers but this is not acceptable IMO. Any ideas?
n
hi @Farhood Etaati - have you considered using the client method for this?
Copy code
In [1]: from prefect.client.schemas.actions import WorkPoolCreate

In [2]: from prefect import get_client

In [3]: async with get_client() as client:
   ...:     await client.create_work_pool(work_pool=WorkPoolCreate(name="test"))
you can pass these things to
WorkPoolCreate
👍 1
🙌 2