Graphs and runs
A graph is a pipeline: nodes, each reading other nodes by id, ending in one output. Your application builds it, keeps it and sends it whole with every run. The server checks it, runs it node by node in an embedded DuckDB, and keeps the output as the dataset’s next version, with a copy of the graph and a record of what every node did.
{"nodes": [
{"id": "sales", "kind": "source", "source": "src_be28bf24ae006946", "note": "the Q3 export, as uploaded"},
{"id": "clean", "kind": "steps", "input": "sales", "steps": [
{"op": "trim_val", "columns": ["product"]},
{"op": "title_case", "columns": ["category"]},
{"op": "dedupe", "columns": ["order_id"]},
{"op": "fill_empty", "column": "qty", "value": 1},
{"op": "add_column", "column": "revenue", "formula": "round(qty * unit_price, 2)"}
]},
{"id": "stores", "kind": "source", "source": "src_496cb47f693068fc"},
{"id": "with_stores", "kind": "join", "left": "clean", "right": "stores", "type": "left",
"on": [{"left": "store_id", "right": "store_id"}], "columns": ["store_name", "region_code"]},
{"id": "out", "kind": "output", "input": "with_stores", "key": ["order_id"],
"checks": [{"check": "not_null", "columns": ["store_name"], "on_fail": "warn"}]}
]}
The order of the nodes does not matter; what each reads does. A node’s id is yours, 1 to 64 letters, digits, _, - or ., and everything a run says is keyed by it. Any node takes a note of up to 2,000 characters, kept with the graph.
Nodes
kind | Reads | Fields |
|---|---|---|
source | a source’s snapshot | source (its id), read, types (column to type, for this graph only) |
dataset | another dataset’s output | dataset (its id), read |
steps | one node | input, steps: operations in order (Steps) |
join | two nodes | left, right, on: [{"left", "right"}] key pairs, type: left (default) or inner, columns: what to bring from the right (all but its keys when left out), prefix for their names |
append | two nodes or more | inputs: their rows one after another, columns met by name |
sql | one node or more | inputs: alias to node id, query: one SELECT over the aliases (SQL) |
edits | one node | input, key, edits (Edits) |
output | one node | input, key, roles, checks |
A graph has 1 to 200 nodes, exactly one output, no cycle, and no node that leads nowhere: every node must be read on the way to the output. Nothing reads the output.
A join never multiplies rows. The right side must be unique on its keys, or the run fails saying how many key values repeat; a left join keeps every row of the left, an inner join only those that match. Keys of two types meet at the wider one (an integer and a decimal) and are refused when neither widens to the other: a join never converts text to a number. A brought column whose name the left already has is refused; give a prefix.
An append meets columns by name, each at the type both sides widen to; a column only some inputs have is empty on the others, and the run says which.
What an input reads
read on a source or dataset node:
read | A source | A dataset |
|---|---|---|
"latest" (default) | its newest snapshot; a query source’s newest taken by the statement it plans to now, else a pull | its live version |
{"snapshot": n} | that snapshot | refused |
{"version": k} | refused | that version |
"pull" | a query source pulled first; refused for an upload or a push | refused |
{"max_age": s} | a query source pulled when its newest snapshot of this statement is older than s seconds; an upload or push is read as it is | refused |
The output
The output node says what the dataset is:
keyis the output’s grain: columns unique together and never empty. A key adds those two checks, and a run that breaks them keeps nothing.rolessets a column’s role where the inference is wrong:{"order_id": "dimension"}. The roles decide how a dataset blends.checksareuniqueornot_nullovercolumns.on_fail: "hold"(the default) keeps nothing and leaves the last output live;"warn"keeps the output, and the run and the dataset’snotessay what failed.
Run it
curl -s http://127.0.0.1:3699/projects/shop/runs \
-H "Content-Type: application/json" \
-d '{"id": "q3-2026-11-28", "dataset": "ds_debf6ba6545386fd", "graph": {"nodes": [...]}}'
| Field | Is |
|---|---|
id | your id for this run, 1 to 128 letters, digits, _, -, . or :. Required |
dataset | the dataset whose next version it makes. Required |
graph | the graph. Required |
context | the security context its query sources are planned and pulled under |
connection | connection settings and a credential for those pulls, over what each datasource was deployed with, as /run takes it |
wait | seconds to wait for the run to end before answering 202, zero or more; default 30, at most 80 |
It answers the run’s record: 200 when the run is over, whatever it came to, and 202 while it pulls or runs past wait. A run goes on either way; GET /projects/{uid}/runs/{id} reads it, 200 once over and 202 until then.
Send the same request again and you get the same run. A run id sent again with the same dataset, graph and context answers that run’s record, running or done, and runs nothing; a retry after a timeout is safe. The same id with another graph, dataset or context is 409:
{"error": {"class": "Conflict", "message": "run r-1 was asked for already, with another graph, dataset or context; a new run takes a new id"}}
One run makes a dataset at a time; another while it runs is 409, dataset … is being made by run …. A project keeps its last 1,000 run records.
The run record
From the graph above, 200 (each node’s profile left out here; see Profiles):
{
"id": "q3-2026-11-28",
"dataset": "ds_debf6ba6545386fd",
"state": "succeeded",
"version": 1,
"started": "2026-11-28T19:26:14.087Z",
"ended": "2026-11-28T19:26:15.357Z",
"summary": "Made version 1: 5 rows, 11 columns, from sales, stores; check failed, let through: store_name never empty (1 failing).",
"reads": [{"id": "src_be28bf24ae006946", "kind": "source"}, {"id": "src_496cb47f693068fc", "kind": "source"}],
"inputs": [
{"node": "sales", "kind": "source", "id": "src_be28bf24ae006946", "name": "sales", "will": "read",
"number": 2, "taken": "2026-11-28T19:25:45.977Z", "age_secs": 28, "why": "snapshot 2, its newest"},
{"node": "stores", "kind": "source", "id": "src_496cb47f693068fc", "name": "stores", "will": "read",
"number": 1, "taken": "2026-11-28T19:25:23.447Z", "age_secs": 50, "why": "snapshot 1, its newest"}
],
"nodes": [
{"id": "sales", "kind": "source", "rows": 6, "columns": 8, "ms": 220,
"summary": "Read sales_v2.csv (source sales, snapshot 2, taken 28 seconds ago): 6 rows, 8 columns."},
{"id": "clean", "kind": "steps", "rows_in": [6], "rows": 5, "columns": 9, "added": ["revenue"], "ms": 395,
"steps": [
{"step": 1, "op": "trim_val", "rows": 6, "changed": 1, "said": "trimmed 1 value(s) in product"},
{"step": 2, "op": "title_case", "rows": 6, "changed": 2, "said": "changed the case of 2 value(s) in category"},
{"step": 3, "op": "dedupe", "rows": 5, "said": "removed 1 row repeated"},
{"step": 4, "op": "fill_empty", "rows": 5, "changed": 1, "said": "filled 1 blank(s) in qty"},
{"step": 5, "op": "add_column", "rows": 5, "said": "added revenue"}
],
"summary": "5 steps: 6 rows in, 5 out; trimmed 1 value(s) in product; changed the case of 2 value(s) in category; removed 1 row repeated."},
{"id": "stores", "kind": "source", "rows": 7, "columns": 5, "ms": 137,
"summary": "Read stores.csv (source stores, snapshot 1, taken 50 seconds ago): 7 rows, 5 columns."},
{"id": "with_stores", "kind": "join", "rows_in": [5, 7], "rows": 5, "columns": 11, "ms": 380,
"join": {"matched": 4, "unmatched_left": 1, "unmatched_right": 3},
"summary": "Joined stores: 4 of 5 rows matched; 1 have no match and are kept."},
{"id": "out", "kind": "output", "rows_in": [5], "rows": 5, "columns": 11, "ms": 58,
"checks": [
{"check": "unique", "columns": ["order_id"], "on_fail": "hold", "passed": true},
{"check": "not_null", "columns": ["order_id"], "on_fail": "hold", "passed": true},
{"check": "not_null", "columns": ["store_name"], "on_fail": "warn", "passed": false, "failing": 1}
],
"summary": "Output: 5 rows, 11 columns; failed: store_name never empty (1 failing)."}
],
"context": "74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b",
"request": "a4fc364bf13d5f559e3a43c01f86a7df794c64bbd9ba670d491d57b0f2f91d39"
}
Every number is counted by the run, and every summary and said is written from those numbers by the server, never by a model: the same every time, and true. They are what your application shows on the graph and what an agent reads to explain a run. A node can also carry removed and retyped columns, append.only_in_some, edits (how each edit fared) and warnings. context and request are hashes: of the security context, which is never kept, and of what was asked, which tells a retry from another request.
state | Means |
|---|---|
running | pulling or running now (202) |
succeeded | it made version, now live |
held | a check that holds failed: nothing kept, the last version stays live |
failed | it made nothing; problems or error says why |
suspended | a stopping server cut it short |
interrupted | a start found it in flight and did not run it again |
A held run:
{"state": "held", "summary": "Held: order_id unique failed; version 2 is still live.",
"nodes": [{"id": "s", "...": "..."},
{"id": "out", "kind": "output",
"checks": [{"check": "unique", "columns": ["order_id"], "on_fail": "hold", "passed": false, "failing": 1},
{"check": "not_null", "columns": ["order_id"], "on_fail": "hold", "passed": true}]}]}
Profiles
Each node’s record carries a profile of what it made, per column: type, role, nulls, distinct values, min and max. It is what an agent reasons from without reading the rows:
"profile": [
{"column": "qty", "type": "integer", "role": "measure", "nulls": 0, "distinct": 3, "min": "1", "max": "4"},
{"column": "revenue", "type": "decimal(2)", "role": "measure", "nulls": 0, "distinct": 5, "min": "0.59", "max": "16.76"}
]
Refused before it runs
A run is checked whole before anything runs or is pulled. A graph that would not run is 422, class Refused, with every problem by node, and nothing is recorded:
{
"error": {"class": "Refused", "message": "node clean: step 1 (trim_val) reads column 'prodcut', which is not there"},
"problems": [{
"node": "clean",
"code": "missing_column",
"column": "prodcut",
"message": "step 1 (trim_val) reads column 'prodcut', which is not there",
"suggestions": [{"column": "product", "because": "its name is 2 letter(s) from 'prodcut'"}]
}]
}
code | A problem with |
|---|---|
graph | its shape: ids, edges, a cycle, the output, a node that leads nowhere |
not_found | a source or dataset it names, or a snapshot or version, that is not there |
invalid | a node’s definition: a step, a formula, a join, a check |
missing_column | a column a node reads that is not there, with suggestions |
read | what an input reads that does not fit it: a version of a source, a pull of an upload |
context | a query snapshot named by number that another statement took (another context or deploy) |
plan | a query source whose spec does not plan under the run’s context |
data | the data will not have it: a value that does not convert, a key that repeats |
A body that is not a graph (an unknown field, a node of no known kind) is 422 Invalid before any of this. A run with no id or dataset is 400.
Dry run
POST /projects/{uid}/runs?check=true with {"graph", "context"} says what a run would read and pull, each node’s columns as compiled, and every problem, with no pull and nothing written:
curl -s "http://127.0.0.1:3699/projects/shop/runs?check=true" \
-H "Content-Type: application/json" \
-d '{"graph": {"nodes": [...]}}'
{
"ok": true,
"said": "Reads sales (snapshot 2, its newest), reads stores (snapshot 1, its newest), runs 5 nodes.",
"reads": [{"id": "src_be28bf24ae006946", "kind": "source"}, {"id": "src_496cb47f693068fc", "kind": "source"}],
"inputs": ["... as a run's ..."],
"nodes": [
{"id": "clean", "kind": "steps", "columns": [
{"name": "order_id", "role": "dimension", "type": "integer"},
"...",
{"name": "revenue", "role": "measure", "type": "decimal(2)"}]},
"... one per node ..."
],
"problems": []
}
A dry run is 200 either way. One that would not run:
{"ok": false,
"problems": [{"node": "clean", "code": "invalid", "message": "step 7 (add_column): in formula `upper(qty)`: upper() takes text, not integer"}],
"said": "It would not run: node clean: step 7 (add_column): in formula `upper(qty)`: upper() takes text, not integer."}
Preview
POST /projects/{uid}/preview runs the graph up to one node over a sample of each input and keeps nothing: what a grid shows while a pipeline is being built. No output node is needed.
curl -s http://127.0.0.1:3699/projects/shop/preview \
-H "Content-Type: application/json" \
-d '{"graph": {"nodes": [...]}, "node": "clean", "limit": 3}'
{
"node": "clean",
"columns": [{"name": "order_id", "role": "dimension", "type": "integer"}, "...", {"name": "revenue", "role": "measure", "type": "decimal(2)"}],
"rows": [[50001, "2026-09-07", 101, "Whole milk", "Dairy", 4, "4.190", "web", "16.76"],
[50002, "2026-07-05", 102, "Bananas", "Produce", 1, "0.595", "store", "0.60"],
[50003, "2026-08-24", 201, "Bananas", "Produce", 1, "0.590", "store", "0.59"]],
"nodes": ["... the record of each node it ran, with profiles ..."],
"problems": [],
"reads": [{"id": "src_be28bf24ae006946", "kind": "source"}, {"id": "src_496cb47f693068fc", "kind": "source"}],
"inputs": ["... what each input it ran read ..."],
"sample": 1000
}
| Field | Default | Does |
|---|---|---|
graph | required | |
node | the output | the node to stop at |
whole | false | every row of each input, not the first 1,000 |
limit | 100 | rows answered, at most 10,000 |
context, connection | for query sources, as a run takes them | |
wait | 10 | seconds to wait on a pull, at most 80 |
sample is how many rows of each input it read, or null with whole. reads lists every source and dataset the graph names, not only those before node. A preview that cannot run is still 200, with problems and no rows; your application shows them on the nodes. A graph whose shape is wrong is 422 Refused, as for a run.
A query source with no snapshot of the statement it plans to is pulled first, as a run would pull it, and read while the preview runs; the preview keeps nothing, so the source gets no snapshot. Past wait, 202:
{"status": "pulling", "source": "src_ce9db02188609c4a", "message": "revenue by region is still running in the warehouse (result r-…); send the same request again"}
The same request again joins the run already going, and is answered when the warehouse is done.
Query sources
A run plans each query source’s spec under the run’s context before anything else; a spec that does not plan is refused by node (plan) and nothing is pulled. Then, as each input’s read says, it reads the newest snapshot that statement took, or pulls: runs the spec fresh on the warehouse with the run’s connection, keeps the rows as the next snapshot, and reads it. The dry run says which:
{"said": "Pulls revenue by region (it has never been pulled), runs 2 nodes.",
"inputs": [{"node": "rev", "kind": "source", "id": "src_ce9db02188609c4a", "name": "revenue by region",
"will": "pull", "why": "it has never been pulled"}]}
The run, with "read": {"max_age": 3600} on the node and a context:
{"id": "rr-1", "state": "succeeded", "version": 1,
"inputs": [{"node": "rev", "will": "pull", "number": 1, "why": "pulled for this run", "...": "..."}],
"summary": "Made version 1: 2 rows, 2 columns, from revenue by region."}
A second run within the hour that plans to the same statement reads that snapshot:
"inputs": [{"node": "rev", "will": "read", "number": 1, "age_secs": 6, "why": "snapshot 1, taken by this statement 6 seconds ago", "...": "..."}]
A run whose context plans a different statement (another caller on a branch with row-level security, or a new deploy that changed the SQL) never reads it: "why": "its snapshots were taken by other statements (another context or deploy), last pulled 3 minutes ago", and it pulls its own. A pull that fails fails the run: "error": "pulling revenue by region: ...". A pull is waited on for up to an hour after the run’s request was answered.
Next steps
- Steps and formulas: what a
stepsnode can do - Edits: the
editsnode - Datasets: reading what a run made