I am developing a UiPath automation based on the REFramework that interacts with four different applications throughout the process.
I have a question regarding the best practices recommended by UiPath.
Is it better to open and connect to all applications in the Init phase, or is it recommended to open the applications in the Process phase?
I am looking to understand what the approach is that aligns best with UiPath best practices in terms of architecture, performance, error management, and maintenance.
It depends on your scenario. If all four applications are required for processing every transaction, opening and logging into them during the Init state is the recommended approach. This avoids repeated logins, improves performance, and ensures any login issues are detected before transaction processing begins.
If some applications are only needed for specific transactions, open them during the Process state only when required. This helps avoid unnecessary resource usage and reduces the risk of session timeout.
Do let me know if your scenario is different from the above. That will help us suggest the most suitable approach.
As per the UiPath REFramework best practices, all applications should be initialized in the Init state (InitAllApplications.xaml).
Initializing applications at this stage ensures that all required systems are up and ready before the robot starts processing any transactions.
If application initialization is performed in any other state, there is a risk that a transaction may fail due to application-related issues, such as unavailable sessions, failed launches, or connectivity problems. By completing all application setup in the Init state, you can detect and handle such issues before transaction processing begins.