defmodule ArcadiaCloud.Provisioning.Steps.Echo do @moduledoc """ Trivial proof-of-concept step. Reads `:echo_value` from saga inputs and copies it to context under a step-specific key so subsequent steps can see it. Used by engine smoke tests only — not for real workloads. """ @behaviour ArcadiaCloud.Provisioning.Step alias ArcadiaCloud.Provisioning.SagaState @impl true def name, do: "echo" @impl true def execute(state) do value = SagaState.get_input(state, :echo_value) || "default" {:ok, SagaState.put_output(state, "echoed_at_step_#{state.step_idx}", value)} end @impl true def compensate(state) do # Echo is reversible: we can simply forget what we wrote. No real # side-effects to undo. _ = state :ok end end