# WorkflowRegistrationOptions

> 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.workflowregistrationoptions/
> Summary: WorkflowRegistrationOptions: The settings of a workflow defined in code, passed to TraconWorkflowsBuilderExtensions.AddWorkflow.

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

The settings of a workflow defined in code, passed to
[TraconWorkflowsBuilderExtensions.AddWorkflow](/api/tracon.traconworkflowsbuilderextensions/).

```csharp
public sealed class WorkflowRegistrationOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.workflowregistrationoptions/">WorkflowRegistrationOptions</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

A stored workflow carries the same settings in its [WorkflowDefinition](/api/tracon.workflowdefinition/); a
workflow defined in code has no definition, so it chooses them here, once, when it is
registered.

## Constructors

### <a id="Tracon_WorkflowRegistrationOptions__ctor"></a> WorkflowRegistrationOptions\(\)

```csharp
public WorkflowRegistrationOptions()
```

## Properties

### <a id="Tracon_WorkflowRegistrationOptions_Description"></a> Description

Gets or sets a short description shown in the catalog.

```csharp
public string? Description { get; set; }
```

#### Property Value

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

Gets or sets the run parameters the workflow accepts. Empty (the default) takes none.

```csharp
public IReadOnlyList<AgentParameter> Parameters { get; set; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[AgentParameter](/api/tracon.agentparameter/)\>

#### Remarks

The same schema as [WorkflowDefinition.Parameters](/api/tracon.workflowdefinition/#Tracon_WorkflowDefinition_Parameters), with the same rules: the run's
`parameters` are checked against it before the first node runs (the HTTP endpoint answers
`400` early), an unknown name, a missing required value and an over-long value are refused, a
queued run carries the values, and a run that is resumed or answered continues with the values it
started with. A function node reads them with `context.GetRunParameters`; an agent step
receives only the names its own agent declares.

A parameter is for identity and instruction, not for payload: pass an id and let the nodes load what
they need. Without a schema every value is refused as unknown, as before. The registration is checked
when it is made: a name that is not an identifier, or a repeated name, throws
[ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception). The required parameters of a step's agent are checked when the step
runs, not before the run starts as they are for a stored workflow, because the graph is built in code
and its steps are not known until it is built.

### <a id="Tracon_WorkflowRegistrationOptions_RequestTimeout"></a> RequestTimeout

Gets or sets how long a human request of the workflow may wait for an answer before the
run that waits on it is closed. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) (the default) means it waits
without limit.

```csharp
public TimeSpan? RequestTimeout { get; set; }
```

#### Property Value

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

The same setting as [WorkflowDefinition.RequestTimeout](/api/tracon.workflowdefinition/#Tracon_WorkflowDefinition_RequestTimeout); its remarks apply.
A run that waits for a human keeps its request event, its checkpoints and its input row
until it is answered or closed. The limit is what lets a request nobody answers release
them. Must be from one minute to 365 days.

A workflow defined in code has no versions, so a run that waits takes the limit from the
registration of the process that started it: a deployment that changes this value does
not move the time of a request that was already published.

### <a id="Tracon_WorkflowRegistrationOptions_ResponseMode"></a> ResponseMode

Gets or sets how the workflow treats more than one answer to the same pending human
request. [WorkflowResponseMode.Branch](/api/tracon.workflowresponsemode/) (the default) opens a new run for
every answer; [WorkflowResponseMode.SingleAnswer](/api/tracon.workflowresponsemode/) allows one answer per
request.

```csharp
public WorkflowResponseMode ResponseMode { get; set; }
```

#### Property Value

 [WorkflowResponseMode](/api/tracon.workflowresponsemode/)

#### Remarks

A graph built in code asks for human input through a `RequestPort`; this setting
applies to every request the graph publishes.

### <a id="Tracon_WorkflowRegistrationOptions_RunTimeout"></a> RunTimeout

Gets or sets how long one run of the workflow may take. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) (the default) uses
`Tracon:Workflows:RunTimeout`.

```csharp
public TimeSpan? RunTimeout { get; set; }
```

#### Property Value

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

The same setting as [WorkflowDefinition.RunTimeout](/api/tracon.workflowdefinition/#Tracon_WorkflowDefinition_RunTimeout), with the same rule: it shortens the
installation's run timeout, and it may lengthen it only up to `Tracon:Workflows:MaxRunTimeout`.
The time counts the wait for a run slot. A workflow that reaches it ends `Canceled` and the
error names this setting.

**A value above the ceiling stops the host at startup** with an error that names the
workflow: the value comes with the deployment, and a deployment that cannot honour it should not start
and cut every run silently. If the ceiling is lowered later (a configuration reload), a run is cut to
the new ceiling and the cut is logged. Must be from 1 millisecond to about 49.7 days.
