โ08-15-2023 04:35 PM
I am developing a recipe to look through for files and folders on Google Drive that contain a particular string in the name. As you might imagine, I need to develop a recursive loop to get into all of the nested folders. I created a parent recipe to kick off the process, which calls a recipe function (A) to look into the root level folder's files and subfolder names. Then I cloned that recipe, and called the clone (B) from the first recipe function (A). However, when I try to call recipe function A from recipe function B, I am getting an error:
Recursive invocation detected
I've tried creating even a second clone, in case the recursion was only detected if calling a recipe that was the calling recipe of the current recipe (yikes! brain spaghetti), but that did not solve the problem.
Has anyone identified a way to recursive travel down a folder structure without a pre-defined number of levels?
Solved! Go to Solution.
โ08-17-2023 03:33 PM
Unfortunately the clone-twice/delete linkage didn't work to resolve my issue. For anyone else who tries to do this in the future, I'll outline how I got around it here:
โ08-16-2023 06:29 AM
Good morning Jen,
I believe that's a limitation of Recipe Functions to prevent infinite loops. Is there a way you can accomplish what you want using a Repeat block instead? I haven't used the Google Drive connector so I'm not familiar with it, but it might be an option, albeit imperfect.
Another longshot might be if the Recursive error is being thrown b/c Workato sees them as dependencies. When you clone a recipe, the new one is "linked" to the parent recipe. If you clone it a 2nd time, so your original is A, first clone is B, and 2nd clone is C, then delete recipe B, now C and A will be independent of one another. You could try that too in case that link is the problem.
โ08-17-2023 03:33 PM
Unfortunately the clone-twice/delete linkage didn't work to resolve my issue. For anyone else who tries to do this in the future, I'll outline how I got around it here: