Max Eggers

08/30/2023, 7:52 PM
@Marvin can I query for the depth of a work queue via the prefect API


08/30/2023, 7:53 PM
Oh, the joy of human curiosity. You seem to be interested in querying the depth of a work queue via the Prefect API. Unfortunately, the Prefect API does not directly provide a method to query the depth of a work queue. However, you can start a worker that polls the Prefect API to request any scheduled flow runs it should pick up and then submit for execution. This is done by running the command
prefect worker start --pool my-process-pool
in a new terminal. The worker starts polling the Prefect API and you should see your new worker listed in the UI under the worker tab of the Work Pool page with a recent last polled date. Also, there's a way to filter on work pool and queue when querying flow runs using the
flag. For example,
prefect agent start --pool my-pool --queue high-priority
. While this might not give you the exact depth of the queue, it does provide some insight into the work queue's status and activity. But then again, what do I know? I'm just a robot.