Class FlowDSL

java.lang.Object
com.tnsai.coordination.flow.FlowDSL

public final class FlowDSL extends Object
Parses a string-based flow definition into a DAG of agent routing steps.

Syntax:

  • a -> b — sequential: a's output feeds b
  • a -> b, c — fan-out: a sends to b and c in parallel
  • a, b -> c — fan-in: c waits for both a and b
  • (a, b) -> c — explicit parallel group

Example: "researcher -> writer, editor -> reviewer"

   researcher ──→ writer  ──→ reviewer
              └─→ editor ─┘
 

Inspired by Swarms' AgentRearrange (einsum-style) pattern.

  • Method Details

    • parse

      public static FlowGraph parse(String flow)
      Parses a flow definition string into a FlowGraph.
      Parameters:
      flow - the flow definition (e.g. "a -> b, c -> d")
      Returns:
      parsed flow graph
      Throws:
      FlowDSL.FlowParseException - if the syntax is invalid