Hi <@U0AAGJ8MM1C>. Sorry for a long response. The ...
# koog-agentic-framework
s
Hi @Chrylo. Sorry for a long response. The
parallel
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.:
Copy code
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(...)

...