Skip to content

IDagNodeResult

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Diagnostics

IDagNodeResult Interface

Diagnostics for a single node within a DAG workflow execution, including edge connectivity, timing offsets relative to the workflow start, and the NodeKind discriminator that distinguishes agent nodes from reducer nodes.

public interface IDagNodeResult

Example

var dagResult = (IDagRunResult)pipelineResult;
foreach (var (nodeId, node) in dagResult.NodeResults)
{
    Console.WriteLine($"  {nodeId}: {node.Kind}, " +
        $"offset={node.StartOffset.TotalMilliseconds}ms, " +
        $"duration={node.Duration.TotalMilliseconds}ms");
}

Remarks

Access node results via NodeResults after a DAG workflow run completes. Reducer nodes (Reducer) will have null diagnostics because they do not execute LLM calls.

Properties

IDagNodeResult.AgentName Property

Gets the agent or reducer name for the node.

string AgentName { get; }

Property Value

System.String

IDagNodeResult.Diagnostics Property

Gets the captured diagnostics for the node's execution, or null for reducer nodes or when diagnostics were not enabled.

NexusLabs.Needlr.AgentFramework.Diagnostics.IAgentRunDiagnostics? Diagnostics { get; }

Property Value

IAgentRunDiagnostics

IDagNodeResult.Duration Property

Gets the wall-clock duration of the node's execution.

System.TimeSpan Duration { get; }

Property Value

System.TimeSpan

IDagNodeResult.FinalResponse Property

Gets the final Microsoft.Extensions.AI.ChatResponse produced by this node, or null if the node is a reducer or produced no text response.

Microsoft.Extensions.AI.ChatResponse? FinalResponse { get; }

Property Value

Microsoft.Extensions.AI.ChatResponse

IDagNodeResult.InboundEdges Property

Gets the node IDs that feed into this node.

System.Collections.Generic.IReadOnlyList<string> InboundEdges { get; }

Property Value

System.Collections.Generic.IReadOnlyList<System.String>

IDagNodeResult.Kind Property

Gets whether this node is an LLM-backed agent or a deterministic reducer.

NexusLabs.Needlr.AgentFramework.Diagnostics.NodeKind Kind { get; }

Property Value

NodeKind

IDagNodeResult.NodeId Property

Gets the unique identifier of the node within the graph.

string NodeId { get; }

Property Value

System.String

IDagNodeResult.OutboundEdges Property

Gets the node IDs that this node feeds into.

System.Collections.Generic.IReadOnlyList<string> OutboundEdges { get; }

Property Value

System.Collections.Generic.IReadOnlyList<System.String>

IDagNodeResult.StartOffset Property

Gets the wall-clock offset from the workflow start to the node's start.

System.TimeSpan StartOffset { get; }

Property Value

System.TimeSpan