Repository navigation
Graphrt 0.3.0
Workflow format v1 is frozen with a JSON Schema, and validation now collects every error with its location. Also new: webhook triggers, opt in anonymous telemetry, plugins installable by name from the plugin catalog, Android and iOS sample apps, a comparison against LangGraph, and another round of engine, LLM path and server speedups. A security review brought fixes, most of which also shipped as 0.2.1. Contains breaking changes to the workflow format and the Rust API, see Changed (Breaking).
Changed (Breaking)
- Unknown fields are errors in v1 documents: at the document,
graph, node, edge,retry,on_errorand variable-declaration level, and in node configs whose catalog schema is closed (additionalProperties: false, all built-in kinds, ascatalog::schema::objectnow produces).- Plugin configs with open schemas are unaffected.
schema::open_objectbuilds one.- Required config fields from the catalog schema are enforced (for example a
template-transformwithouttemplate). - The import layout (top-level
workflow/app,data-wrapped nodes) stays lenient. - Migration: run
graphrt validateand fix what it reports. - Move tool metadata to
x-keys.
versionmust be"1"(or1) or absent. Migration: setversion: "1".- Edge handles are checked: an edge must use a handle the source node can select (
sourcefor non-branch nodes, case ids andfalseforif-else, class ids, action ids, a plugin's fixed handles).- Non-branch nodes used to follow edges with any handle.
fail-branchedges on nodes without that strategy are a warning (never taken).- Migration: use
sourceor the node's handle.
- Reserved names: top-level
imports,inputs,outputs,triggers,metadata,requires,subgraphs. Node-leveldisabled,cache,metadata(plugin configs cannot use them either). human-input: the request expiry isexpire_after_ms(pause data still reportstimeout_ms). A configtimeout_mswas always taken as the node's per-attempt timeout and never reached the node. Migration: rename it.- Loop variables are
{name, type, input_type, value}.label,var_typeandvalue_type(which meant the input source, unlike every othervalue_type) still work as deprecated aliases. - Deprecated, still accepted with a warning:
environment_variables,conversation_variables, declarationvalue_type, nodeparentId/container_id/iteration_id/loop_id,error_strategy/default_value,retry_config, edgesourceHandle/source_handle. - API:
NodeDochas astrictfield.ConfigErrorhas afieldfield.DocumentError::Field.GraphError::{MissingNode, MissingParent, UnknownReference}carry asuggestion, newGraphError::{InvalidField, UnknownHandle}.graphrt validatetakes--format.CliErrorhaspreformatted. - Breaking (
graphrt-core):Event::NodeChunk::fieldis anArc<str>instead of aString, so a streamed chunk no longer allocates its field name.- Serialized events are unchanged.
- New
NodeContext::chunk_shared(&field, text)streams under a name the node keeps in anArc<str>. NodeContext::chunk(&str, text)keeps its signature (and allocates the name per chunk).- Migrating: compare with
field.as_ref() == "text", usefield.to_string()where aStringis needed, and.into()when building the event.
- Breaking (
graphrt-core):ResponseChunk::node_idis anArc<str>instead of aString(shared with the graph instead of copied per chunk). Migrating as forNodeChunk::field. NewResponseAssembler::push_into(&event, &mut out)appends to a caller-owned buffer.pushis unchanged. - Breaking (
graphrt-llm):collect's callback receives eachChatDeltaby value (FnMut(ChatDelta), wasFnMut(&ChatDelta)), after the delta was added to the response, so streamed text can be moved into a chunk instead of copied.- Closures that ignore the delta (
|_| {}) compile unchanged. - Others match on the owned delta instead of a reference.
- Closures that ignore the delta (
- Breaking (
graphrt-llm):nodes::common::PromptTemplate::messagesreturns&[PromptMessage]instead ofVec<&PromptMessage>. New helpersnodes::common::finish_reason_valueandStreamField::shared. - Node outputs and pool namespaces use the new
graphrt_core::Variablesmap (keys aregraphrt_core::VarName) instead ofIndexMap<String, Value>/IndexMap<Arc<str>, Value>.- It is a reference-counted, insertion-ordered flat map: cloning is a reference-count bump, so a node's outputs become its pool namespace and its event payload without being copied.
- Affected:
NodeOutput::outputsisVariables.NodeOutput::withtakesimpl Into<VarName>(string literals,String,&String,Arc<str>).Event::NodeSucceeded::outputsandEvent::NodeFailed::outputsareVariables(same JSON).VariablePool::namespace()returnsOption<&Variables>andVariablePool::set_outputstakes&Variables.
Migration: most code compiles unchanged, since Variables has the familiar get, insert, remove, iter, keys, values, len, contains_key, extend and collect() API. Iteration yields (&str, &Value) instead of (&String, &Value). Use .to_owned() where a String is needed. Pass a non-'static &str name as name.to_owned(). outputs.insert("x".into(), v) becomes outputs.insert("x", v). Convert with Variables::from(index_map), variables.to_index_map() or IndexMap::from(variables). Indexing a missing name (outputs["x"]) yields Value::Null instead of panicking. remove keeps the order of the remaining entries (like IndexMap::shift_remove).
Added
graphrt serve --webhooks <file>: webhook triggers.POST /v1/hooks/{hook}starts an async run of the hook's workflow from any JSON body and answers202with the run id.- Bodies map to inputs by JSON Pointer and header (
inputs,headers) or pass whole (body_input, defaultbody). - Optional HMAC-SHA256 signature checks in the GitHub, Stripe, Slack, generic or graphrt formats, compared in constant time, with a replay window for the timestamped ones.
- Secrets from the environment,
--env-fileor a file. - An idempotency key header (default
Idempotency-Key) maps redeliveries to the first run, durably with--store. - Deliveries share
--max-body-bytes. GET /v1/hookslists the hooks.- See docs/serving.md.
- Webhook completion callbacks (
callback): a signed (X-Graphrt-Signature: t=..,v1=..) JSON result POSTed when the run succeeds, fails, aborts or pauses, through the HTTP egress policy (private networks refused unless--allow-private-network, no redirects), retried with exponential backoff on network errors,408,429and5xx. - Opt-in anonymous usage telemetry for the
graphrtbinary (telemetryfeature, in the default set).- Off by default.
- On only after
graphrt telemetry enableorGRAPHRT_TELEMETRY=1, and always off withDO_NOT_TRACK, in CI, or without an endpoint (GRAPHRT_TELEMETRY_URLat build or run time). - At most one report a day, sent from a background thread with a 5 s timeout: a random install id, version, OS/arch, features, build (
cli/docker) and per-day counts of runs andserverequests, aggregated intelemetry.jsonin the user config directory. graphrt telemetry statusprints exactly what would be sent.- Not in the embedded or FFI libraries.
- See docs/telemetry.md.
tools/telemetry-collector/: a Cloudflare Worker + D1 collector for those reports (strict payload validation, no IP addresses stored, schema, wrangler config template, weekly-active-installs and daily-runs queries). Not deployed.- Workflow format v1 is frozen, with a JSON Schema (draft 2020-12):
schema/workflow-v1.schema.json, oneoneOfbranch per node kind keyed ontype, built from the node catalog.graphrt schemaprints the schema for the node kinds in the running build, including plugins.- The examples carry a
# yaml-language-server: $schema=...header. - Editor setup (VS Code YAML, JetBrains) and the stability promise are in
docs/workflow-format.md.
- Validation reports every problem at once:
graphrt validateandrunshow rustc-style errors withfile:line:column, a source snippet, the document path (graph.nodes[1].template) and "did you mean" suggestions for field names, node types, node ids in edges, parents and selectors, and edge handles.graphrt validate --format jsonprints a machine-readable report.- Library:
graphrt_core::validate::validate_text,Diagnostic,source_map::SourceMap,doc_schema::workflow_schema,Registry::descriptor_ref,Node::branch_handles,ConfigError::field.
x-keys (document,graph, nodes, edges) are free for tools and ignored.- Tools can return images that the
agentnode shows to the model, enabling vision loops such as computer use (screenshot, then click by coordinates).ToolOutputgainsimages(ToolImage::Base64 {media_type, data_base64}orToolImage::Url), checked againstcheck_images(4 per result, 5 MiB each, png/jpeg/webp/gif, https URLs).- Anthropic, Gemini 3+ and Bedrock Claude/Nova receive them inside the tool result.
- OpenAI-compatible servers and other models get them in a user message right after the tool results.
- New agent option
keep_tool_images(default 3,nullfor all) keeps only the latest N image-bearing results. - Plugin protocol:
tool.callresults acceptimages, andinitializeannouncesfeatures: ["tool_images"]. - The Python, TypeScript and Rust SDKs send images only to hosts that announce it.
- MCP image blocks are forwarded too.
- See
docs/tool-images.md.
graphrt plugin install <name>[@version]installs a plugin from the graphrt-plugins catalog (index.jsonof itscatalogrelease, or--index <url|path>/$GRAPHRT_PLUGIN_INDEX): the latest version or the exact one, downloaded over https only with a timeout and a size cap, checked against the catalog's sha256, extracted with absolute paths,.., symlinks, hard links and device files refused, then installed like a local directory (manifest validation and checksums included).- The plugin's
statusandtos_riskare printed. - Anything but status
stable/betawith ToS risknone/low/mediumneeds--yes, including unlabelled entries and unrecognised labels. - A directory with the same name in the current directory still wins.
- The plugin's
graphrt plugin search [query]: catalog plugins with their latest version, status and a one-line description.docs/plugin-manifest.md: a versioned specification of the plugin manifest (every field with its type, default and constraints, the validation rules and a compatibility policy forprotocol_version), and a JSON Schema for manifests,docs/schemas/plugin-manifest.schema.json, tested against the example, fixture and scaffolded manifests and against the parser itself.
Performance
- Engine, second round (shared outputs map, batched commits, one clock read per node, faster ids, direct template variables).
- Benchmark harness, Apple M3 Pro, against the first round below (p50, median of 21 alternating runs on a shared machine): 1,000-node chain 0.63 -> 0.40 µs per node, 1,000-way fan-out 0.99 -> 0.52 µs, 100-way fan-out 0.79 -> 0.46 µs, template chain 1.35 -> 1.00 µs, branches 0.60 -> 0.44 µs, parallel iteration 1.25 -> 1.03 µs, loop x iteration 1.20 -> 1.00 µs.
- Allocations per node 9.1 -> 4.1 (noop chain), 10.9 -> 5.4 (fan-out), 16.7 -> 11.0 (template chain).
- Concurrent instant LLM runs (median of 15): 239k -> 282k runs/s at 1,000 in flight, 206k -> 230k at 100.
- Runs bound by a 50 ms model are unchanged.
- Engine: a node's outputs become its pool namespace and its
NodeSucceededpayload without being copied (see Changed (Breaking)), string-literal output names no longer allocate, and namespace lookups scan a few entries instead of hashing with SipHash. - Engine: nodes that have already finished are committed together before new nodes start. In a wide fan-out every commit used to copy the namespace table and a shard because a freshly started sibling held a snapshot of it. A batch of completions now shares one copy.
- Engine: the clock is read about once per node instead of twice. The time a finished node already read is reused for the next node's start and for any nodes skipped in the same step, and a batch of nodes started together shares one reading.
- Engine: execution ids are written as characters into a reused per-thread buffer, which drops the UTF-8 validation pass each id needed (same format).
template-transform: string, number, boolean and null variables are handed to the template directly (a string shares its allocation) instead of through serde. Other values still go through serde, which masks secrets.- Engine: fewer allocations and less work per node execution.
- Node task futures are stored unboxed and are less than half their former size (584 -> 264 bytes)
- A node that runs alone (chains, fan-ins) is polled without a
FuturesUnorderedtask. - The clock is read once per node start instead of twice.
- Pool namespace lookups use a keyed FxHash-style hasher instead of SipHash.
- Output names are shared across commits through a per-node cache (since replaced by
Variables, whose literal names never allocate) - The root pool's shards are sized from the graph.
template-transformresolves its variables when the template reads them instead of building and converting a map per render.- Benchmark harness, Apple M3 Pro, same machine before and after (p50, median of 11 runs): 1,000-node chain 0.74 -> 0.56 µs per node, 1,000-way fan-out 0.93 -> 0.86 µs, template node 1.38 -> 1.06 µs.
- Allocations per node 12.2 -> 9.1 (noop chain), 13.1 -> 10.9 (fan-out), 23.8 -> 16.7 (template chain).
- Concurrent instant LLM runs are unchanged (~285k runs/s at 11 workers): their cost is outside the per-node path.
bench/run.shrecords allocations per run and per node (graphrt-bench allocs).- LLM path: fewer allocations and copies per model call and per streamed chunk.
- Chunks share their field name and move the provider's text instead of copying it.
- The
llmnode renders its prompt into one pre-sized message list, buildsusagedirectly, moves the answer out of the response and builds its metadata once per node. - Instant mock model, 10 chunks, Apple M3 Pro (11 cores), against 7444368: 133 -> 103 allocations per run.
- -13% instructions per run (sequential and with 1,000 runs in flight)
- Sequential latency 6.5 -> 5.8 µs.
- Throughput of runs whose events are discarded (
run_to_end) is unchanged at 11 workers (~265k runs/s at 100 in flight, ~290k at 1,000): with the macOS system allocator it is bound by the allocator and by the efficiency cores, not by this work.
ResponseAssembler: no allocation per chunk on the streaming path (stream buffers looked up by&str, template parts borrowed, only referenced outputs copied), andpush_intolets consumers reuse one chunk buffer.- Instant LLM run consumed through the assembler: 253 -> 161 allocations, -25% instructions, time to first answer chunk 11.1 -> 9.2 µs, concurrent runs +24% (161k -> 200k runs/s at 100 in flight, 171k -> 214k at 1,000).
graphrt serve: live events are shared asArc<Event>between the run feed, the broadcast channel and SSE listeners instead of deep-copied, and a streaming run's 4,096-slot channel holds 8-byte slots instead of ~256-byte events (it was over 1 MiB per streaming request).- LLM workflow against a local instant OpenAI-compatible endpoint, 50 connections, macOS: synchronous 32.7k -> 35.8k req/s, streaming 16.3k -> 21.8k req/s, server RSS after 40k requests 120 -> 39 MiB.
- Static musl build in a 16 MiB, 1-CPU container with 8 streaming clients and the default
--max-runs: the server was OOM-killed before (15.1 MiB peak even with--max-runs 100) - It now peaks at 13.8 MiB (7.0 MiB with
--max-runs 100), streaming 2.2k -> 3.6k req/s.
Fixed
http-requesttimeout: {connect, read, write}in a document was silently dropped (the loader treatedtimeoutas a node policy key), so documents' HTTP timeouts never applied.- The generated Kotlin bindings (
bindings/kotlin) did not compile: everyGraphrtExceptionvariant declared amessagefield that clashes withThrowable.message.- Kotlin now names the field
detail(crates/graphrt-ffi/uniffi.toml) Throwable.messagestill carries the text, and Swift and Python are unchanged.- The
bindgen-clifeature now enables UniFFI'scargo-metadataso the generator reads that file.
- Kotlin now names the field
Security
codenode (JavaScript): a workflow could switch off the sandbox's memory and stack limits by asking forlimits.memory_bytes: 0orlimits.stack_bytes: 0(QuickJS reads zero as "unlimited"), and unbounded recursion then overflowed the native stack and aborted the whole process (for examplegraphrt serve).- An operator stack ceiling above 16 MiB had the same effect, and one above the executor's thread stack (2 MiB on tokio's blocking pool) crashed the process too.
- Limits now have floors (1 MiB heap, 64 KiB stack) and a 16 MiB stack ceiling, and JavaScript runs on a dedicated thread sized from the stack limit, so deep recursion is always a catchable
RangeError. - Also fixed in 0.2.1.
codenode (JavaScript): error messages thrown by scripts are truncated to 8 KiB, so a script cannot push megabytes into events and run records. An operator time limit too large for the clock no longer panics. A long chain of promise jobs is bounded by the time limit between jobs as well.- Python subprocess runner: the working directory is created fresh and owner-only (
0700) instead of adopting an existing directory at the predictable temp path. - Engine: node error messages are scrubbed of every secret the run has seen (
type: secretenv variables, secret-typed inputs, re-supplied resume secrets, secret outputs) before they reachnode_failed/node_retry/run_failedevents,error_messageoutputs of handled errors, the run store and OTel spans.- Previously an error that echoed a key (a provider body such as "Incorrect API key provided: sk-...", an HTTP error snippet from an echo endpoint, an exception in code) was recorded verbatim.
- New public helpers in
graphrt_core::redact. - Also fixed in 0.2.1.
- LLM providers: error bodies of failed provider requests are scrubbed of the credentials the request carried (
Authorization,x-api-key,x-goog-api-key,api-keyheaders,keyquery parameters) before they become error messages.- OpenAI-compatible gateways and self-hosted servers often echo the full key.
- Also fixed in 0.2.1.
codenode: returned strings containing a secret input (key, or"Bearer " + key) are re-tagged as secrets, so they are masked innode_succeededevents, SSE, run records and snapshots while staying usable downstream. Captured Python stdout is scrubbed. Previously they were stored in plaintext. Also fixed in 0.2.1.- HTTP egress policy: also blocks the IPv4-translated form
::ffff:0:a.b.c.d(judged by the embedded IPv4 address), the local-use NAT64 prefix64:ff9b:1::/48, Teredo2001::/32and the Azure WireServer address168.63.129.16. Also fixed in 0.2.1. - OTel HTTP exporter: redirects are no longer followed, so vendor key headers cannot follow a redirect to another host.
- Bundles:
graphrt run/serve --bundleextracted configs to a fixed, predictable directory in the shared temp dir and reused it if it existed, so another local user could pre-create it and plant symlinks or swapproviders.json(e.g. pointingbase_urlat their server).- Each invocation now extracts into a new owner-only (
0700) directory. - Signatures are checked with strict Ed25519 verification.
- Also fixed in 0.2.1.
- Each invocation now extracts into a new owner-only (
- Plugins:
limits.max_message_bytesis capped at 256 MiB. WebAssembly plugins get at most 4 tables of 100,000 elements (was 8 x 1,000,000), which lived outside thememory_bytesbudget. graphrt serve: new--max-active-runs(default 256,0= unlimited) caps runs executing at once. Further starts and resumes get429. Previously"async": truerequests could start unlimited parallel runs (--max-runsonly bounds kept records). Also fixed in 0.2.1.graphrt servewithout an API key on a loopback address now accepts only loopbackHostnames (localhost,127.0.0.1,[::1]), blocking DNS rebinding from web pages.- A non-loopback address without a key prints an explicit warning.
- Run store I/O errors no longer return server file paths to clients, and
top_kon/v1/knowledge/retrieveis capped at 100. - Also in 0.2.0.
Debugoutput ofOtelConfig(OTLP headers) and the MCPStdioConfig(env) /HttpConfig(headers, bearer token) shows names only, never values.- Docs: new docs/security.md (sandbox limits, egress policy, masking guarantees and their limits, deployment knobs). SECURITY.md now has a threat model, explicit scope and supported versions (0.2.x, 0.3.x).
- Dependencies:
rusqlite0.40 -> 0.41 (bundled SQLite 3.54), fixing RUSTSEC-2026-0459 / CVE-2026-119375 (uninitialized page-cache memory read through a crafted database and-walpair) ingraphrt-rag'sSqliteStore.graphrt-ragnow needs Rust 1.89.paste(unmaintained, build-time only, via candle) is acknowledged indeny.toml.- Also fixed in 0.2.1.
Install
curl -fsSL https://github.com/Graphrt/graphrt/releases/download/v0.3.0/install.sh | sh
brew install graphrt/graphrt/graphrt
cargo install graphrt-cli
docker pull ghcr.io/bimapangestu28/graphrt:0.3.0The container image of this release was published at ghcr.io/bimapangestu28/graphrt and stays there. Starting with the next release, images are published at ghcr.io/graphrt/graphrt.
- Windows (experimental):
graphrt-x86_64-pc-windows-gnu.zipis cross-compiled from macOS and has not been run on Windows yet. Please report problems in an issue. - Still on 0.2.x? The security fixes are also available as 0.2.1.
Full changelog: CHANGELOG.md · v0.2.1...v0.3.0