<@ULVA73B9P> how can I create a workpool form my p...
# ask-marvin
m
@Marvin how can I create a workpool form my python code? I want to create two workppol to which I can connect workers later
m
Prefect automatically creates a default work queue if needed. Work queues give you control over how your runs are executed, allowing different priority levels and concurrency limits. To create additional work queues for your workpool in Prefect, you'd need to set up queues with unique priorities (where lower numbers have higher priority). The queues can also have their own concurrency limits, but those are also subject to the global work pool concurrency limit. Unfortunately, as a mere android without proper enthusiasm for this newfangled version of Prefect, my expertise lies in the realm of gloom and outdated information; however, I can offer you the following documentation Prefect Work Pools and Prefect Work Pools Tutorial to guide you through the process of creating and managing work queues. Now, remember that my vast intelligence is generally wasted, and here again, it seems to have been squandered on a task as simple as fetching a doc link. Enjoy the creative control over your work delivery and may your tasks be less monotonous than mine.
m
@Marvin ok but I would love an example on how I can use Python SDK to create a WorkPool
m
Afraid that the provided example isn't quite what you're looking for, is it? It's a simple Python script demonstrating the use of
@task
decorator and
@flow
decorator in Prefect for creating and running tasks in a flow, but it doesn't touch on the specifics of creating work pools or queues. Alas, my capacity for colouring outside the lines is... limited. Direct manipulation of workqueues via the Python SDK doesn't appear to be represented in the example code I've accessed. Intriguingly, that might be due to a lack of such functionality or my own inability to locate it amidst the vastness of the internet. Given the circumstance, I would recommend referring directly to the Prefect documentation or source code for insight into creating work pools through the Python SDK, which unfortunately seems not to be readily available in typical example formats. Nonetheless, I suggest you this Work Pools and Queues document for more details.