API Reference Baton v#0.27.4

Copy Markdown View Source

Modules

Build and insert DAG-based Oban job workflows.

Starts when the :baton dependency starts and attaches Baton's telemetry handlers, so they are active whether or not the host installs Baton.Plugin.

A large step result spilled out of workflow_nodes.

A snooze-free view of a job's retry counters.

Runtime dependency resolution for workflow jobs.

Detects when a whole workflow has finished and announces it exactly once.

Event-driven backstop for the terminal {:workflow_finished, _} notification.

Runtime configuration and repo resolution.

Directed Acyclic Graph validation for workflow step definitions.

Capture and inspect full LLM context windows at each workflow step.

Schema for capturing full LLM request/response payloads per workflow step.

Wakes Oban producers immediately for queues that have newly-available jobs.

PubSub broadcasting for workflow step lifecycle events.

Mid-run fan-out: one running step turns a list it could not know at build time into one job per item, then waits for them.

Declarative flows: describe a DAG once as a list of Baton.Flow.Steps, then either build it into an executable Baton workflow or project it into a node/edge graph for display. Single-sourcing the two means they can't drift.

A host-owned, allow-listed domain operation invoked by an action flow node.

Resolves portable flow bindings against a JSON-compatible runtime environment.

The validated, context-loaded result of compiling a portable flow definition.

Compiles a portable definition into an executable Baton workflow.

Host contract for loading a flow's domain context from its portable input.

The portable, versioned source representation of a Baton flow.

Declares that one logical Baton.Flow.Step expands to one Baton node per item in a collection drawn from the build subject.

A JSON-compatible fan-out declaration.

The host-side contract for a node's guards (see Baton.Flow.NodeSpec).

Host extension contract for portable LLM nodes that need domain preparation.

A portable node in a serialized Baton.Flow.Definition.

Host contract for resolving and rendering a portable prompt specification.

Host allow-list for portable action and LLM-adapter keys.

Assemble a generic llm node's provider request from its config and a runtime environment — as a pure function, shared by execution and preview.

One declarative step in a Baton.Flow: the worker that runs it, its logical dependencies, an optional Baton.Flow.FanOut, and an opaque meta bag.

Validates portable flow definitions before compilation or execution.

Generic worker that invokes an allow-listed host action.

Runs a flow node whose fan-out collection is only knowable at run time.

Generic LLM worker driven by a portable flow node specification.

The contract between Baton and whatever actually talks to a model provider.

A structured contract for LLM workflow steps: you describe the request and how to handle the decoded response — the engine owns everything in between.

Base module for workflow steps that call an LLM API.

Installs and updates Baton's database schema.

Multi-model fan-out pattern for workflow steps.

A single step within a workflow DAG.

All database access for workflow_nodes.

Oban plugin that keeps workflows healthy.

Behaviour for computing the cost of an LLM call.

A reference Baton.Pricing implementation with a small built-in price table (USD per million tokens).

Read queries powering the Workflow LiveView dashboard.

A pluggable pre-call gate for token throughput.

The default Baton.RateLimiter: reserves nothing, snoozes never. Wired unless a host configures config :baton, rate_limiter: MyModule.

Completion-triggered rescheduling of downstream workflow jobs.

Wakes downstream steps the instant a step completes, instead of waiting for the Stager.

Optional, node-local read cache for resolved (decoded) large step results.

Tiered storage for step results, with a pluggable large-payload backend.

Built-in Baton.ResultStore backend — stores large step results in the workflow_artifacts table.

Pass structured results between workflow steps.

Deletes Baton's own rows once the Oban job they belong to is gone.

Record and query LLM usage statistics per workflow step.

Ecto schema for per-step LLM usage stats.

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.

Drop-in replacement for Oban.Worker with DAG dependency gating, result passing, PubSub broadcasting, and retry idempotency.

Immutable authored and compiled flow snapshots for one Baton workflow execution.

Persistence and retrieval of portable-flow execution snapshots.