The UI will lint the code as not defined, but it works.
For some additional insights, I previously answered a similar question on looping here: Looping and referencing data from previous step.
Key things to note
- The loop will complete and return an array with all results that you can take to the next step
- Within the loop, you reference
{{value.FieldName}}
to get a particular item from the previous workflow step's item being looped.