Counting visitors…
Browse all docs
Start · 9Find your path through RunifoldLearn Runifold in 45 minutesUnderstand the complete Runifold platformYour first trustworthy runChoose the right execution APIChoose crates and Cargo featuresBuild common Runifold applicationsRunifold frequently asked questionsTroubleshoot Runifold applications
Execution kernel · 7Understand RunContextCoordinate external effects safelyBound work with budgets and cancellationHandle errors and retries safelyEvents, journals, and execution evidenceDesign capability-safe executionRecover safely from checkpoints
Models & providers · 7Route across models without duplicate outputChoose and configure a providerUse the provider-neutral model protocolBuild on the Provider Runtime contractUse OpenAI control-plane and Realtime APIsTest and benchmark provider adaptersSet up OpenAI, Anthropic, Gemini, and Ollama
Agents · 7Build and configure an AgentGive an Agent typed toolsAdd conversations and semantic memoryDelegate to child Agents safelyReturn structured Rust valuesStream without losing semanticsGround an Agent with retrieval
Durable workflows · 7Compose deterministic workflowsMake workflows durableOperate durable workflow workersCoordinate timers, signals, and durable waitsRun multi-tenant workflow infrastructureRun parallel branches and safe racesVersion and evolve durable workflows
Integrations · 7Connect through MCPChoose stores and persistence boundariesExpose durable work through MCP TasksBuild and evaluate retrieval pipelinesUse MCP Resources, Prompts, and SamplingCache MCP responses without crossing authorityDeploy Runifold in a Rust web service
Quality & operations · 10Test without the networkEvaluate quality and prevent regressionsObserve the complete run treeRun safely in browsers and at the edgeRead reliability claims preciselyRun reproducible evaluations in CIOperate Runifold with SLOsGovern Task retention and deletionArchive audit evidence to S3-compatible WORM storageManage compatibility and trusted releases
Docs/Recipes
NEW TO RUNIFOLD?Build the complete mental model in 45 minutes
Recipes

Build common Runifold applications

Choose a task-oriented recipe for text, structured output, Tools, streaming, memory, retrieval, workflows, and MCP.

Practical guide·10 min

Choose a recipe

Start from the product behavior you need. Every recipe below uses the same execution model, so moving from a prototype to a bounded Run does not require a framework rewrite.

I want to…Start hereAdd before production
ask a model one questionfirst runexplicit model, timeout, error policy
return a Rust valuestructured outputdomain validation and refusal handling
call application codetyped toolscapabilities, budgets, and effect policy
stream to a UIstreamingdisconnect cancellation and terminal-state handling
preserve a conversationconversationscontext window and tenant namespace
answer from documentsretrievalattribution, tenant filtering, and evaluation
coordinate fixed stepsworkflowscheckpoints and recovery policy
expose remote capabilitiesMCPauthorization partitions and transport limits

One-shot and typed output

Use prompt_text at text boundaries. Use a structured Agent when application logic needs a contract:

use runifold::JsonSchema;
use serde::Deserialize;
 
#[derive(Debug, Deserialize, JsonSchema)]
struct Triage {
    category: String,
    urgent: bool,
    explanation: String,
}
 
let structured = runtime
    .agent("triage")
    .system("Classify the request. Keep the explanation short.")
    .build_structured::<Triage>("triage_result")?;
 
let run = structured.agent().default_run_context();
let result = structured.run("Payment failed twice", &run).await?;
println!("{:?}", result.output);

Schema acceptance is not domain validation. Validate business invariants after deserialization and fail closed if the model refuses or returns invalid output.

Tools, streaming, and memory

These features solve different problems:

  • a Tool lets a model propose a call to typed Rust code;
  • a stream exposes ordered model, Tool, usage, warning, and terminal events;
  • conversation storage persists messages and versions across requests;
  • a RunContext carries authority, budgets, cancellation, deadlines, and journal state for one execution tree.

Do not use chat history as execution state or Tool registration as authorization. Follow typed tools, streaming, and conversations independently, then compose them.

Workflows and long-running work

Use ordinary Agent execution when the model decides the next turn. Use a Workflow when your application owns the sequence, branch, join, timer, signal, or recovery boundary.

For a durable job:

  1. define stable step identifiers and a workflow version;
  2. give every step an explicit capability set;
  3. persist checkpoints and external effects before execution;
  4. run Workers with fenced leases and heartbeats;
  5. define how unknown or ambiguous states are recovered.

Read workflows, durability, and Workers in that order.

Know what is verified

The Quickstart, structured output, Tool, streaming, conversation, delegation, routing, and web-service examples are compiled in documentation CI against the exact public runifold = 0.9.0 release. A successful compile proves the API surface matches the page; live provider behavior still requires credentials and a model-specific smoke test.

Use the testing guide for deterministic behavior and Provider testing for real protocol evidence.