I am relatively new to RPA and currently the only RPA developer at my organization.
I recently made a flow for an insurance company, probably my biggest project yet.
It was linked with automating a web page that had several verification steps. As such, there were a lot of variable web states so i had to use a lot of ‘Check app state’ activities.
The flow works almost perfectly, albeit a little slow, but it has gotten really difficult to manage, since there are soo many conditions i often get lost while debugging any issues.
Im sure in the industry there are even bigger flows. So my question is, how does one properly manage such flows? should i create sub workflows for each web page or something?
As best practice we create smaller flows with each flow doing a specific activity and call all of them in the process in required order…this way code modularity is maintained
It’s a good practice to create sub workflows as per application/functionality/pages/screens as per your best suitability.
Here are some best practices I summed up using LLM for managing and optimizing your workflows, which can help make them more maintainable and efficient:
1. Break Down the Workflow into Smaller Sub-Workflows
Dividing your large workflow into smaller, reusable components or sub-workflows can help manage complexity. Each sub-workflow can automate a specific part of the process, making it easier to develop, debug, and maintain.
2. Use Meaningful Names and Proper Organization
Ensure that all workflows, variables, and arguments have meaningful names. Properly organizing and naming these elements makes the workflow more understandable and easier to follow.
3. Implement Consistent Error Handling and Logging
Use Try-Catch activities to manage exceptions and ensure that errors are logged appropriately. This can help in identifying issues quickly during debugging and maintenance.
4. Utilize State Machines for Complex Control Flows
For workflows with many conditional checks or variable states, using state machines can be beneficial. They allow you to better manage different states and transitions, providing a clear structure for complex logic.
5. Modularize and Reuse Components
Identify repetitive tasks and create reusable components or libraries. This reduces redundancy and ensures consistency across different processes.
6. Maintain Clear and Detailed Documentation
Document your workflows thoroughly. This includes explaining the purpose of workflows, the logic behind complex decisions, and how to handle common issues. Good documentation is essential for collaboration and future maintenance.
7. Optimize Activity Use for Performance
Optimizing the activities used can help improve the performance of your workflow. Utilize activities that are less resource-intensive and fine-tune the workflow to reduce unnecessary steps.
8. Utilize UiPath Orchestrator for Better Management
Leverage UiPath Orchestrator to manage, schedule, and monitor your workflows. Orchestrator provides a robust platform for deploying and managing RPA bots across different environments.
9. Regularly Review and Refactor Code
Regularly review the workflow and refactor it to improve efficiency, readability, and maintainability. This practice helps to identify bottlenecks and optimize performance.
Hi, so in my particular case, there werent one single activity that kept repeating, but every web page had a different set of instructions, so i didnt quite understand how to integrate subflows into it and every page had different set of decisions to be made.
one thing that i thought could be done was maybe have different subflows for each page
Say in a page there are 20 actions that are happening…loading the page ,fill data,retreiving data and making decisions can be the sub flows based on what all you need
So that eqch piece can be tested eqsily and have a main flow which calls all of these flows in one xaml…
Generally in sub flows we do interactions with applications like navigations,reading data etc…and decisions would be done in main flow based on data retreived…this way external interactions xan be tested and then as decisions are based on values retreived we can store them in arguments and pass to main flow where different decision making is done
If on different pages if we are doing limited tasks and as said you can do page wise flows as well…but remmeber that means if you wnat to test you need to test full page or have tun from this activity used