Effective way to enable modular filtering pipeline

Well I was considering something like psuedo code:

Stream
...
|> Stream.filter(
  fn payload ->
    filter_fun = config.get_filter(payload['id'])
    filter_fun(payload)
  end)

Where the config would have a mapping of id → required function:

id_1: &Filters.filter_fun_1/1

However, I don’t know of an ‘official’ way to choose functions for filtering.