# Workflow retries logic

**URL:** <https://community.temporal.io/t/workflow-retries-logic/7798>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [April 5, 2023, 8:49am UTC](https://community.temporal.io/t/workflow-retries-logic/7798 "2023-04-05T08:49:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vadim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/vadim/32/2718_2.png) [@Vadim](https://community.temporal.io/u/Vadim)\
**Post date:** [April 5, 2023, 8:49am UTC](https://community.temporal.io/t/workflow-retries-logic/7798/1 "2023-04-05T08:49:36Z")

</div>

Hi all. I have the following activity options in my workflow:

```go
activityCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
		StartToCloseTimeout: time.Hour,
		HeartbeatTimeout: 2 * time.Second,
		RetryPolicy: &temporal.RetryPolicy{
			InitialInterval: time.Second,
			BackoffCoefficient: 2.0,
			MaximumInterval: time.Minute,
			MaximumAttempts: 20,
		},
	})

```

When the workflow fails, temporal created a new one with the same identifier and kept trying in it. Why does this happen?

 ![Снимок экрана 2023-04-05 в 11.47.22](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/6/63f7aa662befce8f43692141741112e5e02bfd0d.png)

---

<div class="post-metadata">

**Author:** ![taonic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/taonic/32/5556_2.png) [@taonic](https://community.temporal.io/u/taonic)\
**Post date:** [April 5, 2023, 12:13pm UTC](https://community.temporal.io/t/workflow-retries-logic/7798/2 "2023-04-05T12:13:59Z")

</div>

Can you check if you have retry policy configured for your workflow too? If so, after the activity exhaust it’s retries, the workflow itself will be retried with a continue-as-new execution, hence the same workflow ID.

Reference: [Retry Policies | Temporal Documentation](https://docs.temporal.io/retry-policies#event-history)

---

<div class="post-metadata">

**Author:** ![Vadim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/vadim/32/2718_2.png) [@Vadim](https://community.temporal.io/u/Vadim)\
**Post date:** [April 5, 2023, 12:21pm UTC](https://community.temporal.io/t/workflow-retries-logic/7798/3 "2023-04-05T12:21:19Z")

</div>

Yes, workflow also has retry options. Its MaximumAttempts option are higher than the activity MaximumAttempts. Thank you!

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [April 5, 2023, 1:42pm UTC](https://community.temporal.io/t/workflow-retries-logic/7798/4 "2023-04-05T13:42:06Z")

</div>

It’s typically not recommended to explicitly set workflow retry policy. Do you have specific use case for it?

---

<div class="post-metadata">

**Author:** ![Vadim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/vadim/32/2718_2.png) [@Vadim](https://community.temporal.io/u/Vadim)\
**Post date:** [April 10, 2023, 6:16am UTC](https://community.temporal.io/t/workflow-retries-logic/7798/5 "2023-04-10T06:16:48Z")

</div>

No, there are no special use cases.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [April 10, 2023, 9:42pm UTC](https://community.temporal.io/t/workflow-retries-logic/7798/6 "2023-04-10T21:42:39Z")

</div>

Ok, in that case I don’t think you should specify it.
