Interface: LocalActivityOptions
common.LocalActivityOptions
Options for local activity invocation
Properties
cancellationType
• Optional
cancellationType: ActivityCancellationType
Determines what the SDK does when the Activity is cancelled.
TRY_CANCEL
- Initiate a cancellation request and immediately report cancellation to the workflow.WAIT_CANCELLATION_COMPLETED
- Wait for activity cancellation completion. Note that activity must heartbeat to receive a cancellation notification. This can block the cancellation for a long time if activity doesn't heartbeat or chooses to ignore the cancellation request.ABANDON
- Do not request cancellation of the activity and immediately report cancellation to the workflow.
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