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::simple::<String>("greeting")
    .then(BuildGreeting);

let mut bus = Bus::new();
let result = axon.execute("World".into(), &(), &mut bus).await;

2. Chain Transitions

Compose steps with .then(). The compiler enforces type safety 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 result = axon.execute(input, &(), &mut bus).await;
    assert!(result.is_next());
}

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 (auth tokens, tenant IDs, correlation IDs) through the pipeline via the type-indexed Bus.

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,
});

Learning Paths

Quick Start

Build your first Axon workflow in under 30 minutes.

hello-worldtyped-state-treetesting-patternscustom-error-typesrouting-demo

HTTP Services

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

routing-paramsflat-apisession-patternmultipart-uploadwebsocketsse-streamingopenapireference-todo-api

Advanced Patterns

Master resilience, persistence, and enterprise patterns.

order-processingretry-dlqstate-persistencemultitenancyllm-content-moderationreference-ecommerce-order

Authentication & Security

Secure your APIs with Guard nodes, JWT authentication, and role-based access control.

guard-demoauth-jwt-rolesession-pattern
Full guide with runnable code: Getting Started Guide