r/PowerAutomate • u/Reasonable-Beyond855 • 6d ago
Nesting Limit
I know the nesting limit of 8 has been raised before, but the solutions I've seen is to keep conditions in series, rather than nested, and use a boolean variable like Continue to decide whether subsequent conditions run.
I've tried this, but am using the FALSE branches to add to an error log. If the conditions are in series, one loop can enter multiple FALSE branches, and be added to the log multiple times.
Has anyone found a fix for this?
TIA!
3
Upvotes
1
u/Reasonable-Beyond855 6d ago edited 6d ago
Best I can think of is adding IF statements as expressions in the error log values, rather than through the flow control - but this would mean subsequent steps are still processed after an error, which is inefficient.
1
u/Reasonable-Beyond855 6d ago edited 6d ago
For anyone with the same problem, another idea would be to create a compose statement which acts as the TRUE/FALSE eg/ checking if an array is populated: '1 / length(array)' would error if the array is empty. You can then use Run After complete for TRUE, and after fail for FALSE.
1
u/SrBlackVoid 6d ago
I have written probably hundreds of Flows at this point, and have built some pretty complex stuff. Some of them perform entire data syncs between systems.
I don't think I've ever gone more than 2-3 condition levels deep. When someone in our org mentioned this 'nesting limit', I didn't even know that was a thing.
I would say if you're going more than 3 levels deep in a Flow, you probably need to consider refactoring, because there is likely a better way to structure it.
1
u/ryguy694 6d ago
But have you ever heard of a switch?
1
u/SuitEvening48 21h ago
Since the empty-array checks are sorted, I'd make each stage produce two groups: records that pass, and records that fail that specific check. Log the failures with the record ID and check name, then feed only the passing group into the next stage; that way a record only gets its first failure logged.