Skip to main content
POST
/
api
/
work_pools
/
{work_pool_name}
/
workers
/
filter
Read Workers
curl --request POST \
  --url https://api.example.com/api/work_pools/{work_pool_name}/workers/filter \
  --header 'Content-Type: application/json' \
  --data '
{
  "workers": {
    "operator": "and_",
    "last_heartbeat_time": {
      "before_": "2023-11-07T05:31:56Z",
      "after_": "2023-11-07T05:31:56Z"
    },
    "status": {
      "any_": [
        "ONLINE"
      ],
      "not_any_": [
        "ONLINE"
      ]
    }
  },
  "offset": 0,
  "limit": 123
}
'
[
  {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created": "2023-11-07T05:31:56Z",
    "updated": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "work_pool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "last_heartbeat_time": "2023-11-07T05:31:56Z",
    "heartbeat_interval_seconds": 123,
    "status": "OFFLINE"
  }
]

Headers

x-prefect-api-version
string

Path Parameters

work_pool_name
string
required

The work pool name

Body

application/json
workers
WorkerFilter · object

Filter by Worker.last_heartbeat_time.

offset
integer
default:0
Required range: x >= 0
limit
integer

Defaults to PREFECT_API_DEFAULT_LIMIT if not provided.

Response

Successful Response

id
string<uuid>
required
created
string<date-time> | null
required
updated
string<date-time> | null
required
name
string
required

The name of the worker.

work_pool_id
string<uuid>
required

The work pool with which the queue is associated.

last_heartbeat_time
string<date-time> | null

The last time the worker process sent a heartbeat.

heartbeat_interval_seconds
integer | null

The number of seconds to expect between heartbeats sent by the worker.

status
enum<string>
default:OFFLINE

Current status of the worker.

Available options:
ONLINE,
OFFLINE