Table of Contents

Class LocalActivityOptions

Namespace
Temporalio.Workflows
Assembly
Temporalio.dll

Options for local activity execution from a workflow. Either ScheduleToCloseTimeout or StartToCloseTimeout must be set.

public class LocalActivityOptions : ICloneable
Inheritance
LocalActivityOptions
Implements
Inherited Members

Properties

ActivityId

Gets or sets the unique identifier for the activity. This should never be set unless users have a strong understanding of the system. Contact Temporal support to discuss the use case before setting this value.

public string? ActivityId { get; set; }

Property Value

string

CancellationToken

Gets or sets the cancellation token for this activity. If unset, this defaults to the workflow cancellation token.

public CancellationToken? CancellationToken { get; set; }

Property Value

CancellationToken?

CancellationType

Gets or sets how the workflow will send/wait for cancellation of the activity. Default is TryCancel.

public ActivityCancellationType CancellationType { get; set; }

Property Value

ActivityCancellationType

LocalRetryThreshold

Gets or sets the local retry threshold. If unset, default is 1m.

public TimeSpan? LocalRetryThreshold { get; set; }

Property Value

TimeSpan?

Remarks

If the activity is retrying and backoff would exceed this value, an internal timer will be scheduled to retry the activity after. Otherwise, backoff will happen internally without a timer.

RetryPolicy

Gets or sets the retry policy. If unset, defaults to retrying forever.

public RetryPolicy? RetryPolicy { get; set; }

Property Value

RetryPolicy

ScheduleToCloseTimeout

Gets or sets the schedule to close timeout.

public TimeSpan? ScheduleToCloseTimeout { get; set; }

Property Value

TimeSpan?

Remarks

This is the timeout from schedule to completion of the activity (all attempts, including retries). Either this or StartToCloseTimeout must be set. If unset, default is the workflow execution timeout.

ScheduleToStartTimeout

Gets or sets the schedule to start timeout.

public TimeSpan? ScheduleToStartTimeout { get; set; }

Property Value

TimeSpan?

Remarks

This is the timeout from schedule to when the activity is picked up by a worker. If unset, defaults to ScheduleToCloseTimeout.

StartToCloseTimeout

Gets or sets the start to close timeout.

public TimeSpan? StartToCloseTimeout { get; set; }

Property Value

TimeSpan?

Remarks

This is the timeout for each separate retry attempt from start to completion of the attempt. Either this or ScheduleToCloseTimeout must be set.

Methods

Clone()

Create a shallow copy of these options.

public virtual object Clone()

Returns

object

A shallow copy of these options.