I just serendipitously wrote a small bit about how to use the workflow functions and the new Loop block's Run JS Code to better handle loop errors and successes:
This is pretty much the same answer from Darren but blending the Loop Block and the Raw JS with a step-by-step process.