# Understanding activity retries

**URL:** <https://community.temporal.io/t/understanding-activity-retries/1457>\
**Category:** Community Support\
**Tags:** go-sdk, activity\
**Created:** [February 7, 2021, 3:58pm UTC](https://community.temporal.io/t/understanding-activity-retries/1457 "2021-02-07T15:58:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_Bevione](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/federico_bevione/32/569_2.png) [@Federico\_Bevione](https://community.temporal.io/u/Federico_Bevione)\
**Post date:** [February 7, 2021, 3:58pm UTC](https://community.temporal.io/t/understanding-activity-retries/1457/1 "2021-02-07T15:58:05Z")

</div>

Hi there,

I have to predict the duration of a workflow where the duration depends on some user-provided parameters, at first I’ll average between best and worst case.  
In order to be able to compute the worst case, I need to take into account the max activity duration, retries included.

let’s say I have the following activity options:

```auto
ao := workflow.ActivityOptions{
	StartToCloseTimeout: time.Minute,
	ScheduleToStartTimeout: time.Minute,
	HeartbeatTimeout: time.Second * 2, // such a short timeout to make sample fail over very fast
	RetryPolicy: &temporal.RetryPolicy{
		InitialInterval: time.Second,
		BackoffCoefficient: 2.0,
		MaximumAttempts: 100,
		MaximumInterval: time.Minute,
	},
}

```

1. the max duration of a single activity will be `StartToCloseTimeout + ScheduleToStartTimeout` although the retry policy would last more?

2. `StartToCloseTimeout` is the timeout of every single execution attempt?

Thanks

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [February 7, 2021, 10:37pm UTC](https://community.temporal.io/t/understanding-activity-retries/1457/2 "2021-02-07T22:37:31Z")

</div>

`ScheduleToStart` timeout is nonretryable as such retry would be putting it back into the same task queue. I would recommend not setting it at all for the majority of situations.

`StartToClose` timeout is the maximum execution time for a single activity invocation.

I would recommend not setting `RetryPolicy.MaximumAttempts`, but rely on `ScheduleToClose` timeout which limits total time activity can execute including all the retries.
