Why an invocation-related exception is obtained while publishing the workflow from Studio?
Error summary and root cause:
Error Description: Sometimes, while publishing the automation workflow from Studio to Orchestrator, an exception that says - "Unexpected error has occurred during the library compilation process: The following workflows are in a least one invocation cycle: __________" is received.
Root Cause: This error usually appears when one of the mentioned workflows are invoked using "Invoke Workflow File" and somewhere between those Invokes one of them is called again, creating a (possible) loop.
Example:
In the example above, observe that there are 3 workflows involved ( listed below). The following workflows are in a least one invocation cycle,
In my opinion, encountering an invocation-related exception while publishing a workflow from UiPath Studio to Orchestrator is a significant hindrance for developers. Recursion is a crucial aspect of programming, and it is better not to limit it in this way. Components that invoke themselves are often used when searching through nested files and folders or nested data. Detecting potential infinite loops is not worth the trouble, and at most, a warning could be issued.
I’ve come across the same error, and I fully agree with Konrad_Mierswa’s viewpoint on the importance of recursion in programming. Personally, I believe it would be more helpful to have a warning message rather than an error in this scenario.
I have come across the same error as well.
I have a bot which uses recursion to solve for the combination of n number of invoices that matches a specific payment amount. (Which I believe it’s quite a common use case). The bot works well but I’m not able to publish it due to this error. Is there any workaround available?
Recursion works fine in Windows-Legacy projects, but it seems that it’s not yet supported in Windows. Do you have any ETA on this? Currently represents a blocker in migrating from Legacy to Windows.
It is absurd that UiPath restricts such a fundamental concept as recursion.
They also allow you to test it, figure out it works to solve whatever problem is at hand but stops you from publishing the package. Which is even more absurd.
My workaround is to use flowchart in which I link to the first activity when I want to call recursive (so instead of wraping everything in sequence and calling the same workflow in it, I put the workflow into flowchart and in this case it works…)