# Workflow retry "ContinueAsNew"

**URL:** <https://community.temporal.io/t/workflow-retry-continueasnew/1671>\
**Category:** Community Support\
**Created:** [March 9, 2021, 9:41am UTC](https://community.temporal.io/t/workflow-retry-continueasnew/1671 "2021-03-09T09:41:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorenzo\_Di\_Giacomo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/lorenzo_di_giacomo/32/796_2.png) [@Lorenzo\_Di\_Giacomo](https://community.temporal.io/u/Lorenzo_Di_Giacomo)\
**Post date:** [March 9, 2021, 9:41am UTC](https://community.temporal.io/t/workflow-retry-continueasnew/1671/1 "2021-03-09T09:41:57Z")

</div>

Hi guys, i have a question about NonRetryableErrorReasons:  
I have an “full.qualified.name.packages.NameOfException” that is eventually thrown by an activity and both Activity and Workflow should not do Retry.  
So i have set .setDoNotRetry(“full.qualified.name.packages.NameOfException”) in the activity AND in the Workflow.  
In the activity it works fine and it doesn’t do the retries, but the Workflow create a new workflow execution “ContinueAsNew” how is possibile to avoid that?  
Could be because to the workflow the error is “io.temporal.failure.ApplicationFailure” and not “full.qualified.name.packages.NameOfException” that is instead set as Type? How can i do this?

---

<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:** [March 9, 2021, 2:47pm UTC](https://community.temporal.io/t/workflow-retry-continueasnew/1671/2 "2021-03-09T14:47:34Z")

</div>

The reason the workflow didn’t retry because an activity failure is always wrapped in the ActivityFailure exception. As ActivityFailure by default is always retryable the workflow is not retried.

The solution is to throw an ApplicationFailure (possibly created with ApplicationFailure.newNonRetryableFailure) that wraps the ActivityFailure.
