# `ExGram.FSM.Filter.Flow`
[🔗](https://github.com/rockneurotiko/ex_gram_fsm/blob/v0.1.0/lib/ex_gram/fsm/filter/flow.ex#L1)

An `ExGram.Router.Filter` that matches on the current active FSM flow name.

This filter is automatically registered as the `:fsm_flow` alias when
`use ExGram.FSM` detects that `use ExGram.Router` has also been called on
the same module.

## Usage

Combine with `:fsm_state` to scope routes to a specific flow and step:

    scope do
      filter :fsm_flow, :registration
      filter :fsm_state, :get_name
      filter :text
      handle &MyBot.Handlers.got_name/1
    end

    scope do
      filter :fsm_flow, :settings
      filter :fsm_state, :choose_language
      filter :text
      handle &MyBot.Handlers.set_language/1
    end

Match on "no active flow":

    scope do
      filter :fsm_flow, nil
      filter :command, :start
      handle &MyBot.Handlers.start/1
    end

## Options

- `nil` — matches when there is no active flow (`flow == nil`)
- `atom` — matches when `context.extra.fsm.flow == atom`

# `call`

```elixir
@spec call(term(), ExGram.Cnt.t(), atom() | nil) :: boolean()
```

Filter callback.

Returns `true` when the current FSM flow name equals `expected_flow`.

---

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