yes, you can use recursive functions but you need to store your harvested data somewhere. Most of the time you use lists for that, starting with an empty one, adding the results in the folder and then recursively calling yourself for all folder children
No. I'm unable to determine what causes the error. I have used table functions to expand the list to fetch the next ids for parameters for the next loop. But the output should be a combined list of lists.