> ## 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.

# Parables

> Plot results live at parables.{parable}.{plot}. Read them in SQL or over the Workspace API, and run, list, and cancel Report runs.

The **parables** pool holds the results of the Plots in your Workspace's
Parables. Each Plot is addressed by its Parable's slug and its own slug:

```
parables.{parable}.{plot}
```

```sql theme={null}
SELECT *
FROM parables.spend.tool_costs
LIMIT 10
```

Both slugs start with a lowercase letter and contain lowercase letters,
digits, and underscores. A new Plot's slug is the snake\_case form of its
handle, so `revenueForecast` becomes `revenue_forecast`. `workspace.parables`
lists each Parable's `slug`. Use the slug, not the handle, because a handle
can be renamed.

The pool serves the Plots of each Parable that is published and not
archived.

## Who can read a Plot

A role is not enough to read a Plot. You need all of these:

* **A role that reaches the Plot.** In SQL, the Data Access or Workspace
  Administrator role. Over the Workspace API, `tenant.parables.view`, which
  the Viewer, Integrator, Data Access, and Workspace Administrator roles
  hold.
* **A seat on the Parable.** Any seat works, Peeking included. A seat can be
  yours, your Workspace's, or one of your roles'. Without a seat, you cannot
  read the Parable's Plots.
* **The Parable Policies of the Plot's Pane** must let you view it.
* **Access to the sources that the Plot reads.** Provider Policies and source
  permissions still apply ([Rows you can read](https://developers.askparable.com/data.md#rows-you-can-read)).

## Stored results and views

A Plot reads one of two ways:

* **A Pipeline** is a Plot whose **Pipeline** switch is on. A Report run
  stores its output. In the app, a stored run is a **Refresh**.
  `parables.{parable}.{plot}` reads the newest completed Refresh that fits the
  published Plot. Until one completes, it is an empty table.
* **Every other Plot** whose SQL binds no parameters is a view. A read runs
  the Plot's published SQL as part of your query. One Plot can therefore
  build on another without waiting for a stored result.

A Plot can register its table before its first run completes. A run that
produces no rows leaves a table with a schema and zero rows. An empty result
is not a missing table. A completed run reaches `parables.{parable}.{plot}`
within moments.

### When Reports run

A Plot has no schedule of its own. Its Report runs it, in three ways:

* **On demand**, when someone with a Publishing or Primary seat runs it, in
  the app or [over the API](#run-a-report).
* **On a schedule**, from the Report plan: a recurrence of daily or less
  often, in the plan's time zone.
* **After its sources refresh.** The plan waits until the Provider streams and
  Platform Parables that its Pipelines read have been quiet for a time (30
  minutes by default, 5 minutes to 1 day). It runs no later than a set delay
  after the first change (4 hours by default, up to 7 days), and at most a set
  number of times a day (6 by default, 1 to 24).

A run's `trigger` says which of these started it: `manual`, `scheduled`, or
`sources`.

### How long Refreshes stay

For each Report, Parable keeps:

* The newest 30 completed Refreshes.
* Every Refresh that someone ran by hand in the last 90 days, even past 30.
* The newest 3 Previews, each for 7 days. Previews do not count toward the
  30\.
* Every failed or cancelled Refresh for 90 days after it ended. The newest
  failed Refresh stays however old it is, and so does the newest failed
  Preview. Failed and cancelled Refreshes do not count toward the 30.

Parable deletes the other Refreshes when the Report's next run completes, or
at the hourly check, whichever comes first.

### Stored results and your access

A Refresh stores its rows once, for everyone who opens it. A Refresh that read
every row of a Provider table cannot be cut down to the rows that you can
read. So when a Provider Policy or source permissions narrow a table that a
Refresh read, you cannot open that Refresh. The read fails with `403` and
`QL-TN-007`. Someone whom nothing narrows on those tables can open it. A Plot
that reads its tables live, as a view, is filtered for each reader instead.

### Read a past Refresh

A Report run reads every table at one moment, its AS OF time. Two errors come
from that:

| Code | Meaning |
| - | - |
| `QL-PL-005` | An input has no readable version at the AS OF time, for example because its history was cleaned up, or a pinned upstream result was deleted. Run the Report again. |
| `QL-PL-016` | A Report run cannot read a table that it can neither pin nor capture, such as `information_schema.tables`. A Report run reads Provider, Plot, Artifact, and Workspace tables, and the shared settings that the run captured. Remove the other table from the Plot's SQL. |

## Build on Plot results

Plots read Provider and Artifact tables. Other queries and Plots can then read
their results:

```sql theme={null}
SELECT
  cost.provider,
  cost.month,
  cost.amount
FROM parables.spend.tool_costs AS cost
WHERE cost.month >= DATE '2026-01-01'
ORDER BY cost.month DESC
```

Each Plot declares an output contract. Parable checks the values that your
query reads against that contract. The Plot's Parable Policies apply before
your query's own filters.

A Plot can also read:

* The other Plots of its own Parable.
* The rows saved on its own Parable's Panes, by the Pane's name.
* Pane data of a Platform Parable that it reads, as `<pane>_data`.
* `workspace.*` tables.
* The Plots of a Platform Parable, by the same address.

A Plot that names a Plot of any other Parable is refused.

### Rows saved on a Pane

A Pane can save rows of its own type, such as the categories that people edit
on it. Each row belongs to an actor: a person (**Me**), a group, the whole
Parable (**This Parable**), or the Parable's Default. A Plot reads these rows
by the Pane's name:

| Relation | What it returns |
| - | - |
| `parables.{parable}.{pane}` | One row for each item, with a column for each field of the Pane's type. Parable layers the rows for the reader field by field: their own row, then This Parable's, then the Default. A Report run layers This Parable and the Default only. |
| `parables.{parable}.{pane}_by_actor` | Each actor's own rows, with `actor_kind` (`person`, `group`, `workspace`, or `default`) and `actor_id`. Person rows come back only for the reader. |
| `parables.{parable}.{pane}_data` | The Pane's own data. |

```sql theme={null}
SELECT id, name, decision
FROM parables.ai_roi.categories
WHERE method = 'ponder'
```

A read is live: a Plot read again after a row changes sees the new value. A
Report run reads the rows as they were when it started, so a later change
never changes what the run showed. Other people's own rows never come back.

A Plot can read a Platform Parable's Pane data directly:

```sql theme={null}
SELECT id
FROM parables.perceptions.ontology_data
```

The editor, save check, Prepare and Publish list the same admitted data
relations. A Pane reference pins the source Release when your Parable
publishes. It creates no Plot dependency edge or graph vertex.

The reading definition chooses the Platform Parable's Release as it does for
Plot reads. The data comes from that Release on the Platform copy's line in
your Workspace. The Pane's current `view.data` Policies must admit you. Under
View as, they must admit the viewer too. A refused Pane, or a Platform copy
that is not Visible, has no readable relation. The refusal does not say
whether the table exists. This path exposes no Preference or subject rows.

Direct Platform Pane data reads run live. A Report cannot capture them yet.
The runtime planner refuses a bound direct read with `QL-PL-016`. For a
Report, publish a view Plot over the data in the Platform Parable. Then read
that Plot from the Report.

`workspace.preferences` returns the same rows as raw JSON, for a look in a SQL
tool. A Plot never reads it: Parable refuses to publish a Plot that does.

### Platform Parables

A Platform Parable is a Parable that Parable staff deploy to every Workspace.
A Workspace made later gets it too. When Parable staff turn Platform off, the
audience becomes the Workspaces that hold an open copy: a copy that reads a
Release, from a Pull it published or from a Delivery that was not cancelled or
superseded. Each of these Workspaces keeps its copy, and a Delivery on its way
there still finishes. A Workspace whose copy reads no Release leaves the
audience. A Workspace made after Platform off does not get the Parable. The
next Deploy chooses the Workspaces again.
It is the only kind of Parable whose Plots other Parables can read. Your SQL
names no Release of it. The read decides:

* A published Version of your Parable reads the Release of the Platform
  Parable that was newest when your Version was published. A later Release
  does not change what it reads. Publish your Parable again to read the
  newest Release.
* Your unpublished Changes read the newest Release.
* A Refresh of your Parable reads the Refresh of the Platform Parable that it
  recorded when it ran.

While a Platform Parable is not visible in your Workspace, its Plots read as
empty tables. A Plot that its Pane's Policies keep from you while the Platform
Parable is visible stays kept from you: a read that names it is refused.

## Read a Parable as a graph

Each Parable is also a graph. Its Plots are the vertices. A Plot that is
marked as an edge is an edge. Read the graph with `GRAPH_TABLE`, as the SQL/PGQ
standard writes it:

```sql theme={null}
SELECT reviewer, author, count(*) AS reviews
FROM GRAPH_TABLE (parables.engineering_delivery
  MATCH (r IS people)-[IS reviews]->(c IS code_changes)<-[IS authored]-(a IS people)
  WHERE r.email <> a.email
  COLUMNS (r.email AS reviewer, a.email AS author))
GROUP BY reviewer, author
```

The graph is the Plots of the Release, Refresh or draft that the query reads.
A Personal Parable reads its saved tree, with no published Version required.
A Plot read keeps that graph through planning and execution. It never replaces
it with the newest published graph. The save check uses the same graph facts.
A Plot is an edge when it has the mark `graphEdge` and each of its two ends
has a foreign key (`foreignKeys`), as
[Foreign keys and graph edges](https://docs.parable.work/ponder/parables/pieces/plots#foreign-keys-and-graph-edges)
says. An edge whose ends do not resolve, for example a key that names a Plot
that is gone, is left out of the graph, and a pattern that names it is
refused. A Plot view whose own SQL holds a `GRAPH_TABLE` reads the same graph.

The graph also holds each Plot whose joins Parable refuses: a Plot that has
no data yet in the Version or Changes that the query reads, and a Plot whose
table the catalog cannot build. Parable refuses a pattern whose joins would
read such a Plot, for the reason that it refuses the joins that name the
Plot: at an element without a label when one of its combinations of Plots
reaches such a Plot, and at a label that names one. Give the element labels
that name only other Plots.

The graph holds each Plot that you may not read too, because its Pane or
Page Policies refuse its output to your participation. A refusal never names
such a Plot, and never tells its columns, its foreign keys or its edge mark.
Such a Plot contributes no labels. A readable Plot can still declare the
same label. A label that a Plot you may not read also carries reads only
the Plots you may read. It does not refuse the query or report the hidden
Plot. A reader who may read that Plot gets its rows too. An element without
a label that can match it is refused, whatever property the element reads.
An edge without a label can match it between any two vertices, so
Parable refuses each edge without a label while the graph holds such a Plot.
A vertex without a label is refused unless a labeled edge next to it leads
only to Plots that you may read. Give each element labels that name only
Plots that you may read. The Plot editor holds such Plots in its graph too,
so it shows the refusal before you run the query. The save's check judges
the Parable for every person alike, so it reads every Plot as readable.

These rules hold for the Plots of another Parable that your SQL reads too.
They also hold for SQL that names no Parable, such as a Flight SQL statement,
which reads each Parable's published graph. Before your pattern reads that
graph, Parable asks, for each Plot of it, whether you may read the Plot. It
asks the same question that a read of the Plot asks. A Plot that you may not
read joins the graph with no columns, foreign keys or edge mark. The same
holds when Parable plans a Plot of yours, for the graph of each other
Parable that the Plot or one of its views reads. It holds for a Report run
too: a Preview or a Run you start reads each graph as you may read it, and a
scheduled Refresh reads it as the Workspace may.

A published `GRAPH_TABLE` reads the reader's graph too, wherever it runs: in
your own SQL, in a published view that your SQL reads, in a Report run and in
a Pane. Its rows follow what that reader may read, as the rows of a Plot that
a row Policy narrows do. For a Plot you may not read, you get the answer you
get for a Plot that does not exist, and no refusal names it.

A published view keeps the column types it declares, and so does a view in a
Preview of a set of Changes. A property that some
matched Plots lack is a NULL with the type of the first Plot of its element
that has the property. When your graph lacks that Plot, because you may not
read it or it has no data yet, and no other Plot types the NULL, the column
is a NULL of no type. It holds no value, so the view gives it the declared
type. Every other type difference refuses the read as "no longer returns its
declared columns", as in any view:

* A column whose type changed under the view, such as an `integer` where the
  view declares a `number`. This refusal is the same for every reader.
* A NULL that another Plot you may read types, when its type is not the
  declared one.
* A column whose Plots have different types, when your Plots combine to
  another type than all the Plots do. A `UNION` gives its column one type,
  which it takes from the types of its branches, in order. Your graph can
  lack some of those branches. A cast of your type to the declared one could
  then give values that the whole graph never gives, such as `5.0` where
  the whole graph gives `5`.

When the view's label names a Plot you may not read, the read is refused as
"Plot view … cannot be planned", with the words for a label that names no
Plot.

A pattern that no combination of Plots can match, such as
`(a IS people)-[IS reviews]->(b IS teams)` when no review joins people to
teams, reads no Plot. As in Postgres, it gives no rows, and its columns keep
their names and types. So it adds no Plot that your Plot depends on, and no
refused Plot refuses it. When such a path has a label, the editor and the
save check report `PV_REF_012`. This warning names the line and column of the
path. Check its labels and each edge's foreign keys. A matching combination
of Plots can still return no rows when its tables are empty. That case gets
no warning.

* **Labels.** A label is a Plot's slug or one of its `graphLabels`. `(r IS people)` matches the rows
  of `parables.engineering_delivery.people`. `IS people | teams` matches the
  rows with either label. Several Plots can carry the same label. The
  rewrite joins each matching Plot with its own foreign keys, then combines
  the rows with `UNION ALL`. A Plot that matches several labels in one
  disjunction contributes its rows once per direction, not once per label.
  For example, `people` with `graphLabels: ["actors"]` answers to both
  `people` and `actors`. These are two names for one vertex, not two vertices.
  A vertex without a label matches each Plot that is not
  an edge. An edge without a label matches each edge whose ends fit. A Pane
  that SQL reads by name, such as `parables.engineering_delivery.filters`, is
  not a Plot. No element matches its rows. Its slug is a label only if a
  Plot declares it. The editor, save, publish and every read apply the same graph.
* **A Plot's own pattern.** A `GRAPH_TABLE` in the SQL of a Plot never
  matches that Plot. It reads the graph as if the Plot were not in it, so it
  also matches no edge to the Plot. A label that names only that Plot is
  refused. A shared label still matches the other Plots that carry it.
  A view `names` with
  `MATCH (n) COLUMNS (n.name AS name)` gives the names of the other node
  Plots. Every other query still matches `names` as a node. So a Plot never
  reads itself through a pattern. The editor, save, publish and every read
  apply the same rule.
* **`IS` and `:`.** `(r IS people)` and `(r:people)` are the same.
* **Properties.** A property is an output column of the Plot. `r.email` reads
  the column `email`. When only some of the Plots that an element matches have
  the column, the value is NULL in the rows of the others. That NULL has
  exactly the type that the column has in the first Plot of the element, in
  slug order, that has it: a `DECIMAL(18,4)` stays `DECIMAL(18,4)`, text
  stays text in the same encoding, a time keeps its unit, a timestamp keeps
  its unit and its time zone, and a list stays a list. When the Plots that
  have the column give it one type, the column keeps that type, wherever the
  rows of the others come. When they give it different types, such as an
  integer in one and a number in another, the column has the type that a
  `UNION ALL` of them gives, as the same joins written by hand do. When no
  Plot that has the column can match the pattern, or no Plot can match it at
  all, the column has the type of that first Plot. Some types have no NULL
  of exactly that type: a list or an object whose items or fields carry a
  scalar, an object field name that holds a double quote or a backslash, and
  a list item name that holds a single quote. Such a Plot is passed over for
  the NULL's type. When no other Plot gives one, the NULL has no type: the
  `UNION ALL` gives it the type of the Plots that match, and a pattern that
  none of them can match is refused at publish as a column of no type.
  When no Plot has the property, Parable refuses the query. Write each
  property with its variable. Parable refuses a name alone, such as `email`, because Postgres reads it as
  a column of a table outside the `GRAPH_TABLE`.
* **Edges.** An edge is a Plot that is marked as an edge, with one key column
  for each end. Each key column holds the key of a Plot of the same Parable.
  `(a)-[e]->(b)` joins `e` to `a` by its `from` key and to `b` by its `to` key.
  `<-` is the other direction. `-` matches both directions.
  An edge's `graphEdge.reverseLabel` names the same rows from `to` to `from`.
  For example, an Employee Of edge from People to Companies with the reverse
  label `employs` matches `(b IS companies)-[IS employs]->(a IS people)`.
  This gives the same pairs as `(a IS people)-[IS employee_of]->(b IS companies)`.
  A pattern without a label does not count the reverse label as another edge. As in Postgres,
  the `-` and the `>` of a right arrow may stand apart, as in `]- >`.
  A left edge ends at `<-[e]-`. A `>` after it is a syntax error at that `>`.
  Each match of `a`, `e` and `b` is one row, also when `e` fits both directions, as an edge
  from a row to the same row does.
* **Variables.** A variable that you write twice is one row: `(a)->(b)->(a)`
  finds the pairs that point at each other. An edge variable that you write
  twice is one edge, so each of its edge patterns must point the same way and
  join the same source and the same destination: `(a)-[f]->(a)-[f]->(a)`
  finds the edges from a row to itself. As Postgres does, Parable refuses
  `(a)-[f]->(b)<-[f]-(a)` and `(a)-[f]->(c)-[f]->(a)`. When you write labels
  for a variable in two places, write the same labels in the same order:
  Postgres and Parable refuse `(a IS x | y)->(b)->(a IS y | x)`. A `WHERE`
  inside an element names only its own variable. Compare two elements in the
  `WHERE` after the path.
* **Columns.** Each entry of `COLUMNS` is an expression and an optional
  `AS` name. A property without a name keeps the name of its column. Any
  other entry needs a name, as in Postgres: Parable refuses
  `COLUMNS (p.id + 1)` and accepts `COLUMNS (p.id + 1 AS next)`. Two
  entries can have the same name, as in Postgres. The columns of a result
  must have different names, so a repeated name gets the first free suffix
  `_1`, `_2`, and so on: `COLUMNS (a.id, b.id)` gives the columns `id` and
  `id_1`. Aggregate and set-returning functions are refused inside the graph
  pattern. Apply them to the rows of the `GRAPH_TABLE`, as `count(*)` does
  above.

Parable turns each `GRAPH_TABLE` into the joins that you would write, before
it checks or plans the SQL. So Policies, pins, and the Plots that a Plot
depends on are the same as for those joins. An error in the SQL around the
`GRAPH_TABLE` gives the line and the column in your SQL, in a query, a
Preview and a Refresh.

`GRAPH_TABLE` can also read the graph of another Parable, as
`parables.<other_parable>`, where your SQL can read that Parable's Plots. SQL
in a Plot can read the Plots of a Platform Parable that you may read, and no
other Parable's. When you may not read the other Parable, Parable refuses the
`GRAPH_TABLE` as it refuses the joins. The refusal gives the line and the
column of the Parable's name in your SQL. It is the refusal of a Parable that
does not exist, so it tells nothing of the other Parable's Plots, their
columns or their edges. A Refresh reads the other Parable's
graph at the Release of it that your Release pinned, also when your pattern
matches none of its Plots.

### Paths of any depth

Put a hop count after an edge to walk a hierarchy:

```sql theme={null}
SELECT child, parent
FROM GRAPH_TABLE (parables.perceptions
  MATCH (t IS teams)-[IS part_of]->{1,32}(o IS teams)
  COLUMNS (t.parable_id AS child, o.parable_id AS parent)
)
```

`->+` means `->{1,32}`. `{n}` asks for exactly `n` hops.
`{min,max}` asks for any count in that range. Each bound must be a whole
number from 1 through 32. Reverse and either-direction edges take the same
hop counts. A quantified edge can follow or precede a fixed edge.

A quantified edge must reference the same vertex Plot and key column at both
ends. For example, both foreign keys of `part_of` can reference
`teams.parable_id`. Several edge labels can share the walk when their ends
reference that same Plot and key. A walk can mix those labels at each hop.
An either-direction walk can change direction at each hop.

Parable uses a recursive join, not one fixed join per hop. It keeps each
`(start, end, depth)` state once. The depth cap stops cycles in the data.
The result holds each endpoint pair once, even when several routes reach it.
A cycle can reach its own start. A missing intermediate vertex breaks the
walk. Vertex labels and vertex conditions apply to the written endpoints,
not to intermediate vertices.

Your access applies at every hop, including intermediate vertices and edges.
A vertex or an edge that your access hides also breaks the walk.
The result does not show that a hidden route exists.

Either-direction walks over large hierarchies can cost more than directed
walks. A walk can return along an edge, so even a tree can reach the full
depth cap. Cycles can also reach the cap. Parable keeps states at each depth,
and each recursive step can read the edge and vertex Plots again.
Use a smaller bound, such as `-[IS part_of]-{1,4}`, when four hops are enough.
The query's memory budget and timeout still apply.

An edge condition such as `[e IS part_of WHERE e.active]` applies at every
hop. It can name only that edge variable. The variable does not name one
edge row, so the path `WHERE` and `COLUMNS` cannot read its properties.
Read the endpoint properties there instead.

`GRAPH_TABLE` reads one path pattern. Parable refuses:

* A `GRAPH_TABLE` anywhere but where a table stands: after `FROM` or `JOIN`,
  after a comma between tables, or inside parentheses around a join, as in
  `FROM (GRAPH_TABLE (...) g JOIN teams t ON g.team_id = t.id)`. Postgres's
  grammar has it only there, and without `LATERAL`. So Parable refuses
  `FROM (GRAPH_TABLE (...))`.
* A quantified vertex, zero hops, `*`, an open range, or a bound above 32.
* A quantified edge between different vertex Plots or different key columns.
  Write fixed edges for those steps.
* A path of more than 15 edge patterns. A quantified edge counts as one
  pattern, not one pattern per hop. Fixed joins become slower to plan as
  the path grows.
* Two paths in one `MATCH`. Join two `GRAPH_TABLE`s.
* A star, such as `*` or `r.*`. Name each property.
* A subquery or another `GRAPH_TABLE` inside a `GRAPH_TABLE`, as Postgres
  refuses it, with or without parentheses around it. Use the subquery outside
  the `GRAPH_TABLE`, on its rows.
* More than one expression in a `WHERE` or a `COLUMNS` item, as in Postgres's
  grammar. Write each column's name after `AS`: `COLUMNS (p.email AS mail)`.
* A column of a table outside the `GRAPH_TABLE` that Parable cannot plan.
  A quantified pattern cannot read an outside table. Join that table to the
  result instead.
  As Postgres does, Parable reads `t.id` in
  `FROM teams t, GRAPH_TABLE (... (p IS people WHERE p.team_id = t.id) ...)`
  when the table comes before the `GRAPH_TABLE` in its `FROM`, after a comma
  or an inner, left or cross `JOIN`, only a `WHERE` reads it, and the
  pattern matches one combination of Plots. The `WHERE` names the table as
  the `FROM` does: by its alias, or else by the last part of its name. An
  alias with a list of column names also names the table, including an alias
  after `WITH ORDINALITY`. After
  `FROM teams AS t(tid, tname)`, the `WHERE` reads `t.tid`. Each table of
  a join in parentheses without an alias keeps its name. After
  `FROM (teams t JOIN code_changes c ON TRUE)`, the `WHERE` reads `t.id`.
  With an alias, as in `(...) AS j`, only the alias names the join, so the
  `WHERE` refuses `t.id`. A word that names no table, such as `system` in
  `TABLESAMPLE system (10)`, is refused. Inside parentheses around a join,
  the `WHERE` also reads tables before the parentheses in the same `FROM`.
  A subquery such as `(TABLE teams)` exposes its alias only, when it has one.
  Parable refuses the column in `COLUMNS`, in a pattern of more combinations,
  after a `RIGHT` or `FULL` `JOIN`, and from the query around a subquery that
  holds the `GRAPH_TABLE`. Then join the table to the rows of the `GRAPH_TABLE`
  outside it: put `p.team_id AS team_id` in `COLUMNS`, and compare
  `g.team_id = t.id` in the `WHERE` of the query.
* A pattern whose elements can match a Plot that you may not read, or whose
  joins would read a Plot that has no data yet or that the catalog cannot
  serve. Add labels that name only other Plots.
* A pattern that can match more than 64 combinations of Plots, or whose
  search tries more than 4,096 partial combinations beyond one for each
  element. Add labels to its elements.
* A statement whose `GRAPH_TABLE`s together join more Plots than one
  `GRAPH_TABLE` at both limits can: 64 combinations of 31 elements, 1,984
  joined Plots. A quantified edge also counts its recursive source reads.
  Add labels, or split the statement.

There is no statement that makes a graph. The graph is the Parable's Plots.

## AI functions in Plots

A Plot can call the [AI functions](https://developers.askparable.com/data/ai.md), such as `ponder()` and
`embed()`. A Pipeline that selects `embed(...)` keeps the vectors in its own
table, with the model that wrote them. Parable makes no separate vector
table.

## Read Plot data over the Workspace API

You can read a Plot without SQL. Each operation names the Parable by its
`rootRefId`, which is the `root_ref_id` column of `workspace.parables`. A
Parable token or an MCP token works. An MCP token works only while the
Workspace allows external agents
([SQL over HTTP](https://developers.askparable.com/data/sql-over-http.md#before-you-start)).

| Operation | What it does |
| - | - |
| `POST /api/parable/authoring/primaries/{rootRefId}/plots/data` | Returns a page of a Plot's rows, under the Policies in force. |
| `GET /api/parable/authoring/primaries/{rootRefId}/plots/data/manifest` | Lists the Plot outputs and the columns each one has. |
| `GET /api/parable/authoring/primaries/{rootRefId}/plots/data/types` | Returns TypeScript declarations of the Plot outputs, for code that reads them. |

Each takes an optional `versionId` query parameter to read a published
Version, or `refId` to read a ref. Send one of them at most.

```bash theme={null}
curl -X POST "$PARABLE_API_URL/api/parable/authoring/primaries/$ROOT_REF_ID/plots/data" \
  -H "Authorization: Bearer $PARABLE_API_TOKEN" \
  -H "X-Tenant: $PARABLE_WORKSPACE" \
  -H "Content-Type: application/json" \
  -d '{
    "reading": { "kind": "CURRENT", "reportRunId": null },
    "plot": "tool_costs",
    "plotKey": null,
    "columns": ["provider", "month", "amount"],
    "sort": [{ "column": "month", "dir": "desc" }],
    "pageSize": 500,
    "cursor": null
  }'
```

Name the Plot by its slug in `plot`, or by its key in `plotKey`. `reading`
selects **Latest** (`CURRENT`) or one stored Refresh (`REPORT_RUN`, with its
`reportRunId`). The response has `columns`, `rows`, and `nextCursor`. Send
`nextCursor` back as `cursor` to read the next page. `meta` says what was
read: the reading, whether it came from a stored Refresh, the contract, and
the Version.

An agent that connects through the Parable MCP server can also list the
published Plots of the Workspace and read their SQL. See
[MCP tools](https://developers.askparable.com/mcp/tools.md).

### Name the Platform Parable Release and Refresh

A Plot data read can name, for each Platform Parable that it reads, the
Release and the Refresh it must read, in two headers:

```http theme={null}
x-parable-releases: <Parable ID>:<Version ID>, ...
x-parable-refreshes: <Parable ID>:<Refresh ID or latest>, ...
```

A named Release must be the one the read reads. The answer repeats both
headers with what was actually read. A header that does not parse, names a
Parable twice, names more than 64 Parables, or names a Parable or a Release
that the read does not read fails with `400` and `PA-AU-058`.

## Run and manage Reports over the Workspace API

These operations need a Parable token. The API refuses an MCP token for them
with `403` and `WA-PAT-005`.

| Operation | What it does | Who can call it |
| - | - | - |
| `POST /api/parable/authoring/primaries/{rootRefId}/actions/plot` | Runs a Report: starts a Refresh, or a Preview on a sample. | `tenant.parables.manage` and a Publishing or Primary seat |
| `GET /api/parable/authoring/primaries/{rootRefId}/report-runs` | Lists Refreshes, newest first, 25 a page by default and 50 at most. | `tenant.parables.view` and a seat |
| `POST /api/parables/authoring/primaries/{rootRefId}/report-runs/{reportRunId}/actions/cancel` | Cancels a run that has not finished. | `tenant.parables.manage` and a Publishing or Primary seat |
| `POST /api/parables/authoring/primaries/{rootRefId}/report-runs/{reportRunId}/plots/{plotKey}/actions/raise-budget` | Raises the call, cost, or time budget of a Plot that its budget paused, for this run only. | `tenant.parables.runs.budget.override` and the Primary seat |

The run and cancel paths start differently: `/api/parable/` and
`/api/parables/`. Use each path as shown.

### Run a Report

```bash theme={null}
curl -X POST "$PARABLE_API_URL/api/parable/authoring/primaries/$ROOT_REF_ID/actions/plot" \
  -H "Authorization: Bearer $PARABLE_API_TOKEN" \
  -H "X-Tenant: $PARABLE_WORKSPACE" \
  -H "Content-Type: application/json" \
  -d "{
    \"idempotencyKey\": \"$(uuidgen | tr 'A-Z' 'a-z')\",
    \"reportKey\": null,
    \"preview\": false,
    \"proposalId\": null,
    \"force\": false
  }"
```

The response is the run, with its `id`, `status`, `trigger`, and the result of
each Plot. Send the same `idempotencyKey` again to get the same run back. Read
the run's progress from the run list.

To raise a paused Plot's budget, send at least one of `maxExternalCalls`,
`maxCost` (in the smallest unit of the currency), and `maxRuntime` (in
milliseconds). Each new cap must be above the current cap and above what the
run already used.

### Errors

| Code | Status | Meaning |
| - | - | - |
| `PA-AU-001` | `404` | The Parable, Version, Plot, or run was not found, or you have no seat on the Parable. |
| `PA-AU-005` | `400` or `409` | The action does not fit the run's state. For example, the Report is not enabled, a run is already in flight, the run already finished, or the Plot is not paused by its budget. |
| `PA-AU-006` | `400` | The `idempotencyKey` was used before for a different request. |
| `PA-AU-007` | `409` | The Parable or its Deployment is Pocketed. |
| `PA-AU-019` | `403` | Your permissions or your seat do not allow the action. |
| `PA-AU-058` | `400` | An `x-parable-releases` or `x-parable-refreshes` header is not valid for this read. |
| `QL-TN-007` | `403` | A Provider Policy or source permissions keep rows of the Refresh from you. |

Use the [catalog](https://developers.askparable.com/data.md#the-catalog) to confirm a Plot's columns and its
latest completed run before you depend on a result.
[Query the pools](https://developers.askparable.com/data.md#query-the-pools) has the Flight SQL clients for each
language.
[Reports](https://docs.parable.work/ponder/parables/pieces/reports) and
[Plots](https://docs.parable.work/ponder/parables/pieces/plots) explain how to
build them in the app.


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