# TraconRunBudgetExceededException

> 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.traconrunbudgetexceededexception/
> Summary: TraconRunBudgetExceededException: Thrown when a run tree's budget runs out: its token or cost budget between two model turns, or a workflow step or function node that the budget refuses to start.

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

Thrown when a run tree's budget runs out: its token or cost budget between two
model turns, or a workflow step or function node that the budget refuses to start.

```csharp
public sealed class TraconRunBudgetExceededException : TraconException, ISerializable
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="https://learn.microsoft.com/dotnet/api/system.exception">Exception</a> ← <a href="/api/tracon.traconexception/">TraconException</a> ← <a href="/api/tracon.traconrunbudgetexceededexception/">TraconRunBudgetExceededException</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable">ISerializable</a></dd><dt>Inherited Members</dt><dd><a href="/api/tracon.traconexception/#Tracon_TraconException_ErrorType">TraconException.ErrorType</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.getbaseexception">Exception.GetBaseException()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.tostring">Exception.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.gettype">Exception.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.targetsite">Exception.TargetSite</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.message">Exception.Message</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.data">Exception.Data</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.innerexception">Exception.InnerException</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.helplink">Exception.HelpLink</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.source">Exception.Source</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.hresult">Exception.HResult</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.stacktrace">Exception.StackTrace</a>, <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

Thrown by the wrapper installed inside the tool-call loop, one layer
before the raw provider client; Microsoft Agent Framework's
function-invoking client does not catch it, so it propagates out of
`AIAgent.RunAsync`/`RunStreamingAsync` and fails the run.

This is a different fault from [AgentRunBudget](/api/tracon.agentrunbudget/) refusing to
reserve a *new child run* ([AgentRunBudget.TryReserveRun](/api/tracon.agentrunbudget/#Tracon_AgentRunBudget_TryReserveRun)):
for agent delegation that refusal is returned to the model as an ordinary
tool result and the calling agent can recover; this exception ends the run
that hit it.

A workflow step has no calling model to recover, so there the refused
reservation throws this exception too, and the workflow run ends
`Failed` with the same class as any other budget exhaustion.

A workflow function node is refused the same way, at its start, when the tree's
cost or time budget is already spent (the token budget does not stop a node). The
message says "Could not start function node" and names the setting to raise. A node
that is already running is never stopped by it, and the refusal is not retried.

A tool call is refused at its start when the tree's token, cost or time budget is spent.
The exception does not leave the tool: its message becomes the tool's result
("… The tool call did not start."), a streaming run records the call as failed, and the
run ends at its next model call. A tool call that has started is never stopped.

## Constructors

### <a id="Tracon_TraconRunBudgetExceededException__ctor"></a> TraconRunBudgetExceededException\(\)

Creates a new error.

```csharp
public TraconRunBudgetExceededException()
```

### <a id="Tracon_TraconRunBudgetExceededException__ctor_System_String_"></a> TraconRunBudgetExceededException\(string\)

Creates a new error.

```csharp
public TraconRunBudgetExceededException(string message)
```

#### Parameters

`message` [string](https://learn.microsoft.com/dotnet/api/system.string)

The error message.

### <a id="Tracon_TraconRunBudgetExceededException__ctor_System_String_System_Exception_"></a> TraconRunBudgetExceededException\(string, Exception\)

Creates a new error.

```csharp
public TraconRunBudgetExceededException(string message, Exception innerException)
```

#### Parameters

`message` [string](https://learn.microsoft.com/dotnet/api/system.string)

The error message.

`innerException` [Exception](https://learn.microsoft.com/dotnet/api/system.exception)

The underlying error.

## Fields

### <a id="Tracon_TraconRunBudgetExceededException_RunBudgetExceededErrorType"></a> RunBudgetExceededErrorType

The stable value written to [TraconException.ErrorType](/api/tracon.traconexception/#Tracon_TraconException_ErrorType).

```csharp
public const string RunBudgetExceededErrorType = "run_budget_exceeded"
```

#### Field Value

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

### <a id="Tracon_TraconRunBudgetExceededException_ErrorType"></a> ErrorType

Gets the stable error type name written to the run record.

```csharp
public override string ErrorType { get; }
```

#### Property Value

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

Defaults to the full name of the exception type, so today's behaviour does
not change. A derived type overrides this member when the record has to be
machine readable — for example [TraconContentFilteredException](/api/tracon.traconcontentfilteredexception/)
writes `content_filtered`. Reports and alert rules can rely on this
stable name instead of an assembly name.

The value is written to `RunError.Type` and **carries no secret**.
