Skip to main content
@claritylabs/cl-pipelines v0.1.0 gives you durable execution primitives for deterministic agents and regulated workflows. Instead of hoping your long-running job finishes in one shot, you break it into named phases, persist a checkpoint after each one, and let the library resume exactly where you left off after any crash, timeout, or deployment restart.

What it does

Every pipeline run is a sequence of typed phases. After each phase completes, the library writes a serialized snapshot — a Checkpoint<TState> — to your storage layer before scheduling the next phase. If the process dies mid-flight, re-running the pipeline picks up from the last checkpoint automatically. You choose per-pipeline whether to resume from that checkpoint or discard it and start fresh.

How it differs from a job queue

A job queue handles scheduling — it decides when to hand a job to a worker. cl-pipelines is the execution model inside that job. It answers a different question: once your worker is running, how does multi-step work stay consistent across crashes? You can wire the library’s SchedulerAdapter directly to your existing queue; they compose rather than compete.

How it differs from agent frameworks

Most agent frameworks prescribe a graph structure (nodes, edges, routers) and bundle their own LLM client. cl-pipelines is runtime-agnostic, doesn’t prescribe graph shape, and drives LLM calls through the Vercel AI SDK’s provider-agnostic LanguageModel interface. If you already have a prompt/tool setup in AI SDK v6, the runAgent helper slots straight in.

When to use it

  • Multi-step document processing (extract → validate → enrich → publish)
  • Approval chains where each step may wait for human input
  • LLM agent loops that must survive crashes and resume mid-conversation
  • Any workflow where end users need visible, real-time progress

Key concepts

Quickstart

Build and run your first durable pipeline in minutes.

Core Concepts

Deep-dive into phases, checkpoints, retry modes, and adapters.

Convex Adapter

Wire cl-pipelines to Convex storage and scheduling.

Agent Loop

Run a crash-safe multi-turn LLM agent with tool calls.