# Workflow Reentry

**URL:** <https://forums.losant.com/t/workflow-reentry/1709>\
**Category:** Help\
**Tags:** workflow\
**Created:** [April 10, 2019, 4:33pm UTC](https://forums.losant.com/t/workflow-reentry/1709 "2019-04-10T16:33:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 10, 2019, 4:33pm UTC](https://forums.losant.com/t/workflow-reentry/1709/1 "2019-04-10T16:33:20Z")

</div>

I’m getting a InfiniteLoopError in workflow 5cae00e2f3bb3d0009bf56a8

Is that because I’m using Device state as trigger and then in the end setting device state with some manipulated values?

How do I get around that?

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [April 10, 2019, 4:35pm UTC](https://forums.losant.com/t/workflow-reentry/1709/2 "2019-04-10T16:35:08Z")

</div>

Check out the answer to this post:

> [@Workflow Reentrant Loop For Device](https://forums.losant.com/t/workflow-reentrant-loop-for-device/616/2):
>
> So “Workflow Reentrant Loop For Device” means that the workflow is actually ending up in an infinite loop - where the workflow is triggered by a device state, that workflow then changes that devices state, the same workflow is triggered again by that change, and then tries to set the state again (it is on this last bit that we throw the error, to prevent the loop from continuing). It sounds like you do want to modify the state report when the state is initially reported, but you don’t want to c…

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [April 10, 2019, 6:39pm UTC](https://forums.losant.com/t/workflow-reentry/1709/3 "2019-04-10T18:39:46Z")

</div>

That worked perfect. Thanks
