Getting Started

Build your first pipeline.

Ranvier models workflows as typed pipelines. Each step is a Transition and they chain together into an Axon. Follow this guide to go from zero to a working pipeline in under 30 minutes.

1. Your First Axon

Create a project, write a Transition, chain it into an Axon, and execute it. Takes about 5 minutes.

let axon = Axon::<String, String, String>::new("greeting")
    .then(BuildGreeting);

let mut bus = Bus::new();
let report = axon.execute("World".into(), &(), &mut bus).await;
// This local demo intentionally has no persistence store.
match report {
    ExecutionReport::Unpersisted { result: Outcome::Next(greeting), .. } => println!("{greeting}"),
    _ => eprintln!("Execution requires review before retry"),
}

2. Chain Transitions

Compose steps with .then(). The compiler checks the typed Next handoff between steps at build time.

let axon = Axon::simple::<String>("pipeline")
    .then(ValidateInput)
    .then(ProcessData)
    .then(FormatOutput);

3. Test Transitions

Transitions are plain async functions. Test them directly or test the full Axon pipeline with execute().

#[tokio::test]
async fn test_pipeline() {
    let axon = Axon::<String, String, String>::new("greeting").then(BuildGreeting);
    let mut bus = Bus::new();
    let report = axon.execute("World".into(), &(), &mut bus).await;
    assert!(matches!(report,
        ExecutionReport::Unpersisted { result: Outcome::Next(ref greeting), .. }
        if greeting == "Hello, World!"
    ));
}

4. Custom Errors

Use thiserror + serde for structured domain errors. Match on specific error variants for precise handling.

#[derive(Error, Serialize, Deserialize)]
enum AppError {
    #[error("not found: {0}")]
    NotFound(String),
    #[error("validation: {0}")]
    Validation(String),
}

5. Use the Bus

Pass request-scoped context through a per-execution, type-indexed Bus. Presence and access policy are runtime checks.

bus.insert(TenantId::new("tenant-a"));
// Inside transition:
let tenant = bus.read::<TenantId>();

6. Resilience

Built-in retry with exponential backoff, dead-letter queue (DLQ), and persistence for checkpoint/resume workflows.

axon.with_dlq_policy(DlqPolicy::RetryThenDlq {
    max_attempts: 3,
    backoff_ms: 100,
});
Typed boundary: Next/Fault retain Rust types. Branch/Jump/Emit payloads are schema-validated JSON, and Bus presence and authorization are runtime boundaries.

Learning Paths

Quick Start

Build your first Axon workflow in under 30 minutes.

HTTP Services

Build production HTTP APIs with routing, auth, and real-time features.

Advanced Patterns

Master resilience, persistence, and enterprise patterns.

Governance and Full Stack

Apply explicit request governance and connect a maintained full-stack reference.

Full guide with runnable code: Getting Started Guide