# `Finitomata.State`
[🔗](https://github.com/am-kantox/finitomata/blob/v0.35.0/lib/finitomata.ex#L341)

Carries the state of the FSM.

# `last_error`

```elixir
@type last_error() ::
  %{
    state: Finitomata.Transition.state(),
    event: Finitomata.Transition.event(),
    error: any()
  }
  | nil
```

The map that holds last error which happened on transition (at given state and event).

# `parent`

```elixir
@type parent() :: nil | pid()
```

The parent process for this particular FSM implementation

# `payload`

```elixir
@type payload() :: any()
```

The payload that has been passed to the FSM instance on startup

# `t`

```elixir
@type t() :: %Finitomata.State{
  name: Finitomata.fsm_name(),
  finitomata_id: Finitomata.id(),
  parent: parent(),
  lifecycle: :loaded | :created | :failed | :unknown,
  persistency: nil | module(),
  listener: nil | module(),
  current: Finitomata.Transition.state(),
  payload: payload(),
  timer: false | {reference(), pos_integer()},
  cache_state: boolean(),
  hibernate: boolean() | [Finitomata.Transition.state()],
  history: [Finitomata.Transition.state()],
  last_error: last_error()
}
```

The internal representation of the FSM state

# `excerpt`

Exposes the short excerpt from state of FSM which is log-friendly

---

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