conditionalEdge

fun <T> conditionalEdge(from: String, router: (T) -> String)(source)

Define a conditional edge for dynamic routing.

The router function receives the output of the source node and returns the name of the target node.

Parameters

from

Source node name

router

Function that determines target node