The governed AI workflow runtime
AI workflows
that follow your rules.
Author in TypeScript or Python, declare decisions with expression IR, and run it on the Rust runtime for production-scale execution, policy enforcement, and trace evidence.
import { expr, workflow } from "rustyflows"; import { pricing } from "./pricing-rules"; const ctx = expr.context(); const approvedPct = ctx.approval.approvedPct.or(ctx.quote_decision.proposedPct); const finalTotal = ctx.price.listTotalCents.discount(approvedPct); const emailPayload = expr.object({ to: ctx.input.customerEmail, cc: ctx.input.salesRep.or(ctx.approval.approver), subject: ctx.crm.quoteId.format("Quote % is ready"), body: ctx.reply.message, quoteId: ctx.crm.quoteId, quote: ctx.final_quote, }); export const quoteAndBuy = workflow("quote-and-buy") .input({ customerMessage: "string", customerEmail: "string", salesRep: "string", }) .policy({ maxRunCostUsd: 2, allowedModelProviders: ["anthropic"], }) // Model extracts intent — schema-checked, nothing else gets through .generate("request", { agent: "product-advisor", prompt: "What does the customer need? {{input.customerMessage}}", output: { productNeed: "string", units: "number", requestedPct: "number" }, }) // Tool params are expression objects, not TypeScript callbacks .tool("catalog", { toolId: "catalog.search", params: expr.object({ query: ctx.request.productNeed }), output: { sku: "string", title: "string", unitPriceCents: "number" }, }) .tool("price", { toolId: "catalog.price", params: expr.object({ sku: ctx.catalog.sku, units: ctx.request.units, }), output: { listTotalCents: "number", currency: "string" }, }) // Pricing writes ctx.quote_decision through the same expression IR .ruleset("quote_decision", pricing) // Gate condition and display fields are Rust-evaluated expressions .gate("approval", { type: "approval", when: ctx.quote_decision.decision.eq("needs_sales_approval"), show: expr.object({ sku: ctx.catalog.sku, title: ctx.catalog.title, requestedPct: ctx.request.requestedPct, proposedPct: ctx.quote_decision.proposedPct, proposedTotalCents: ctx.price.listTotalCents.discount(ctx.quote_decision.proposedPct), reasons: ctx.quote_decision.reasons, }), output: { approved: "boolean", approvedPct: "number", approver: "string", note: "string" }, }) .map("final_quote", expr.object({ sku: ctx.catalog.sku, title: ctx.catalog.title, finalDiscountPct: approvedPct, finalTotalCents: finalTotal, reasons: ctx.quote_decision.reasons, })) .tool("crm", { toolId: "crm.create-quote", params: ctx.final_quote, output: { quoteId: "string" }, }) .generate("reply", { agent: "sales-assistant", prompt: "Present quote {{crm.quoteId}}: {{final_quote}}. Why: {{quote_decision.reasons}}", output: { message: "string" }, }) .tool("send_email", { toolId: "email.send-quote", params: emailPayload, output: { status: '"sent" | "queued"' }, });
run 7a2e44 · quote-and-buy@v3.0.1 · production
Works with
Who it helps
Enterprise-level maturity, without enterprise-only adoption
RustyFlows is for teams that need to build serious AI and automation solutions quickly without owning every piece of the governance stack themselves.
Startups and product teams
Build production-ready AI workflows without spending the first months stitching together orchestration, policy, gates, traces, and deployment plumbing.
Scale-ups and enterprises
Bring governance, audit evidence, rollback, cost visibility, and BYO controls to automation that is moving from experiments into production.
Consultancies and partners
Package repeatable AI and automation solutions for clients, then hand over governed workflows they can inspect, operate, and extend.
Operations teams
Prototype quote, approval, invoice, support, onboarding, and internal workflows quickly while keeping human gates where judgment matters.
From code to proof
One lifecycle for every workflow, from first draft to audited production run.
Author
Build with TypeScript or Python SDKs while targeting the same governed runtime package.
Validate
The validation layer is being built for cargo-style diagnostics before workflows reach runtime.
Govern
Attach policy controls and expression-based rules for conditions, math, routing, and approvals.
Deploy
Move toward versioned workflow packages per environment, with snapshots and rollback.
Prove
Each run should leave an inspectable trace of step outputs, model calls, usage, and decisions.
Cargo-style validation. Release-minded deploys.
The CLI path is being designed around structured diagnostics, policy checks, and reversible workflow packages.
$ rustyflows validate ./workflows/quote-and-buy error[RF0412]: step `final_quote` references unknown output `approval.approvedPtc` --> quote-and-buy.ts:51:36 = help: did you mean `approval.approvedPct`? warning[RF0207]: rule `cap-small-orders` is unreachable --> pricing-rules.ts:31 = note: shadowed by `needs-sales-approval` (priority 10) error: validation failed · 1 error, 1 warning · 312ms
Visual Prototyping
Prototype the package, run it with proof
Quote-and-Buy - buyer input, expression rules, approval, generated reply, and email handoff in one trace.
Usage telemetry
Every run carries a cost signal
Trace spans, provider usage, and configured meter rates produce a pricing preview. Provider spend stays visible as managed LLM pass-through; platform estimates come from execution, storage, and DB meters before customer billing is enabled.
$16.17
$2.11 platform / $14.06 LLM pass-through
1,284
284 billable after allowance
842ms
end-to-end
18.4s
observed local runtime
420KB
observed peak
4.8MB
retained run data
Cost trend
Daily charge estimate with p95 latency context
Cost breakdown
Preview rates applied to usage rollups
Managed LLM pass-through
provider cost x 1.2
Billable executions
284 overage execs at $0.005
Storage + DB allocation
$3/project/mo prorated
Provider usage
Billable execs
CPU time
Peak memory
Trace writes
Success
Pricing model
preview shape, not external billingHosted usage
Executions, storage, and DB allocation are metered with preview rates.
LLM pass-through
Managed provider spend is shown separately from platform revenue.
BYO controls
Customer keys and infrastructure avoid double-charging provider or storage spend.
Enterprise base
Governance, support, audit, and self-hosted licensing can sit above usage.
Pilot motion
Prototype in days, then harden before production
A good first RustyFlows pilot should prove the workflow, the governance model, and the operating economics before anyone commits to a larger rollout.
Bring one workflow
Pick a quote, approval, triage, invoice, or handoff flow where policy and traceability matter.
Prototype visually
Map the steps, inputs, tools, gates, and handoff points before committing to the package shape.
Harden with SDK/CLI
Move the prototype into TypeScript or Python authoring with expression rules and Rust validation.
Run with evidence
Inspect traces, approvals, usage, and cost previews so stakeholders can evaluate the workflow.
Pilot output
A rollout decision, not just a demo
The goal is to leave the pilot with enough proof to decide whether the workflow belongs on hosted RustyFlows, customer infrastructure, or a later self-hosted runtime path.
Built for production governance
The runtime and control plane underneath the lifecycle.
Policy Controls
Spend caps, approved models, data boundaries, and regional constraints designed to be checked before and during execution.
Expression System
Declare paths, predicates, math, coalescing, and rule effects as expression IR that Rust can validate, trace, and evaluate.
Versioned Deployments
The package model is being shaped for environment-specific versions, deployment snapshots, diffs, and rollback.
Traceable Runs
Run traces capture step outputs, model calls, usage, and policy decisions so teams can inspect what happened.
Code-First SDKs
TypeScript and Python authoring compile to the same governed package, so workflows can be reviewed like code without moving logic out of the runtime.
Visual Prototyping
The canvas renders any package for rapid prototyping, demos, and step-by-step debugging of governed runs.
Human-in-the-Loop
Approval gates, input collection, and decision points. Keep humans in control of critical steps.
MCP & Webhooks
Expose workflows as MCP tools, or trigger them from GitHub, Stripe, Slack, and the REST API.
Rust Core
Bring Rust performance, concurrency, and scaling to TypeScript and Python-authored workflows through one runtime.
For the workflows you have to get right
Candidate launch examples for the governed SDK and CLI path.
Quote-and-Buy
Price, review, and approve quotes with discount caps and spend policies enforced at runtime — not in a code review.
early-access example
Invoice Approval
Route invoices through rule-driven approval chains, with human gates above thresholds and a trace of every decision.
workflow package pattern
Support Triage
Classify, route, investigate, and respond — with policy-bound model usage and a full decision trail per ticket.
runtime trace pattern
Ship AI you can stand behind.
Request early access to the governed runtime, or bring one workflow and plan a focused pilot around it.
Browse the current docs and SDK notes