Table of Contents

Class ActivityOptions

Namespace
Temporalio.Workflows
Assembly
Temporalio.dll

Options for activity execution from a workflow. Either ScheduleToCloseTimeout or StartToCloseTimeout must be set. HeartbeatTimeout must be set for the activity to receive cancellations and all but the most instantly completing activities should set this.

public class ActivityOptions : ICloneable
Inheritance
ActivityOptions
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

DisableEagerActivityExecution

Gets or sets a value indicating whether eager activity execution will be disabled for this activity.

public bool DisableEagerActivityExecution { get; set; }

Property Value

bool

Remarks

Eager activity execution is an optimization on some servers that sends activities back to the same worker as the calling workflow if they can run there.

HeartbeatTimeout

Gets or sets the heartbeat timeout.

public TimeSpan? HeartbeatTimeout { get; set; }

Property Value

TimeSpan?

Remarks

This must be set for an activity to receive cancellation. This should always be set for all but the most instantly completing activities.

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.

TaskQueue

Gets or sets the task queue for this activity. If unset, defaults to the workflow task queue.

public string? TaskQueue { get; set; }

Property Value

string

VersioningIntent

Gets or sets whether this Activity should run on a worker with a compatible Build Id or not when using the Worker Versioning feature.

public VersioningIntent VersioningIntent { get; set; }

Property Value

VersioningIntent

Methods

Clone()

Create a shallow copy of these options.

public virtual object Clone()

Returns

object

A shallow copy of these options.