# LoopOutcome

> 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.loopoutcome/
> Summary: LoopOutcome: What a harness loop does when it ends without every criterion satisfied: return the last response, or fail the run.

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

What a harness loop does when it ends without every criterion satisfied: return
the last response, or fail the run.

```csharp
[JsonConverter(typeof(JsonStringEnumConverter<LoopOutcome>))]
public enum LoopOutcome
```

## Fields

`FailRun = 1` 

The run fails. A workflow that runs the agent stops at that node, and a caller
gets the error instead of a response no criterion accepted.

`ReturnLastResponse = 0` 

The loop stops and the run returns the last response as a success. The default,
and the behavior before these settings existed.

## Remarks

Read by [LoopSettings.OnExhausted](/api/tracon.loopsettings/#Tracon_LoopSettings_OnExhausted) (the iteration ceiling is reached
while a criterion still asks for another iteration) and
[LoopSettings.OnCriterionError](/api/tracon.loopsettings/#Tracon_LoopSettings_OnCriterionError) (a criterion throws while it is
evaluated). The two are set independently: "the judge could not be reached,
keep the answer" and "the judge said no, stop" are different needs.

Written **as a name** in JSON (`"FailRun"`), like every other
definition enum. A numeric value that is not a member fails the definition when it
is compiled.
