Skip to main content

Interface: LocalActivityOptions

common.LocalActivityOptions

Options for local activity invocation

Properties

cancellationType

Optional cancellationType: ActivityCancellationType

Determines:

  • whether cancellation requests should be propagated from the current Workflow to the Activity; and
  • when should the Activity cancellation be reported to Workflow (i.e. at which moment should the Activity call's promise fail with an ActivityFailure, with cause set to a CancelledFailure).

Note that this setting only applies to cancellation originating from cancellation being externally requested on the Workflow itself, or from internal cancellation of the CancellationScope in which the Activity call was made. Termination of a Workflow Execution always results in cancellation of its outstanding Activity executions, regardless of those Activities' ActivityCancellationType settings.

Default

ActivityCancellationType.WAIT_CANCELLATION_COMPLETED

localRetryThreshold

Optional localRetryThreshold: Duration

If the activity is retrying and backoff would exceed this value, a server side timer will be scheduled for the next attempt. Otherwise, backoff will happen internally in the SDK.

Default

1 minute

Format

number of milliseconds or ms-formatted string


retry

Optional retry: RetryPolicy

RetryPolicy that defines how an activity is retried in case of failure. If this is not set, then the SDK-defined default activity retry policy will be used. Note that local activities are always executed at least once, even if maximum attempts is set to 1 due to Workflow task retries.


scheduleToCloseTimeout

Optional scheduleToCloseTimeout: Duration

Indicates how long the caller is willing to wait for local activity completion. Limits how long retries will be attempted.

Either this option or startToCloseTimeout is required.

Default

unlimited

Format

number of milliseconds or ms-formatted string


scheduleToStartTimeout

Optional scheduleToStartTimeout: Duration

Limits time the local activity can idle internally before being executed. That can happen if the worker is currently at max concurrent local activity executions. This timeout is always non retryable as all a retry would achieve is to put it back into the same queue. Defaults to scheduleToCloseTimeout if not specified and that is set. Must be <= scheduleToCloseTimeout when set, otherwise, it will be clamped down.

Default

unlimited

Format

number of milliseconds or ms-formatted string


startToCloseTimeout

Optional startToCloseTimeout: Duration

Maximum time the local activity is allowed to execute after the task is dispatched. This timeout is always retryable.

Either this option or scheduleToCloseTimeout is required. If set, this must be <= scheduleToCloseTimeout, otherwise, it will be clamped down.

Format

number of milliseconds or ms-formatted string


summary

Optional summary: string

A fixed, single-line summary for this workflow execution that may appear in the UI/CLI. This can be in single-line Temporal markdown format.

User metadata is a new API and susceptible to change.