Separate instance of Flow per substream when using groupBy

Hi!
I have a question about akka-streams , especially groupBy and state in substream
I have a stream

source
  .groupBy(maxNumberOfSubstreams, _.hashingId)
  .mapAsyncUnordered(config.parallelismPerSubstream)(processEvent)
  .map(processResult)
  .via(throughputLimiterFlow(throughputLimiterConfig))
  .to(Sink.ignore)

I noticed that even I have many substreams from groupBy , throughputLimiterFlow(throughputLimiterConfig) is initialised only once, is there possibility to instantiate it for each substream - this flow contains some processing stats (ratio of processing errors/successes)

Thanks for any suggestions

Looks like Flow.lazyFlow is sth that I was looking for:

source
  .groupBy(maxNumberOfSubstreams, _.hashingId)
  .mapAsyncUnordered(config.parallelismPerSubstream)(processEvent)
  .map(processResult)
  .via(Flow.lazyFlow(() => throughputLimiterFlow(throughputLimiterConfig)))
  .to(Sink.ignore)

While lazyFlow is a solution, it comes with some overhead, in general you should prefer making your flow blueprints stateless/re-usable and keep state in the materialized operators (GraphStageLogic for custom GraphStages) if possible.