Skip to main content

Activity Options

Activities are the work units that run outside a Workflow and can perform non-deterministic operations. Activity Options let you define how an activity should run: timeouts, retries and other execution settings. These options shape reliability and performance, making each activity call predictable and consistent across SDKs. Configure them when invoking an activity to ensure it behaves the way your Workflow expects.

tip

These are configured to provide sensible defaults which will work for most use cases. In most scenarios, you probably won't need to configure this.

Location

  • Document
  • Task

Metadata

NameTypeRequiredDescription
activityOptionsActivityOptionsnoConfigure the activity options. If nothing is provided, the default options will be used.

Types

ActivityOptions

NameTypeRequiredDefaultDescription
scheduleToCloseTimeoutdurationno-Total time that a workflow is willing to wait for an Activity to complete
scheduleToStartTimeoutdurationno-Time that the Activity Task can stay in the Task Queue before it is picked up by a Worker. Do not specify this timeout unless using host specific Task Queues for Activity Tasks are being used for routing
startToCloseTimeoutdurationno{"minutes":5}Maximum time of a single Activity execution attempt
retryPolicyRetryPolicyno-Specifies how to retry an Activity if an error occurs
disableEagerExecutionbooleannofalseIf true, eager execution will not be requested, regardless of worker settings. If false, eager execution may still be disabled at the worker level or may not be requested due to lack of available slots.
summarystringnoThe task's nameAdd a summary to the Temporal workflow UI
priorityActivityPriorityno-Configure an activity's priority and fairness (pre-release)

ActivityPriority

NameTypeRequiredDefaultDescription
priorityKeyintegerno-A positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner)
fairnessKeystringno-A short string that's used as a key for a fairness balancing mechanism
fairnessWeightfloatno-Weight of a task can come from multiple sources for flexibility

RetryPolicy

NameTypeRequiredDefaultDescription
initialIntervaldurationno{"second":1}Backoff interval for the first retry. If BackoffCoefficient is 1.0 then it is used for all retries
backoffCoefficientfloatno2.0Coefficient used to calculate the next retry backoff interval
maximumIntervaldurationno{"minute":1}Maximum backoff interval between retries
maximumAttemptsintegerno5Maximum number of attempts. When exceeded the retries stop even if not expired yet
nonRetryableErrorTypesstring[]no[]Temporal server will stop retry if error type matches this list