Jido.Flow.Dispatch (Jido Action v3.0.0-beta.12)

View Source

A Flow component that can choose what runs next.

Dispatch calls its decision Action and passes that result to its expander Action. A normal expander result completes the Flow. A continuation ends the current Flow and selects the next executable for the same Jido.Exec call.

A Flow can contain at most one Dispatch component. It must be the final component and the complete Flow output.

Summary

Functions

Builds and validates one canonical Dispatch component.

Builds one canonical Dispatch component or raises its validation error.

Types

t()

@type t() :: %Jido.Flow.Dispatch{
  decision: atom(),
  expander: atom(),
  meta: map(),
  name: binary(),
  needs: [binary()],
  params: any()
}

Functions

new(dispatch)

@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, Exception.t()}

Builds and validates one canonical Dispatch component.

new!(attrs)

@spec new!(map() | keyword() | t()) :: t() | no_return()

Builds one canonical Dispatch component or raises its validation error.