Synaptic.Runner (synaptic v0.2.6)

View Source

GenServer that executes a workflow definition, tracking context, waiting states, retries, history, PubSub events, and suspend/resume logic.

Summary

Types

state()

@type state() :: %{
  run_id: String.t(),
  workflow: module(),
  steps: [Synaptic.Step.t()],
  current_step_index: non_neg_integer(),
  context: map(),
  status: :running | :waiting_for_human | :completed | :failed | :stopped,
  waiting: map() | nil,
  history: [map()],
  retry_budget: map(),
  last_error: term(),
  async_tasks: %{
    optional(pid()) => %{step: Synaptic.Step.t(), monitor_ref: reference()}
  }
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

history(run_id)

resume(run_id, payload)

snapshot(run_id, timeout \\ 5000)

start_link(opts)

stop(run_id, reason \\ :canceled)