Hi,
Let's assume that the workflow being iterated on (in your case, the workflow that renames a VM) detects the error during renaming and returns it in a workflow output parameter.
Then in the workflow where you do the iterations using ForEach element, you can do the following:
- add a workflow attribute of type Array/string and give it an empty array value; the errors will be collected into this attribute
- select the ForEach element, and on its OUT tab bind the 'Accumulate workflow outputs in' to this attribute
- after the ForEach element, insert a Scriptable task element, and on its IN tab select the same attribute
- on the same Scriptable task Scripting tab, add some code that will examine the content of the attribute, and will fail the workflow if certain conditions are met, ie. if the attribute where the errors are collected contains at least one element, or if the collected errors contain some specific message, etc.
Hope the above makes sense.