# WorkflowFunctionStepOptions

> 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.workflowfunctionstepoptions/
> Summary: WorkflowFunctionStepOptions: The settings of one function node in a workflow graph built in code, passed to WorkflowFunctionBinding.GetWorkflowFunction.

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

The settings of one function node in a workflow graph built in code, passed to
[WorkflowFunctionBinding.GetWorkflowFunction](/api/tracon.workflowfunctionbinding/).

```csharp
public sealed class WorkflowFunctionStepOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.workflowfunctionstepoptions/">WorkflowFunctionStepOptions</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 two values in a [WorkflowNodeReference](/api/tracon.workflownodereference/); a graph built
in code has no node reference, so it chooses them here. A callback with properties rather than optional
parameters, for the reason [WorkflowFunctionOptions](/api/tracon.workflowfunctionoptions/) gives.

## Constructors

### <a id="Tracon_WorkflowFunctionStepOptions__ctor"></a> WorkflowFunctionStepOptions\(\)

```csharp
public WorkflowFunctionStepOptions()
```

## Properties

### <a id="Tracon_WorkflowFunctionStepOptions_Settings"></a> Settings

Gets or sets the node's settings as a JSON object. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) (the default) is a node
without settings.

```csharp
public JsonElement? Settings { get; set; }
```

#### Property Value

 [JsonElement](https://learn.microsoft.com/dotnet/api/system.text.json.jsonelement)?

#### Remarks

Read into the settings type the function declares (`AddWorkflowFunction<TInput, TOutput, TSettings>`)
with the strict read a stored node's settings get: an unknown field, a missing `required` member
and a value of the wrong type are refused when the graph is built, naming the node and the member.
A function that declares no settings refuses any.

To pass a typed value instead of JSON, call [WorkflowFunctionStepOptions.SetSettings`](/api/tracon.workflowfunctionstepoptions/).

### <a id="Tracon_WorkflowFunctionStepOptions_Timeout"></a> Timeout

Gets or sets the longest time one call of the node may take. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) (the default)
uses the timeout the function was registered with, if any.

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

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

The same setting as [WorkflowNodeReference.Timeout](/api/tracon.workflownodereference/#Tracon_WorkflowNodeReference_Timeout); it wins over
[WorkflowFunctionOptions.Timeout](/api/tracon.workflowfunctionoptions/#Tracon_WorkflowFunctionOptions_Timeout), and its remarks apply: the token the handler was
given is cancelled when the time is up, and each attempt of a retried node has the whole time.
Must be from one millisecond to about 49.7 days.

## Methods

### <a id="Tracon_WorkflowFunctionStepOptions_SetSettings__1___0_"></a> SetSettings<TSettings\>\(TSettings\)

Sets [WorkflowFunctionStepOptions.Settings](/api/tracon.workflowfunctionstepoptions/#Tracon_WorkflowFunctionStepOptions_Settings) from a typed value.

```csharp
public void SetSettings<TSettings>(TSettings settings) where TSettings : class
```

#### Parameters

`settings` TSettings

The settings.

#### Type Parameters

`TSettings` 

The settings type the function declares.

#### Remarks

The value is written with the options the read uses, so it comes back as the object that was given
and the check is the one a stored node's settings pass. A settings type with a `required` member
is satisfied by the value, not by a default. Settings are values and never a secret: they appear in
the run's audit trail.

#### Exceptions

 [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`settings` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

 [JsonException](https://learn.microsoft.com/dotnet/api/system.text.json.jsonexception)

The value cannot be written as JSON.
