Skip to content

GraphRoutingMode

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework

GraphRoutingMode Enum

Controls how a source node selects which outgoing edges to follow in a graph workflow.

public enum GraphRoutingMode

Fields

Deterministic 0

Condition strings reference predicate methods on the agent class. Each edge condition is evaluated as a Func<object?, bool>. Edges without conditions are unconditional (always followed).

AllMatching 1

All edges whose condition passes are followed in parallel (fan-out). When multiple conditions are true, all matching targets execute concurrently.

FirstMatching 2

Edges are evaluated in declaration order; only the first matching edge is followed. This is a Needlr abstraction — MAF has no ordered-priority routing primitive.

ExclusiveChoice 3

Exactly one edge must match. Maps to MAF's AddSwitch with AddCase per edge. An analyzer error is emitted if conditions are ambiguous at compile time.

LlmChoice 4

Condition strings become handoff-style tool descriptions. The agent's LLM selects which edge to follow. The routing decision is recorded in diagnostics for auditability.