I understand in Akka Stream one outlet must be connected to one inlet and there is no automatic support for connecting multiple sinks to the same source. So you have to insert intermediate objects such as
The GraphDSL does not allow to mutate your shape dynamically.
However, since Akka 2.4.10 you can use BroadcastHub (and MergeHub).
BroadcastHub can give you a Sink that materializes into a Source. This Source can in turn be materialized as many times as needed to dynamically attach multiple subscribers.
So for a node of your DAG (e.g. having indegree=1 and outdegree=3), you could have something like
val hubSource = inEdgeSource.toMat(BroadcastHub.sink(bufferSize = ...))(Keep.right).run() val nodeSink1 = hubSource.to(outEdgeSink1).run() val nodeSink2 = hubSource.to(outEdgeSink2).run() val nodeSink3 = hubSource.to(outEdgeSink3).run()