> ## Documentation Index
> Fetch the complete documentation index at: https://developers.askparable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspace

> Live Workspace metadata lives at workspace.{table}.

The **workspace** pool is a live view of your Workspace's members, roles,
Providers, Parables, Plot runs, and settings:

```
workspace.{table}
```

Reads see the Workspace as it is at query time. Every table except
`workspace.preferences` can trail a change by about a second. A Provider
connected a moment ago can take that long to appear. To query this pool, you
need the Data Access or Workspace Administrator role.

Secrets, API tokens, sessions, and credential material are never in this
pool.

## Tables

| Table | Contents |
| - | - |
| `workspace.users` | Workspace members: user ID, membership ID, email, name, title, membership status, joined-at, time zone, and locale. Every status is served, `REVOKED` included. Filter on `status` for current members. |
| `workspace.providers` | Connected Providers, one row per connection: the name the Workspace gave it, the Provider's slug (`connector_slug`) and name, connection status, whether it has ever synced, and whether its setup was finished. It also names the connection's vendor grouping and vendor, the grouping's release stage, the lifecycle of its Provider definition, whether its ingestion schedule runs (`schedule_enabled`), and when its newest successful sync ended (`last_successful_sync_at`). Disabled connections are served too. |
| `workspace.connector_priorities` | The Providers the Workspace is asked to connect: one row per vendor grouping marked `required` or `suggested`, connected or not. `grouping_id` joins `workspace.providers.grouping_id`. |
| `workspace.provider_connections` | The streams of each connection: name, kind, whether it is enabled and since when. `provider_id` joins `workspace.providers.id`. |
| `workspace.stream_data` | Streams whose data has reached the Provider pool, with the time of the newest load (`last_data_at`). |
| `workspace.provider_refusals` | The parent records that the Provider refused to read, one row per refused parent per sync attempt: the connection, the stream, the parent, the HTTP status, the error code, the category, the Provider's reason, and when the sync started. |
| `workspace.stream_coverage` | Which days of each stream landed, for every day since the stream was enabled: whether each day is covered, the cause of a gap, whether the day's data reached the Provider pool, and when the row was computed. |
| `workspace.{connector}_ingestion_config` | The non-secret sync settings of each connection of that Provider. |
| `workspace.{connector}_authentication_config` | The non-secret authentication settings of each connection of that Provider. |
| `workspace.parent_data_filters` | The parent records that a sync is limited to, one row per allowed value. |
| `workspace.roles` | Roles that at least one member holds. Role names are display values and can change. |
| `workspace.role_permissions` | The permission strings granted directly to each role. |
| `workspace.user_roles` | Which members hold which roles. |
| `workspace.parables` | The Parables that the Workspace takes part in, with each Parable's `slug`. |
| `workspace.query_runs` | Plot run history and spend. |
| `workspace.preferences` | The rows saved on the selected Parable's Panes that you can read, as raw JSON: your own (**Me**), and the shared ones (a group's, **This Parable**'s, and the Default) when the Pane's Policy lets you read them. Use it to look at saved values in a SQL tool. A Plot reads a Pane's rows by the Pane's name instead ([Parables](https://developers.askparable.com/data/parables.md#rows-saved-on-a-pane)). |

IDs are served in base62 form, such as `YQJpYwUwvbaLOwTUr4thA`. An ID that you
type into a comparison matches in base62 or hyphenated form.

[Workspace Pool](https://docs.parable.work/protocols/sql/data-catalog/workspace-pool)
lists every column of every table.

## List active Providers

Every connection is a row, disabled ones included. "Active" is a filter that
you write:

```sql theme={null}
SELECT id, name, connector_slug, connection_status, has_ever_synced
FROM workspace.providers
WHERE disabled_at IS NULL
  AND (connection_status IS DISTINCT FROM 'disabled')
ORDER BY connector_slug, name
```

Keep the parentheses around `IS DISTINCT FROM`. The SQL parser reads
everything after `IS DISTINCT FROM` as its right side, so
`connection_status IS DISTINCT FROM 'disabled' AND setup_finished` compares
`connection_status` with `'disabled' AND setup_finished`, and the query is
refused with QL-PL-019.

Add `AND setup_finished` to leave out a setup that was started and never
finished. Once its status is recomputed, a pull connection that never saved a
credential reads `config_invalid` and counts as set up, so it shows as needing
attention (PARABLE-9399).

`connector_slug` is the `{connector}` of `providers.{connector}.{table}` in
catalog form: lowercase, with each run of other characters written as one
`_`. The `claude-otel` Provider is `providers.claude_otel`.

## Read Provider settings

Each connected Provider gets its settings as tables, one row per connection.
`tenant_connector_id` names the connection and joins `workspace.providers.id`.
Column names follow the Provider's settings, lowercased. When the Provider's
settings change shape, the table changes with them.

For Google Workspace, `workspace.google_ingestion_config` has `domain` and
`adminemail`. `workspace.google_authentication_config` has non-secret fields
such as `clientemail` and `projectid`. A field that the Provider marks secret,
such as a private key, is never a column. A list of objects in the settings
becomes a child table named `{table}__{field}`, joined on `parent_pk` and
`ordinal`.

`workspace.parent_data_filters` has one row per allowed value, with
`connector_slug`, `parent_tap`, `field`, `operator`, `value`, and `threshold`.
Which Google users is the sync limited to?

```sql theme={null}
SELECT f.parent_tap, f.field, f.value
FROM workspace.parent_data_filters AS f
WHERE f.connector_slug = 'google'
  AND f.operator = 'any_of'
ORDER BY f.value
```

## Members and roles

Roles are defined once for the platform, not for each Workspace.
`workspace.roles` lists the roles that at least one member holds. Join on the
role `id`, never on its name, because an administrator can rename a role.

Who holds each role:

```sql theme={null}
SELECT
  u.email,
  u.status,
  r.name AS role,
  ur.assigned_at
FROM workspace.user_roles AS ur
JOIN workspace.users AS u
  ON u.id = ur.user_id
JOIN workspace.roles AS r
  ON r.id = ur.role_id
ORDER BY u.email, r.name
```

Assignments are served for every membership status. Filter on
`u.status = 'ACTIVE'` to see who can act today.

A permission is a dotted path, and a grant covers every path below it. A role
granted `tenant` can do everything under `tenant.`, such as
`tenant.users.manage`. `workspace.role_permissions` lists direct grants only.
It does not expand the hierarchy, and it does not include what a role inherits
from its parent role. Which roles cover one permission:

```sql theme={null}
SELECT DISTINCT r.name AS role
FROM workspace.roles AS r
JOIN workspace.role_permissions AS rp
  ON rp.role_id = r.id
WHERE rp.permission = 'tenant.users.manage'
  OR starts_with('tenant.users.manage', rp.permission || '.')
ORDER BY r.name
```

## Plot run history and spend

`workspace.query_runs` has one row for each run of a Plot. `spent_cost` is
what its `ponder()` and `embed()` calls cost, in US cents. `spent_calls` is
how many calls it made. What each Parable spent in the last 30 days:

```sql theme={null}
SELECT
  p.slug AS parable,
  count(*) AS runs,
  sum(CASE WHEN r.status = 'FAILED' THEN 1 ELSE 0 END) AS failed,
  sum(r.spent_cost) AS spent_cents,
  sum(r.spent_calls) AS model_calls
FROM workspace.query_runs AS r
JOIN workspace.parables AS p ON p.id = r.parable_id
WHERE r.created_at >= now() - INTERVAL '30 days'
GROUP BY p.slug
ORDER BY spent_cents DESC
```

`workspace.parables` lists only the Parables that the Workspace takes part
in. This join therefore leaves out the runs of a Parable that a person built
and did not share. `workspace.query_runs` itself lists every run in the
Workspace. A run's SQL is never served.

## Keep a scan small

One scan of a `workspace.*` table reads at most 50,000 rows. A scan that
would read more fails with `RESOURCE_EXHAUSTED`. `workspace.query_runs` keeps
every run, so a large Workspace can pass that limit.

Parable applies these filters in the database, before it counts rows:

* `=` on text, integer, boolean, ID, and timestamp columns.
* `IN` on text, integer, and ID columns, with up to 1,000 values.
* `IS NULL` and `IS NOT NULL` on every column.
* `<>`, `IS DISTINCT FROM`, and `NOT IN` on ID columns.
* `<`, `<=`, `>`, and `>=` on timestamp columns.

The 30-day window in the example above is such a filter, so the query reads
only the runs of the last 30 days. Other filters, such as `spent_cost > 100`
or `status LIKE 'FAIL%'`, apply after the read and do not make it smaller.
Combine them with a filter from the list.

## Which parents a sync could not read

A sync of a child stream reads each parent record, such as each repository of
a GitHub organization. When the Provider refuses one parent, the sync still
completes. `workspace.provider_refusals` has one row for each refused parent
of each sync attempt. A retry adds its own rows, so a refusal that a later
retry cleared still counts:

```sql theme={null}
SELECT
  provider.name AS provider,
  refusal.platform_tap_name AS stream,
  refusal.parent,
  refusal.http_status,
  refusal.error_code,
  refusal.provider_reason,
  refusal.run_started_at
FROM workspace.provider_refusals AS refusal
JOIN workspace.providers AS provider ON provider.id = refusal.provider_id
ORDER BY refusal.run_started_at DESC
LIMIT 100
```

To count refusals by status, use `GROUP BY refusal.http_status`.

## Which days of a stream landed

`workspace.stream_coverage` has one row for each stream and each of the last
7 full UTC days. A day is covered when the stream's loads span it from
midnight to midnight UTC. `gap_cause` says why a day is not covered:
`no_seal` (nothing loaded the day) or `partial_seal` (loads touched the day
but did not span it). `reached_pool` says whether the day's data is in the
Provider pool:

```sql theme={null}
SELECT stream.name AS stream, coverage.day, coverage.gap_cause
FROM workspace.stream_coverage AS coverage
JOIN workspace.provider_connections AS stream ON stream.id = coverage.stream_id
WHERE NOT coverage.covered
ORDER BY stream.name, coverage.day
```

## Join live metadata to Provider data

`workspace.users.email` and Provider columns with the `Contact.Email` semantic
type hold compatible values. Members and their Google Workspace directory
rows:

```sql theme={null}
SELECT
  u.email,
  u.name,
  gu.orgunitpath,
  gu.isadmin,
  gu.suspended
FROM workspace.users AS u
LEFT JOIN providers.google.users AS gu
  ON gu.primaryemail = u.email
WHERE u.status = 'ACTIVE'
```

Workspace rows are live at query time. Provider rows change when their stream
syncs. See [providers](https://developers.askparable.com/data/providers.md) for more joins, and
[Query the pools](https://developers.askparable.com/data.md#query-the-pools) for the Flight SQL clients for each
language.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.