# `PgFlowDashboard.Queries.Workers`
[🔗](https://github.com/agoodway/pgflow/blob/v0.1.0/lib/pgflow_dashboard/queries/workers.ex#L1)

Database queries for worker-related data.

# `count_workers`

```elixir
@spec count_workers(
  module(),
  keyword()
) :: integer()
```

Counts workers matching the given filters.

## Options

  * `:flow_slug` - Filter by flow slug
  * `:health_status` - Filter by health (healthy, stale, dead)

# `get_adjacent_worker`

```elixir
@spec get_adjacent_worker(module(), String.t(), :next | :prev) ::
  {:ok, String.t()} | {:error, :not_found}
```

Gets the adjacent worker (next or previous by last_heartbeat_at).

Direction can be :next or :prev.
Returns {:ok, worker_id} or {:error, :not_found}.

# `get_worker`

```elixir
@spec get_worker(module(), String.t()) :: {:ok, map()} | {:error, :not_found | term()}
```

Gets a single worker with details.

# `list_worker_tasks`

```elixir
@spec list_worker_tasks(module(), String.t(), keyword()) :: [map()]
```

Lists tasks processed by a specific worker.

# `list_workers`

```elixir
@spec list_workers(
  module(),
  keyword()
) :: [map()]
```

Lists workers with load information.

## Options

  * `:flow_slug` - Filter by flow slug
  * `:health_status` - Filter by health (healthy, stale, dead)
  * `:limit` - Maximum number of workers to return
  * `:cursor` - Worker ID to start after for pagination

---

*Consult [api-reference.md](api-reference.md) for complete listing*
