When using a "for each" loop in a recipe, the job report only contains the input & output for the last execution of each action in that loop.
This makes it very hard debugging when something went wrong in an earlier iteration (but the recipe didn't stop with an error).
I'd like to be able to see the input & output of the actions in the loop for every iteration of the loop when looking at the job report, so I can debug issues that occurred in the loop.
I totally agree we have struggled with this many times trying to understand where the issues is with one record of many. Being able to see the entire loop would be helpful or at least make it something that could be turned on and turned off.
Hi Martin and Jeremy,
I agree that this would be helpful! We'll certainly look into ways to make this easier for you and other users.
In the meantime, perhaps you can try using callable recipes. In the parent recipe, you should indent a "Call Recipe" action under your repeat action. In the callable recipe, you should have the actions that were originally under your repeat action. The callable recipe will then show one job per iteration of the loop, making it easier to troubleshoot.
A tip to help with debugging when using foreach loops, you can create a Workato Lists - Append item to list action, add it to the end of the loop to store the data input/output for the relevant action(s) within the foreach loop.
Amanda this is a good idea but does not help when you've got a nested for loop. The next iteration of the parent loop overwrites the original list.
I imagine this is going to be complicated to solve. We've handled this by using Callable recipes to handle the "function" of whatever we're trying to keep track of. It's not a great solution for debugging but if you keep track of the callable job url on the record in which you're working on it makes it slightly easier.
Hi Chase, agree it does get more complicated when there is a nested for loop. You probably need an "append item to list" action at the end of each loop i.e. one to store the status for the nested loop, one to store the status for the parent loop.
Depending on the step output you are interested in, you can configure your data fields in the lists accordingly. You need to set the `Clear step output` field in the for loop to "Yes" so that Workato does not incorrectly refer to data from previous iterations. You can also "watch" particular actions using the action with error monitor to help with debugging. Finally, I also like to add a Log Message action to print out the debug list in an easy-to-read format.
Check out this recipe example (additional notes in step 10): https://www.workato.com/recipes/802293-get-selected-output-from-every-iteration-of-a-loop#recipe
I'd like to see better overall reporting. That would be great.
Send us a ticket, we will try our best to assist you with your problem