Durable workflows · DSH-native

Graphs
with seams.

Six small graphs that earn their keep at a real seam: fan-out over unknown files, one extraction per item, a human signature, a pause that survives a restart. JSON specs, DSH tools, and a ledger — no arbitrary JavaScript.

6 graphs 3 human gates 0 arbitrary JS
langgraph · thread
ledgerdurable
files12
extracts12 objects
outlineready
gateapprove →
checkpointlg_…_w0xw
Real session · 57s

Not a mock.

Recorded from the actual DSH Web app: a 12-topic brief, two 12-item maps, a human gate, and a 12-row output. The video is the transcript and the panel, not an illustration.

real DSH session55s · 226K tokens · 12 rows
The shape

Two maps, one signature.

The graph reads 12 files, extracts one JSON object per file, drafts the outline, and pauses. The human approves the outline; the same thread resumes and writes the brief.

12files
2 × 12maps
1gate
55swall time
Open the spec ↗ See the benchmark
The gallery

Pick a seam, not a shape.

Each card is a real GraphSpec. Copy the prompt, open the JSON, or compose it from the file. The graph is the contract; the model fills the roles.

Under the hood

Prose, law, a clerk.

The model reads a guide for method and a law for rules. The compiler is deterministic: JSON in, StateGraph out. No model translates the IR.

01
State is the ledger.

What must still be true after a seam: files, extracts, outline, decision. Typed fields and reducers decide how many writers may settle them.

02
A node is a role.

One tool call, one judgment, or an open agent brief. Open-ended work stays in prose, not in a constellation of tiny nodes.

03
A gate is a signature.

The run returns interrupted with a thread. The human answer is raw; the graph resumes from the same checkpoint.

04
A map is one role repeated.

Fan out over a list you did not know until runtime; the join settles the ledger. Append follows input order, not completion order.

gallery/specs/research-brief.lg.jsonJSON · IR 1
// the seam, not the ceremony
"nodes": [
  { "do": "tool", "tool": "glob", "out": { "files": "lines" } },
  { "do": "map", "over": "files",
    "body": { "do": "tool", "tool": "read",
              "args": { "file_path": { "$state": "item" } } } },
  { "do": "map", "over": "contents", // extract per item
    "body": { "do": "model", "schema": { "type": "object" } } },
  { "do": "gate", "question": "Approve this outline?",
    "out": { "decision": "text" } }
  // … compose, write
]
The honest part

A graph is a seam tax.

From a real 12-topic brief on the same DSH host. The ordinary loop is still the cheapest; a graph is for the seams that justify it.

approachtimetokens
Ordinary loop
no graph
53s124K
Fine map graph
2 × 12-item maps + gate
55s226K
Coarse agent graph
4 agent/phase nodes
1m38s462K

Don't graph a two-step task. Use the loop for open-ended work; reach for a graph when the work has a real fan-out you cannot enumerate, a human signature, or a pause that must survive a restart. The gallery's research-brief is the honest middle: the ordinary loop still wins on tokens, but the graph makes the seam explicit and resumable.

Try one

Compose from a file.

No JS, no restart: the spec is data. Validate, compose, run; resume an interrupted thread with the raw answer.

in a DSH sessionlanggraph_compose · langgraph_run
langgraph_compose({ action: "validate", path: "gallery/specs/research-brief.lg.json" })
langgraph_compose({ action: "compose",  path: "gallery/specs/research-brief.lg.json" })
langgraph_run({ graph: "lg_adhoc_…", input: { pattern: "topics/*.txt" } })

// the gate returns status: "interrupted"; ask, then resume the same thread
langgraph_run({ graph: "lg_adhoc_…", thread: "lg_lg_adhoc_…", resume: "Approve" })
Trust boundary

Data, not code.

The model may compose a graph, but it cannot ship JavaScript. The spec is session-owned; the tools are the ones you already gave the agent.

JSON IR only

No arbitrary model-written JS. The compiler is deterministic; the same spec makes the same graph. A published JSON Schema gives editors that same vocabulary.

Session-owned

Specs are immutable and owned by the session that composed them; another session cannot run or delete them.

Tool visibility

A node must name a tool visible to the calling agent; args are checked against the tool's own schema at compose time.

Human gates

Irreversible steps pause with a thread. The answer is raw; the resume is explicit, never a hidden side effect.