Baton.Flow.FanOut (Baton v0.27.4)

Copy Markdown View Source

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

gate controls scheduling within the expansion:

  • :parallel — every expanded node carries the step's declared deps, so they all run concurrently once those deps settle.
  • :sequential — every expanded node carries the declared deps, and each is additionally sequenced after the previous one, chaining the expansion. Choose this when the expanded nodes share a cacheable prompt prefix (or you are smoothing a rate limit): the first call primes it and the rest read. Formerly named :warm_first, still accepted as a legacy alias.

The chaining edge orders, it does not depend: no data flows from one expansion to the next, so a branch that fails permanently releases the gate rather than cancelling everything behind it. Only the declared deps can fail an expansion. See Baton.Check.

Summary

Types

t()

@type t() :: %Baton.Flow.FanOut{
  collection: (subject :: term() -> [item :: term()]),
  gate: :parallel | :sequential,
  item_args: (item :: term() -> map()),
  suffix: (item :: term() -> term())
}