# WorkflowGraph

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.workflowgraph/
> Summary: WorkflowGraph: Represents a workflow's compiled graph: nodes, edges, and external request ports.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Represents a workflow's compiled graph: nodes, edges, and external
request ports.

```csharp
public sealed record WorkflowGraph : IEquatable<WorkflowGraph>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.workflowgraph/">WorkflowGraph</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;WorkflowGraph&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

The graph is extracted from the **compiled workflow, not the
definition**. The reason was measured: built-in patterns add
executors the user did not write (`OutputMessages`,
`Batcher/*`, `ConcurrentEnd`, `HandoffStart`,
`GroupChatHost`, `MagenticOrchestrator`). A graph drawn from
the definition would not show these nodes, and the `ExecutorInvoked`
events arriving during a run would not match any node.

The type carries no Microsoft Agent Framework type: the HTTP layer does
not depend on the `Tracon.Workflows` package.

## Constructors

### <a id="Tracon_WorkflowGraph__ctor"></a> WorkflowGraph\(\)

```csharp
public WorkflowGraph()
```

## Properties

### <a id="Tracon_WorkflowGraph_Edges"></a> Edges

Gets the edges between nodes.

```csharp
public IReadOnlyList<WorkflowGraphEdge> Edges { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[WorkflowGraphEdge](/api/tracon.workflowgraphedge/)\>

### <a id="Tracon_WorkflowGraph_Mermaid"></a> Mermaid

Gets the Mermaid text produced by Microsoft Agent Framework.

```csharp
public required string Mermaid { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Remarks

The UI draws the graph itself (bundle budget); this text is
for *export*. Users can copy it to the clipboard and paste it
into a document - project convention requires diagrams to be written
in Mermaid.

### <a id="Tracon_WorkflowGraph_Name"></a> Name

Gets the name of the workflow the graph belongs to.

```csharp
public required string Name { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_WorkflowGraph_Nodes"></a> Nodes

Gets the nodes in the graph.

```csharp
public IReadOnlyList<WorkflowGraphNode> Nodes { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[WorkflowGraphNode](/api/tracon.workflowgraphnode/)\>

### <a id="Tracon_WorkflowGraph_StartExecutorId"></a> StartExecutorId

Gets the identifier of the node that receives the input message first.

```csharp
public required string StartExecutorId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### <a id="Tracon_WorkflowGraph_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_WorkflowGraph_Equals_Tracon_WorkflowGraph_"></a> Equals\(WorkflowGraph?\)

```csharp
public bool Equals(WorkflowGraph? other)
```

#### Parameters

`other` [WorkflowGraph](/api/tracon.workflowgraph/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_WorkflowGraph_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_WorkflowGraph_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_WorkflowGraph_op_Equality_Tracon_WorkflowGraph_Tracon_WorkflowGraph_"></a> operator ==\(WorkflowGraph?, WorkflowGraph?\)

```csharp
public static bool operator ==(WorkflowGraph? left, WorkflowGraph? right)
```

#### Parameters

`left` [WorkflowGraph](/api/tracon.workflowgraph/)?

`right` [WorkflowGraph](/api/tracon.workflowgraph/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_WorkflowGraph_op_Inequality_Tracon_WorkflowGraph_Tracon_WorkflowGraph_"></a> operator \!=\(WorkflowGraph?, WorkflowGraph?\)

```csharp
public static bool operator !=(WorkflowGraph? left, WorkflowGraph? right)
```

#### Parameters

`left` [WorkflowGraph](/api/tracon.workflowgraph/)?

`right` [WorkflowGraph](/api/tracon.workflowgraph/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
