Hello Everyone,
After I was noticing that one of my Flows was taking much longer than expected, I tried to optimize it to get its run time to a reasonable level. However, nothing that I have tried seems to make a difference, and the log is not providing me with any indication of why it's taking as long as it is.
The Flow is making a SQL query, and then comparing the result of that SQL Query with a SharePoint list. If a result from the SQL Query isn't on the SharePoint list, then it should create a new item. If the SQL Query result is already on the SharePoint list, then it should do nothing and move on to the next item.
When I last did a run, the SQL Query had about 25 items in it, all of which are already on the SharePoint list. The SharePoint list has about 3000 items, but I noticed that the Filter Array step is still only taking one second per item, and each iteration takes about two seconds. However, the total run time for this Flow is somehow 55 minutes, and almost all of that time is spent on the Apply to Each step (see attached screenshot).
Has anyone experienced a similar issue before? If so, how would I resolve this? I have already set the concurrency up to maximum (50), and I don't think that the Apply to Each loop contains any actions that would cause the Flow to get stuck. Strangely, this flow was running fine a couple months ago, where it would take about 40 minutes to process 600 records.
Any advice for this issue would be greatly appreciated.