Skip to content
Tracon

WorkflowFunctionStepOptions

Namespace Tracon · Assembly Tracon.Workflows.dll

The settings of one function node in a workflow graph built in code, passed to WorkflowFunctionBinding.GetWorkflowFunction.

public sealed class WorkflowFunctionStepOptions
Inheritance
object ← WorkflowFunctionStepOptions
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

A stored workflow carries the same two values in a 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 gives.

public WorkflowFunctionStepOptions()

Gets or sets the node’s settings as a JSON object. null (the default) is a node without settings.

public JsonElement? Settings { get; set; }

JsonElement?

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`.

Gets or sets the longest time one call of the node may take. null (the default) uses the timeout the function was registered with, if any.

public TimeSpan? Timeout { get; set; }

TimeSpan?

The same setting as WorkflowNodeReference.Timeout; it wins over 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.

Sets WorkflowFunctionStepOptions.Settings from a typed value.

public void SetSettings<TSettings>(TSettings settings) where TSettings : class

settings TSettings

The settings.

TSettings

The settings type the function declares.

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.

ArgumentNullException

settings is null.

JsonException

The value cannot be written as JSON.