Sergei Dubov
02/17/2026, 10:39 AMparallel API requires to specify the merge parameter that return an instance of a special internal type ParallelNodeExecutionResult<Output> where <Output> defines the common output type for the nodes running in parallel. It is done to get a result in a common way. If you need to “Do something else” in the flow, just make sure it will result the same type at the end <Output> . You can do it with a simple transformed method when composing edges, e.g.:
val nodeString by subgraph<Unit, String>("subgraph-2") {
val node by node<Unit, String>("s1-node1") { "first" }
nodeStart then node then nodeFinish
}
val nodeInt by subgraph<Unit, String>("subgraph-2") {
val node by node<Unit, String>("s2-node1") { 2 }
edge(nodeStart forwardTo node)
edge(node forwardTo nodeFinish transformed { it.toString() })
}
val parallelNode by parallel(...)
...