Hello everyone,
Few days back I got a requirement wherein I had to delete all the empty folders present inside a Document library in a SharePoint list. For which I created a cloud based flow (manual triggered) to achieve the required. The flow looked as follows:


So this worked fine when I tested it in my quality setup.
But the actual issue was due to some issue (there was another application through which they were creating folders based on projects and there were some issues in the folder logic i.e. it got stuck in infinite loop which led to creation of large number of empty folders like 1 crore/10 million) and when they tried to execute this flow it got failed.
It gave 502 Error (Bad gateway error). So is it because of the high number of records?.
If so in such case (high number of records i.e. empty folders to be deleted is there any way to do it, if so could you please help me with it. As I have never dealt with such huge number of records till now.
Regards,
Sidhant