Raxol.Workflow.Node.FunctionNode (Raxol v2.6.0)

View Source

A node backed by a 1-arity function.

The optional :compensate_fun is invoked when the run fails under failure_policy: :compensate and this node had already succeeded. It receives the current state and returns {:ok, new_state} | {:error, reason}.

Summary

Types

t()

@type t() :: %Raxol.Workflow.Node.FunctionNode{
  compensate_fun: (any() -> {:ok, any()} | {:error, any()}) | nil,
  fun: (any() -> any()),
  id: Raxol.Workflow.Node.id()
}