<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Nested repeat action retried within an error block using incorrect indices in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/544#M266</link>
    <description>&lt;P&gt;Hi Amy, yes that works in this example! Thank you for sharing that. However, there may be cases where we may still need the list to be scoped within the context of the outer loop. &lt;BR /&gt;&lt;BR /&gt;Regardless of the use case though, it seems that the way Workato manages local variable assignment within loops is very unintuitive and ways counter to how it works in most programming languages. &lt;BR /&gt;&lt;BR /&gt;I basically restructured the recipes to avoid this construct, but it still leaves me wanting to know why this is considered expected behavior. &lt;/P&gt;</description>
    <pubDate>Sat, 27 Feb 2021 10:18:13 GMT</pubDate>
    <dc:creator>jason1</dc:creator>
    <dc:date>2021-02-27T10:18:13Z</dc:date>
    <item>
      <title>Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/537#M259</link>
      <description>&lt;P&gt;I believe I've uncovered a rather serious bug.  Let's say I have a repeat action and if an error occurs during an iteration, I want to catch it, wait X seconds, then retry the whole repeat action again. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;Simple Ruby program that demonstrates this:&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt; [0, 1, 2, 3, 4]&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Here's the recipe version in Workato: &lt;A href="https://community.workato.com/links?lid=tjalYyMOwAFVAlUogkdH7w&amp;amp;token=%2A%7CTOKEN%7C%2A&amp;amp;url=https%3A%2F%2Fapp.workato.com%2Frecipes%2F1443583%3Fst%3Dff6418" target="_blank" rel="noopener noreerrer"&gt;https://app.workato.com/recipes/1443583?st=ff6418&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;This recipe outputs [2, 3, 4], which is not correct.  What I would expect is for the entire loop to repeat from index 0 on every attempt. Note that the list and repeat helper list are created anew per each attempt. However, it appears as if the loop is continuing at a previously stored offset.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;This has produced serious production bugs for us. Can someone explain if my assumptions here are incorrect or if I've built the recipe logic incorrectly?&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Feb 2021 13:26:52 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/537#M259</guid>
      <dc:creator>jason1</dc:creator>
      <dc:date>2021-02-26T13:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/538#M260</link>
      <description>&lt;P&gt;Have you tried putting the error monitor outside the loop?&lt;BR /&gt;&lt;BR /&gt;In order to retry the entire loop you would need to monitor the whole loop block.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 20:17:33 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/538#M260</guid>
      <dc:creator>mroldanvega</dc:creator>
      <dc:date>2021-02-26T20:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/539#M261</link>
      <description>&lt;P&gt;Hi, thanks for the reply! There are 2 loops here. The outer loop is what controls the re-attempts and the inner loop is what's causing the issue. The entire inner loop is wrapped in a monitor block, which means it should be repeating in full each time. Is this what you mean?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 20:38:30 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/539#M261</guid>
      <dc:creator>jason1</dc:creator>
      <dc:date>2021-02-26T20:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/540#M262</link>
      <description>&lt;P&gt;Yes, that is what I meant &lt;/P&gt;&lt;P&gt;I tried your recipe, adding 1 list and seems like the recipe keeps track of the index and it retries the loop from that index, so the offset is correct. No?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;BTW - curious to know why you use the Ruby 'sleep' function instead of the Retry on the 'error' block &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Feb 2021 21:06:16 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/540#M262</guid>
      <dc:creator>mroldanvega</dc:creator>
      <dc:date>2021-02-26T21:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/541#M263</link>
      <description>&lt;P&gt;Right, so I guess my question is why is it maintaining an offset? It should be recreating the list and the repeat helper list each time a new retry is executed. Ideally, this means the index is always reset to 0. If you refresh the recipe I shared, you should be able to see this.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;In terms of why I use "sleep", I need more control of how much time I can "wait" per each successive runs (ex: to do something like exponential backoff). The error block retry only gives you a fixed number of seconds each retry. However, in this simple example, I could have used the error block retry.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 21:11:07 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/541#M263</guid>
      <dc:creator>jason1</dc:creator>
      <dc:date>2021-02-26T21:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/542#M264</link>
      <description>&lt;P&gt;&lt;A href="https://systematic.workato.com/workato-migration/users/2364077"&gt;Tridivesh Sarangi&lt;/A&gt; know anyone who could weigh in on this? ^&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 06:13:26 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/542#M264</guid>
      <dc:creator>kristine</dc:creator>
      <dc:date>2021-02-27T06:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/543#M265</link>
      <description>&lt;P&gt;Try creating your list variable outside the outer loop and clearing it inside the loop before the first iteration in the inner loop each time. It might be creating multiple versions of the same list variable. When I updated and ran, it looks like it's ok to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;https://app.workato.com/recipes/1444711?st=673352&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 06:52:04 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/543#M265</guid>
      <dc:creator>ajorde</dc:creator>
      <dc:date>2021-02-27T06:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Nested repeat action retried within an error block using incorrect indices</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/544#M266</link>
      <description>&lt;P&gt;Hi Amy, yes that works in this example! Thank you for sharing that. However, there may be cases where we may still need the list to be scoped within the context of the outer loop. &lt;BR /&gt;&lt;BR /&gt;Regardless of the use case though, it seems that the way Workato manages local variable assignment within loops is very unintuitive and ways counter to how it works in most programming languages. &lt;BR /&gt;&lt;BR /&gt;I basically restructured the recipes to avoid this construct, but it still leaves me wanting to know why this is considered expected behavior. &lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 10:18:13 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/nested-repeat-action-retried-within-an-error-block-using/m-p/544#M266</guid>
      <dc:creator>jason1</dc:creator>
      <dc:date>2021-02-27T10:18:13Z</dc:date>
    </item>
  </channel>
</rss>

