· Updated
LangGraph vs. Strata: the same approval agent in both
One wire-transfer agent that pauses for human approval, built in LangGraph (Python) and in Datalium Strata (C# and Rust), compared line by line.

People who see Datalium Strata for the first time usually ask how it compares with LangGraph. This post answers with code. It builds one small agent in both frameworks and compares them at the points where they actually differ.
First, a disclaimer, because it matters. LangGraph is excellent, and it’s the natural choice for agents in Python. Its ideas, such as state graphs, checkpointers, threads and interrupts, are the vocabulary most of the field uses now, Strata included. This isn’t a post about which framework is better. It’s about what changes when the same ideas are built for typed, compiled languages, inside the service you already run.
The Python below was run on langgraph 1.2.20, the current release as I write. The Strata code comes from demo 05 in the public demo repos (C#, Rust), on 0.9.0-preview.2. If I’ve got something about LangGraph wrong, tell me and I’ll correct the post.
The agent
It’s a wire transfer, because nobody wants an agent to send money on its own:
- Prepare the transfer. In a real agent, this step might be a model call that reads an invoice.
- Pause for a person, before anything irreversible happens. The person can approve the transfer, correct the amount, or reject it.
- On an approval, execute the transfer. On a rejection, cancel it, and record who said no.
The pause has to survive a restart. A reviewer may answer next week, after three deployments.
In LangGraph
from typing import Literal, TypedDict
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import END, START, StateGraph
from langgraph.types import Command, interrupt
class WireTransfer(TypedDict, total=False):
beneficiary: str
amount: float
currency: str
status: str
approved: bool
reviewer: str
def prepare_wire_transfer(state: WireTransfer) -> dict:
return {"status": "awaiting approval"}
def await_approval(state: WireTransfer) -> dict:
# Pauses the run. On resume, this node runs again from the top,
# and interrupt() returns the value passed in Command(resume=...).
answer = interrupt({"beneficiary": state["beneficiary"], "amount": state["amount"]})
return {
"approved": answer["approved"],
"reviewer": answer["reviewer"],
"amount": answer.get("amount", state["amount"]),
}
def route(state: WireTransfer) -> Literal["execute_wire_transfer", "cancel_wire_transfer"]:
return "execute_wire_transfer" if state["approved"] else "cancel_wire_transfer"
def execute_wire_transfer(state: WireTransfer) -> dict:
reference = bank.send(state["beneficiary"], state["amount"], state["currency"])
return {"status": f"sent ({reference})"}
def cancel_wire_transfer(state: WireTransfer) -> dict:
return {"status": f"cancelled by {state['reviewer']}"}
builder = StateGraph(WireTransfer)
builder.add_node("prepare_wire_transfer", prepare_wire_transfer)
builder.add_node("await_approval", await_approval)
builder.add_node("execute_wire_transfer", execute_wire_transfer)
builder.add_node("cancel_wire_transfer", cancel_wire_transfer)
builder.add_edge(START, "prepare_wire_transfer")
builder.add_edge("prepare_wire_transfer", "await_approval")
builder.add_conditional_edges("await_approval", route)
builder.add_edge("execute_wire_transfer", END)
builder.add_edge("cancel_wire_transfer", END)
graph = builder.compile(checkpointer=InMemorySaver()) # PostgresSaver to survive a restart
Running it, pausing, and answering:
config = {"configurable": {"thread_id": "wire-acme-corp"}}
result = graph.invoke({"beneficiary": "Acme Corp", "amount": 4200.50, "currency": "USD"}, config)
print(result["__interrupt__"][0].value) # {'beneficiary': 'Acme Corp', 'amount': 4200.5}
final = graph.invoke(Command(resume={"approved": True, "reviewer": "jdoe@acme.io", "amount": 4150.25}), config)
print(final["status"]) # sent (ref 0001)
That’s clear and compact, and it reads well. interrupt() is a very nice API: the pause sits right where the question is asked, and the answer comes back as a return value.
In Strata (C#)
var graph = new StateGraph<WireTransferState>()
.AddNode("PrepareWireTransfer", state => state with { InvoiceGenerated = true, Status = "awaiting approval" })
.AddInterruptBoundary("PrepareWireTransfer", onReject: "CancelWireTransfer")
.AddNode("ExecuteWireTransfer", (state, ctx, _) =>
{
var decision = ctx.Decision ?? throw new InvalidOperationException("a transfer must not run without a decision");
var reference = bank.Send(state.Beneficiary, state.Amount, state.Currency);
return ValueTask.FromResult(state with { Status = $"sent ({reference})", ApprovedBy = decision.Reviewer });
})
.AddNode("CancelWireTransfer", (state, ctx, _) =>
ValueTask.FromResult(state with { Status = $"cancelled by {ctx.Decision!.Reviewer}" }))
.AddEdge("PrepareWireTransfer", "ExecuteWireTransfer")
.Compile();
sealed record WireTransferState(
string Beneficiary, decimal Amount, string Currency, bool InvoiceGenerated,
string Status, string? ApprovedBy, string? Note)
{
public static WireTransferState New(string beneficiary, decimal amount) =>
new(beneficiary, amount, "USD", InvoiceGenerated: false, Status: "new", ApprovedBy: null, Note: null);
}
Running it, pausing, and answering, against a SQLite file:
var result = await graph.RunAsync("wire-acme-corp", WireTransferState.New("Acme Corp", 4200.50m), store);
// Interrupted: suspended at PrepareWireTransfer, next ExecuteWireTransfer
var approval = HumanSignal.Approve("jdoe@acme.io").WithOverride("Amount", 4150.25m);
var final = await graph.ResumeAsync("wire-acme-corp", approval, store);
// Completed: Status = sent (ref 0001), Amount = 4150.25, ApprovedBy = jdoe@acme.io
In Strata (Rust)
The Rust engine is a separate implementation with the same behaviour and the same checkpoint format:
let graph = StateGraph::<WireTransferState>::new()
.add_node("PrepareWireTransfer", |s: WireTransferState| WireTransferState {
invoice_generated: true,
status: "awaiting approval".to_string(),
..s
})
.add_interrupt_boundary_with_reject("PrepareWireTransfer", "CancelWireTransfer")
.add_async_node("ExecuteWireTransfer", move |s: WireTransferState, ctx: NodeContext| {
let decision = ctx.decision().expect("a transfer must not run without a decision");
let reference = bank.send(&s.beneficiary, s.amount, &s.currency);
std::future::ready(WireTransferState {
status: format!("sent ({reference})"),
approved_by: Some(decision.reviewer.clone()),
..s
})
})
.add_async_node("CancelWireTransfer", |s: WireTransferState, ctx: NodeContext| {
let decision = ctx.decision().expect("a rejection is a decision");
std::future::ready(WireTransferState { status: format!("cancelled by {}", decision.reviewer), ..s })
})
.add_edge("PrepareWireTransfer", "ExecuteWireTransfer")
.compile()?;
let approval = HumanSignal::approve("jdoe@acme.io").with_override("amount", 4150.25);
let result = graph.resume("wire-acme-corp", approval, store.clone()).await;
Where they differ
1. Where the pause lives, and what runs again
In LangGraph, the pause is a call inside a node. When the thread resumes, that node runs again from its first line, and this time interrupt() returns the answer. The docs are explicit about it: “any code before the interrupt runs again”, so side effects before an interrupt() should be idempotent. If one node has several interrupt() calls, they’re matched to answers by order. That’s why await_approval above is a node of its own that does nothing but ask.
In Strata, the pause is part of the graph. AddInterruptBoundary("PrepareWireTransfer") means “stop after this node commits”. The run saves an interrupted checkpoint and returns. A resume starts at the next node: on an approval, the edge out of the boundary, and on a rejection, the reject route. Nothing that already committed runs again. Strata calls this sequence Freeze, Flush, Evict.
Neither model is wrong. LangGraph’s keeps the question next to the code that asks it. Strata’s makes the pause visible in the graph’s structure, so the CLI, the docs and a code reviewer can all see where a thread can stop.
2. Who approved, and what they changed
In LangGraph, the resume value is whatever you pass in, and your node decides what to do with it. Above, the reviewer’s name and the corrected amount are fields in a dictionary that the node copies into the state.
In Strata, the answer is a typed HumanSignal. The engine records it as a HumanDecision: the boundary, approved or not, the reviewer, every override, and when it was decided. Every node after the boundary reads that decision from ctx.Decision, so the audit trail doesn’t depend on a field the reviewer filled in. Overrides are merged into the frozen state, and an override that doesn’t fit the state’s type is refused before anything runs. Demo 05 shows this by sending the amount as a string:
Refused: failed to rehydrate state for thread 'wire-acme-corp': The JSON value could not be converted to WireTransferState. Path: $.Amount
Not stamped, nothing ran: 'wire-acme-corp' can still be answered.
3. What compile() checks
Both frameworks check the graph when you compile it, and they check different things. Here’s what I found with langgraph 1.2.20, reading StateGraph.validate() and running small test graphs:
| Mistake | LangGraph compile() |
Strata Compile() |
|---|---|---|
| An edge to a node that doesn’t exist | Error: Found edge ending at unknown node |
Error: STRATA_ERR_DANGLING_EDGE |
| No entry point | Error: Graph must have an entrypoint |
Error: STRATA_ERR_MISSING_ENTRY |
| A node that nothing leads to | Compiles | Error: STRATA_ERR_ORPHAN |
| A loop with no exit condition | Compiles. At runtime: GraphRecursionError after the recursion limit (10,007 super-steps by default) |
Error: STRATA_ERR_UNGUARDED_CYCLE |
To be fair to LangGraph, there’s a reason for this. A conditional edge in LangGraph is a Python function, and without a path map or a Literal[...] return hint, its targets can’t be known before it runs, so a reachability check couldn’t be complete. (One oddity: the LangGraph Graph API docs say compilation checks for orphaned nodes, but in my test a graph with an orphan compiled without error.)
A Strata conditional edge names its target (AddConditionalEdge(from, to, condition)), so the validator can see the whole graph. Here are all three errors at once, from demo 07:
[STRATA_ERR_DANGLING_EDGE] Edge 'Review' -> 'Archve' points at 'Archve', which is not a node in the graph.
[STRATA_ERR_ORPHAN] Node 'Archive' is isolated and unreachable from the entry point 'Draft'.
[STRATA_ERR_UNGUARDED_CYCLE] Unguarded cycle detected between 'Review' and 'Draft'. Add a guarded/conditional edge to protect this loop.
Because the check runs in Compile(), a unit test that builds the graph catches it, and strata graph validate runs it in CI (demo 14).
The fine print applies here, as everywhere: Strata checks the graph’s structure and its state types; the LLM is still free to be wrong. Compile-time checks won’t stop a model from proposing the wrong amount. That’s what the human is for.
Strata’s check had a gap of its own: it didn’t prove that every path reaches an end. Update: 0.9.0-preview.3 closes it. A graph in which some node has no path to an end now fails with STRATA_ERR_NO_TERMINAL, so on preview.3 the graph above reports three more errors, for Draft, LegalReview and Review: with the exit to Archive misspelled, none of them can reach an end. What compiling still can’t prove is that a loop’s exit condition ever turns true, and there’s no hop limit by default. Set MaxNodeHops to stop a run that loops forever. It’s on the Known limitations page.
4. State types
LangGraph state is usually a TypedDict, and Python doesn’t enforce those at runtime. In my test, a node that returned "approved": "not-a-bool" went through without complaint. A type checker such as mypy or pyright catches much of this before you run, if your team uses one. With a Pydantic model as the state, LangGraph validates the input to the first node, but, as its docs say, not later nodes or outputs.
In Strata, the state is a C# record or a Rust struct, and every node takes and returns that type. A node that returns the wrong type doesn’t compile, in the language compiler’s sense. Data from outside (a checkpoint, an override) is deserialized into the type, and refused if it doesn’t fit.
5. Durability
Both frameworks save checkpoints, and both survive a restart with a durable store.
LangGraph saves a checkpoint at every super-step, with a choice of durability modes ("sync", "async" by default, or "exit"). With PostgresSaver, a paused thread is a row in Postgres.
Strata saves where a run stops (the default, Boundaries), or after every node (EveryNode), with leases so that two workers can’t both run one thread. A paused thread is a row in your store, and nothing in your process. In the benchmark results, ten thousand threads paused against SQLite grew the Rust heap by 0 bytes each, and took 1.6 KB each on disk. The docs page on durable execution goes deeper.
6. Where it runs
LangGraph runs in Python, and LangGraph.js in JavaScript and TypeScript. For a team whose services are in .NET or Rust, that usually means a separate service: another runtime and deployment, and a network hop with JSON on both sides.
Strata is a NuGet package or a crate in the service you already run. In .NET, model calls go through any IChatClient from Microsoft.Extensions.AI, and AddStrata() registers the graph, the store and the hosted drivers in your dependency injection.
Side by side
| LangGraph | Datalium Strata | |
|---|---|---|
| Languages | Python; JavaScript/TypeScript (LangGraph.js) | C# (.NET 10) and Rust, one checkpoint format |
| The pause | interrupt() inside a node; the node runs again on resume |
An interrupt boundary after a node; nothing committed runs again |
| The answer | Any value, through Command(resume=...) |
A typed HumanSignal, recorded as a HumanDecision |
| Rejection | Your routing function | A declared reject route (onReject) |
| Structural checks at compile time | Unknown nodes, entry point | Unknown nodes, entry point, orphans, unguarded cycles |
| Runtime loop guard | recursion_limit (10,007 by default) |
MaxNodeHops (off by default) |
| State types | TypedDict (not enforced at runtime) or Pydantic (first node’s input) |
The language’s types, checked by the compiler |
| Maturity | Widely used, large ecosystem | Public preview, 0.9.0-preview.2 |
Which one should you use?
If your team works in Python, use LangGraph. It’s mature, it’s well documented, and it has an ecosystem that Strata, a preview, doesn’t have yet.
If your production services are in .NET or Rust, and you’d rather not run a Python service next to them, try Strata. Start with the Pause for approval guide, which builds this agent step by step, or run demo 05 in C# or Rust. It runs offline, with no API key. Before you build on it, read Known limitations.