# Belay v1.0.0 - Table of Contents

> Durable execution for Elixir on Postgres: step-resumable jobs, workflows, budgets, signals, and replay — without a separate workflow server.

## Pages

- [README](readme.md)
- [Formal verification](formal-verification.md)
- [Belay v2 — Standalone Design](design.md)
- [The Belay Wire Contract](schema.md)
- [Contributing to Belay](contributing.md)
- [Changelog](changelog.md)

- Guides
  - [Getting started](getting-started.md)
  - [Migrating from Oban](migrating-from-oban.md)
  - [Durable steps](durable-steps.md)
  - [Building agents on Belay](agents.md)
  - [Operations](operations.md)
  - [Testing](testing.md)
  - [How Belay compares](comparison.md)

## Modules

- [Belay](Belay.md): A standalone, agent-native durable job engine on Postgres (or in-memory for
tests). No Oban, no Ecto — Postgrex, Jason, and telemetry only.
- [Belay.Batch](Belay.Batch.md): Insert a group of jobs and run a callback when the whole group has finished
— thin, transparent sugar over `Belay.Workflow`.
- [Belay.Clock](Belay.Clock.md): Injectable time source. Everything time-dependent in the engine (backoff,
lease expiry, rate windows, await deadlines, cron slots) reads through this,
so tests advance a `Belay.Clock.Sim` instead of sleeping.

- [Belay.Clock.Sim](Belay.Clock.Sim.md): A settable, advanceable clock for deterministic tests.
- [Belay.Clock.System](Belay.Clock.System.md): Real time.
- [Belay.Codec](Belay.Codec.md): The cross-language value envelope for step values and job results
(SCHEMA.md, "Value encoding").
- [Belay.Config](Belay.Config.md): The resolved runtime configuration of a Belay instance.
- [Belay.CronExpr](Belay.CronExpr.md): Minimal five-field cron expressions: `minute hour day-of-month month day-of-week`.
- [Belay.Crons](Belay.Crons.md): Runtime cron management, persisted in the database, fired leaderlessly by
every node with per-slot dedup — change schedules without deploys.
- [Belay.Ctx](Belay.Ctx.md): Execution context passed to `c:Belay.Worker.run/1`. Carries the job and
everything the step/signal/budget APIs need. `replay?: true` marks a
`Belay.Replay` dry run: memoized reads succeed, side effects are inert,
and anything unrecorded halts with a precise report.

- [Belay.Dashboard](Belay.Dashboard.md): An embedded web dashboard with **zero dependencies** — no Phoenix, no Plug,
no JS build. One child spec
- [Belay.InputSchema](Belay.InputSchema.md): Insert-time input validation, declared on the worker
- [Belay.Job](Belay.Job.md): The durable job record.
- [Belay.MCP](Belay.MCP.md): A Model Context Protocol server over stdio, so AI assistants (Claude Code,
Cursor, or your own agents) can inspect and operate a Belay installation
- [Belay.Migrate.Oban](Belay.Migrate.Oban.md): Move an Oban installation's **pending work** into Belay.
- [Belay.Notifier](Belay.Notifier.md): Wake-up delivery for low-latency dispatch.
- [Belay.Notifier.Local](Belay.Notifier.Local.md): The always-on notifier: registry pokes on this node, `:pg` fan-out to
clustered BEAM nodes. Configured as `:local`.

- [Belay.Notifier.Postgres](Belay.Notifier.Postgres.md): The opt-in `pg_notify` accelerator (configured as `:postgres`): wake-ups
ride the database itself for fleets that share Postgres without an Erlang
cluster. See `Belay.Notifier` for semantics and caveats.

- [Belay.Queues](Belay.Queues.md): Runtime queue management, persisted in the database and applied by every
node — no leader, no deploy.
- [Belay.Replay](Belay.Replay.md): Time-travel debugging: re-run a job's *code* against its *recorded journal*.
- [Belay.Storage](Belay.Storage.md): The storage contract: coarse, semantic, individually-atomic operations.
- [Belay.Storage.Memory](Belay.Storage.Memory.md): In-memory storage: a single serialized GenServer, deterministic given call
order. The reference implementation for engine semantics and the substrate
for simulation tests. Not durable — for tests and ephemeral dev only.
- [Belay.Storage.Postgres](Belay.Storage.Postgres.md): Postgres storage over Postgrex — no Ecto. Claims use `FOR UPDATE SKIP
LOCKED`; workflow settlement and parent notification happen inside the
acking transaction; uniqueness is enforced by partial unique indexes; the
clock is always a query parameter, never `now()`.

- [Belay.Telemetry](Belay.Telemetry.md): Telemetry events emitted by Belay
- [Belay.Testing](Belay.Testing.md): Synchronous, deterministic execution for tests: `drain/3` claims and runs
ready jobs in the calling process until the queue is empty, following
workflow releases as they happen.

- [Belay.Txn](Belay.Txn.md): Transactional enqueue: insert jobs inside **your** database transaction, so
a job exists if and only if the business write committed.
- [Belay.Worker](Belay.Worker.md): Define a durable worker.
- [Belay.Workflow](Belay.Workflow.md): Jobs composed with directed acyclic dependencies.

- Exceptions
  - [Belay.InputError](Belay.InputError.md): Raised at insert time when a job's input fails its worker's `input_schema`.

## Mix Tasks

- [mix belay.mcp](Mix.Tasks.Belay.Mcp.md): Serve the Belay MCP server over stdio against a Postgres database
- [mix belay.migrate_oban](Mix.Tasks.Belay.MigrateOban.md): Move pending Oban work into Belay, safely.

