WorkflowStem.Runner (workflow_stem v0.3.0)

Copy Markdown View Source

Host-parameterized runner for Stepwise executions.

The runner owns the FSM walk, wait/resume loop, control checks, checkpoint hooks, and canonical event emission. Hosts provide persistence, live publication, and control-state implementations through adapter modules.

Summary

Types

opts()

@type opts() :: [
  tenant_id: String.t(),
  execution_id: String.t(),
  workflow_name: String.t(),
  speed: pos_integer(),
  control_store: module(),
  checkpoint_store: module(),
  event_sink: module(),
  engine: module(),
  next_event: (map() -> atom()),
  metadata: map()
]

Functions

replay(event_sink, tenant_id, execution_id, opts \\ [])

@spec replay(module() | nil, String.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, term()}

start(spec, inputs \\ %{}, opts \\ [])

@spec start(map(), map(), opts()) :: {:ok, String.t()} | {:error, term()}

start_from_runtime(runtime, opts \\ [])

@spec start_from_runtime(map(), opts()) :: {:ok, String.t()} | {:error, term()}