# `Ussd.Action`
[🔗](https://github.com/spesohq/ussd/blob/main/lib/ussd/action.ex#L1)

A one-shot decision point that runs once, with no screen shown to the caller, and
resolves to the next module in the flow.

Useful when the next state can't be expressed as a static `transition/2` - e.g. it
depends on an HTTP call or a database lookup:

    defmodule MyApp.Actions.LoadAccount do
      @behaviour Ussd.Action

      @impl Ussd.Action
      def execute(context) do
        case Accounts.find(Ussd.Context.get(context, :phone)) do
          {:ok, _account} -> MyApp.States.Dashboard
          :error -> MyApp.States.Registration
        end
      end
    end

The engine keeps calling `execute/1` while the result is itself an `Ussd.Action`,
so actions can chain, and stops once it reaches a real `Ussd.State`.

# `execute`

```elixir
@callback execute(Ussd.Context.t()) :: module()
```

Resolves the next module in the flow: another `Ussd.Action` to keep chaining, or a `Ussd.State` to render.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
