# Baton v0.1.0 - Table of Contents

> DAG-based job workflows for Oban: dependency ordering, fan-out/synthesis, result passing, retry idempotency, and per-step LLM cost tracking — without Oban Pro.

## Pages

- [README](readme.md)
- [Changelog](changelog.md)

- Guides
  - [Getting Started](getting_started.md)
  - [Building a Workflow](building_a_workflow.md)
  - [Multi-Model Workflows](multi_model.md)

## Modules

- [Baton.DebugLog](Baton.DebugLog.md): Schema for capturing full LLM request/response payloads per workflow step.
- [Baton.Pricing.Default](Baton.Pricing.Default.md): A reference `Baton.Pricing` implementation with a small built-in price
table (USD per million tokens).
- [Baton.StepStat](Baton.StepStat.md): Ecto schema for per-step LLM usage stats.

- Building Workflows
  - [Baton](Baton.md): Build and insert DAG-based Oban job workflows.
  - [Baton.MultiModel](Baton.MultiModel.md): Multi-model fan-out pattern for workflow steps.

- Execution
  - [Baton.Check](Baton.Check.md): Runtime dependency resolution for workflow jobs.
  - [Baton.LLMWorker](Baton.LLMWorker.md): Base module for workflow steps that call an LLM API.
  - [Baton.Results](Baton.Results.md): Pass structured results between workflow steps.
  - [Baton.Worker](Baton.Worker.md): Drop-in replacement for `Oban.Worker` with DAG dependency gating,
result passing, PubSub broadcasting, and retry idempotency.

- Observability
  - [Baton.Debug](Baton.Debug.md): Capture and inspect full LLM context windows at each workflow step.
  - [Baton.Events](Baton.Events.md): PubSub broadcasting for workflow step lifecycle events.
  - [Baton.Query](Baton.Query.md): Read queries powering the Workflow LiveView dashboard.
  - [Baton.Stats](Baton.Stats.md): Record and query LLM usage statistics per workflow step.
  - [Baton.Telemetry](Baton.Telemetry.md): Telemetry is Baton's primary integration surface. The PubSub events and
LiveView dashboard are optional layers on top; everything observable is also
emitted as telemetry, so you can integrate without Phoenix.

- Infrastructure
  - [Baton.Config](Baton.Config.md): Runtime configuration and repo resolution.
  - [Baton.Migration](Baton.Migration.md): Installs and updates Baton's database schema.
  - [Baton.Plugin](Baton.Plugin.md): Oban plugin that keeps workflows healthy.
  - [Baton.Pricing](Baton.Pricing.md): Behaviour for computing the cost of an LLM call.
  - [Baton.Retention](Baton.Retention.md): Deletes Baton's own rows once the Oban job they belong to is gone.

- Internals
  - [Baton.Completion](Baton.Completion.md): Detects when a whole workflow has finished and announces it exactly once.
  - [Baton.DAG](Baton.DAG.md): Directed Acyclic Graph validation for workflow step definitions.
  - [Baton.Node](Baton.Node.md): A single step within a workflow DAG.
  - [Baton.Nodes](Baton.Nodes.md): All database access for `workflow_nodes`.
  - [Baton.Reschedule](Baton.Reschedule.md): Completion-triggered rescheduling of downstream workflow jobs.

