Caravela.Flow.Steps (Caravela v0.9.0)

Copy Markdown View Source

Step primitives that make up a flow tree.

A compiled flow is a nested tree of these structs (typically rooted at Sequence or Repeat). Caravela.Flow.Runner walks the tree, one step at a time, updating the flow state and notifying listeners as it goes.

Semantic overview (Ballerina mapping in parens)

  • Sequence (Co.Seq) — run inner steps in order
  • Repeat (Co.Repeat) — loop the inner step forever
  • Wait (Co.Wait) — pause for a fixed duration
  • WaitUntil (Co.While) — block until a predicate over state becomes true
  • Debounce — pause, but reset the timer if state changes during the pause
  • SetState (Co.SetState) — mutate state synchronously
  • Run (Co.Await) — invoke async work with optional retry
    • backoff
  • Parallel (Co.All) — run a list of tasks concurrently, collect all results into a state key
  • Race (Co.Any) — run tasks concurrently, keep the first result
  • Each (Co.For) — iterate a collection already in state

Each struct holds only data (funs + configs). Interpretation lives in Caravela.Flow.Runner.