Table of Contents

Class WorkflowOptions

Namespace
Temporalio.Client
Assembly
Temporalio.dll

Options for starting a workflow. Id and TaskQueue are required.

public class WorkflowOptions : ICloneable
Inheritance
WorkflowOptions
Implements
Inherited Members

Constructors

WorkflowOptions()

Initializes a new instance of the WorkflowOptions class.

public WorkflowOptions()

WorkflowOptions(string, string)

Initializes a new instance of the WorkflowOptions class.

public WorkflowOptions(string id, string taskQueue)

Parameters

id string

Workflow ID.

taskQueue string

Task queue to start workflow on.

Properties

CronSchedule

Gets or sets the cron schedule for the workflow.

public string? CronSchedule { get; set; }

Property Value

string

ExecutionTimeout

Gets or sets the total workflow execution timeout including retries and continue as new.

public TimeSpan? ExecutionTimeout { get; set; }

Property Value

TimeSpan?

Id

Gets or sets the unique workflow identifier. This is required.

public string? Id { get; set; }

Property Value

string

IdReusePolicy

Gets or sets how already-existing IDs are treated. Default is AllowDuplicate.

public WorkflowIdReusePolicy IdReusePolicy { get; set; }

Property Value

WorkflowIdReusePolicy

Memo

Gets or sets the memo for the workflow. Values for the memo cannot be null.

public IReadOnlyDictionary<string, object>? Memo { get; set; }

Property Value

IReadOnlyDictionary<string, object>

RequestEagerStart

Gets or sets a value indicating whether the workflow will request eager start. This potentially reduces the latency to start the workflow by encouraging the server to start it on a local worker running this same client.

public bool RequestEagerStart { get; set; }

Property Value

bool

Remarks

WARNING: Eager workflow start is experimental.

RetryPolicy

Gets or sets the retry policy for the workflow. If unset, workflow never retries.

public RetryPolicy? RetryPolicy { get; set; }

Property Value

RetryPolicy

Rpc

Gets or sets RPC options for starting the workflow.

public RpcOptions? Rpc { get; set; }

Property Value

RpcOptions

RunTimeout

Gets or sets the timeout of a single workflow run.

public TimeSpan? RunTimeout { get; set; }

Property Value

TimeSpan?

StartDelay

Gets or sets the amount of time to wait before starting the workflow.

public TimeSpan? StartDelay { get; set; }

Property Value

TimeSpan?

Remarks

Start delay does not work with CronSchedule.

StartSignal

Gets or sets the start signal for the workflow. If this is non-null, a signal-with-start is used instead of a traditional workflow start. This means the workflow will only be created if it does not already exist, then a signal will be sent.

public string? StartSignal { get; set; }

Property Value

string

StartSignalArgs

Gets or sets the arguments for the start signal. This cannot be set if StartSignal is not set.

public IReadOnlyCollection<object?>? StartSignalArgs { get; set; }

Property Value

IReadOnlyCollection<object>

TaskQueue

Gets or sets the task queue to run the workflow on. This is required.

public string? TaskQueue { get; set; }

Property Value

string

TaskTimeout

Gets or sets the timeout of a single workflow task.

public TimeSpan? TaskTimeout { get; set; }

Property Value

TimeSpan?

TypedSearchAttributes

Gets or sets the search attributes for the workflow.

public SearchAttributeCollection? TypedSearchAttributes { get; set; }

Property Value

SearchAttributeCollection

Methods

Clone()

Create a shallow copy of these options.

public virtual object Clone()

Returns

object

A shallow copy of these options and any transitive options fields.

SignalWithStart(string, IReadOnlyCollection<object?>)

Perform a signal-with-start which will only start the workflow if it's not already running, but send a signal to it regardless. This is just sugar for manually setting StartSignal and StartSignalArgs directly.

public void SignalWithStart(string signal, IReadOnlyCollection<object?> args)

Parameters

signal string

Signal name.

args IReadOnlyCollection<object>

Signal args.

SignalWithStart<TWorkflow>(Expression<Func<TWorkflow, Task>>)

Perform a signal-with-start which will only start the workflow if it's not already running, but send a signal to it regardless. This is just sugar for manually setting StartSignal and StartSignalArgs directly.

public void SignalWithStart<TWorkflow>(Expression<Func<TWorkflow, Task>> signalCall)

Parameters

signalCall Expression<Func<TWorkflow, Task>>

Invocation or a workflow signal method.

Type Parameters

TWorkflow

Workflow class type.