docs/v3/api-ref/python/prefect-server-api-work_queues.mdx
prefect.server.api.work_queuesRoutes for interacting with work queue objects.
create_work_queue <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L38" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>create_work_queue(work_queue: schemas.actions.WorkQueueCreate, db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.responses.WorkQueueResponse
Creates a new work queue.
If a work queue with the same name already exists, an error will be raised.
For more information, see https://docs.prefect.io/v3/concepts/work-pools#work-queues.
update_work_queue <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L72" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>update_work_queue(work_queue: schemas.actions.WorkQueueUpdate, work_queue_id: UUID = Path(..., description='The work queue id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface)) -> None
Updates an existing work queue.
read_work_queue_by_name <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L94" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_work_queue_by_name(name: str = Path(..., description='The work queue name'), db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.responses.WorkQueueResponse
Get a work queue by id.
read_work_queue <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L122" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_work_queue(work_queue_id: UUID = Path(..., description='The work queue id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.responses.WorkQueueResponse
Get a work queue by id.
read_work_queue_runs <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L150" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_work_queue_runs(docket: dependencies.Docket, work_queue_id: UUID = Path(..., description='The work queue id', alias='id'), limit: int = dependencies.LimitBody(), scheduled_before: DateTime = Body(None, description='Only flow runs scheduled to start before this time will be returned.'), x_prefect_ui: Optional[bool] = Header(default=False, description='A header to indicate this request came from the Prefect UI.'), db: PrefectDBInterface = Depends(provide_database_interface)) -> List[schemas.responses.FlowRunResponse]
Get flow runs from the work queue.
read_work_queues <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L203" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_work_queues(limit: int = dependencies.LimitBody(), offset: int = Body(0, ge=0), work_queues: Optional[schemas.filters.WorkQueueFilter] = None, db: PrefectDBInterface = Depends(provide_database_interface)) -> List[schemas.responses.WorkQueueResponse]
Query for work queues.
delete_work_queue <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L234" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>delete_work_queue(work_queue_id: UUID = Path(..., description='The work queue id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface)) -> None
Delete a work queue by id.
read_work_queue_concurrency_status <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L252" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_work_queue_concurrency_status(work_queue_id: UUID = Path(..., description='The work queue id', alias='id'), page: int = Body(1, ge=1), limit: int = dependencies.LimitBody(), db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.responses.WorkQueueConcurrencyStatus
Read concurrency status for a work queue, including paginated flow run summaries. active_slots always reflects the total count.
read_work_queue_status <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/api/work_queues.py#L320" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_work_queue_status(work_queue_id: UUID = Path(..., description='The work queue id', alias='id'), db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.core.WorkQueueStatusDetail
Get the status of a work queue.