Skip to content

IGraphWorkflowRunner

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework

IGraphWorkflowRunner Interface

Executes DAG/graph workflows declared via AgentGraphEntryAttribute, AgentGraphEdgeAttribute, and AgentGraphNodeAttribute.

public interface IGraphWorkflowRunner

Remarks

Registered as a singleton by UsingAgentFramework(). Inject via constructor or resolve from IServiceProvider.

The runner automatically selects the execution strategy based on declared topology. Graphs using only WaitAll nodes execute via MAF's native BSP engine. Graphs containing any WaitAny node or LlmChoice routing use Needlr's own executor.

Methods

IGraphWorkflowRunner.RunGraphAsync(string, string, IProgressReporter, CancellationToken) Method

Executes a graph/DAG workflow by name.

System.Threading.Tasks.Task<NexusLabs.Needlr.AgentFramework.Diagnostics.IDagRunResult> RunGraphAsync(string graphName, string input, NexusLabs.Needlr.AgentFramework.Progress.IProgressReporter? progress=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

graphName System.String

The graph name (case-sensitive). Must match the GraphName and GraphName values on at least one agent type.

input System.String

The input message to send to the entry node.

progress IProgressReporter

Optional progress reporter for real-time execution events.

cancellationToken System.Threading.CancellationToken

Cancellation token.

Returns

System.Threading.Tasks.Task<IDagRunResult>
An IDagRunResult containing per-node diagnostics, edge metadata, timing offsets, and aggregate token usage.