Skip to main content

Examples

AI Pipeline Checkpoint

4-stage document pipeline with checkpointing, retry backoff, and failure injection.

Try it

Loading example…

Use “Auto-Run All” to process all 4 stages, or “Advance Stage” to step through manually. Save checkpoints and restore them after resetting.

How it works

A 4-stage document processing pipeline (extract, summarize, classify, archive) with full checkpoint support using InMemoryCheckpointStore from @directive-run/ai.

  1. Checkpointing – Save pipeline state at any stage, restore it later to resume from that point
  2. Retry with Backoff – Failed stages retry with exponential backoff (500ms base, 2x multiplier, configurable max retries)
  3. Failure Injection – Force any stage to fail to observe retry behavior and pipeline halt after max retries exhausted
  4. Progress Tracking – Visual progress bar, per-stage token costs, and completion percentage derivation

Source code

main.ts
// Source file "main.ts" not found

Stay in the loop. Sign up for our newsletter.

We care about your data. We'll never share your email.

Powered by Directive. This signup uses a Directive module with facts, derivations, constraints, and resolvers – zero useState, zero useEffect. Read how it works