Compiles a portable definition into an executable Baton workflow.
Summary
Functions
Validate, load context, and compile a portable definition.
Functions
@spec compile( Baton.Flow.Definition.t(), keyword() ) :: {:ok, Baton.Flow.Compiled.t()} | {:error, term()}
Validate, load context, and compile a portable definition.
Options
:input— the run's input map, resolvable as$inputbindings.:definition_ref— an opaque host reference recorded in the snapshot.:name— overrides the workflow name.:context— a preloaded context map (skips the context provider).:transport—"live"or"batch": the default transport for everyllmnode that doesn't declare one, so a single definition serves an interactive run (no override) and a bulk overnight run ("batch") without a second copy. A node's own explicit"transport"always wins — that is how a flow pins, say, a cheap synthesis step live even in a batch run.:poll_interval,:batch_deadline— seconds; defaults for nodes that end up batched and don't set their own. Tuning belongs to the run — a bulk runner that queues into a coalescer knows how much headroom the deadline needs; the definition doesn't.:seed_steps—%{step_name => result}: results supplied up front instead of computed by jobs. A dep naming a seeded step is satisfied at compile time, so a definition containing a single node — or only the suffix of a larger graph — compiles and runs with everything upstream seeded. Each seed is materialized as a realworkflow_nodesrow (seeded_atset, no Oban job) in the insert transaction, visible to$stepsbindings,Baton.Resultsscans, and dependency gating exactly like a completed step. For a fanned-out upstream node, either seed the fan-in — the ordered list of expansion envelopes under the logical id, which is the shape dependents' bindings consume — or seed each expansion under its own name and group them with:seed_fan_inbelow.:seed_fan_in—%{logical_id => [seeded expansion name, ...]}: which seeded steps stand in for one fanned-out upstream node. Dependents declare a dep on the logical id and get both halves of what a real fan-out gives them —$steps.<logical_id>as the ordered fan-in list, and one result per expansion under its own step name, which is what a result-scanning consumer (Baton.Results.get_all_results/1) reads. Seed the fan-in list under the logical id instead when only the bindings matter; use this when something downstream scans results by step name.:debug— force per-workflow debug capture (workflow_debug_logs), independent of the globalBaton.Debugsetting. WhatBaton.new/1'sdebug: truedoes, exposed at the compile boundary.
The override is merged before validation, so everything the validator
rejects about a transport — including "batch" on a sequential fan-out —
still fails the compile. Both the flow snapshot and each job's args carry
the merged config: what ran is what is recorded.