Building Resilient Workflows in RPA with UiPath RE-Framework

Bantu Kumar
Globant
Published in
5 min readNov 25, 2020

RPA?

Robotic Process Automation (RPA) is one of the trending technologies that allows organizations and individuals to automate repetitive manual tasks to execute a business process across multiple applications and systems.

Compared to traditional IT solutions, RPA allows automating the business process at fractional cost and time. RPA is an ideal solution for applications that do not have APIs or database access to heterogeneous legacy systems and we don’t want to build a brand new application. Simply deploying an RPA bot in these cases can save time and money for the business.

RPA Platforms

Software platform for RPA is computer software that allows automating business processes in the form of a series of actions or activities, can be called workflow, utilizing another software agent to perform the automated process.

There are several vendors in this RPA market with their unique software platform for RPA. UiPath, Automation Anywhere, Blue Prism, Work Fusion, Pega, Power Automate, etc. are some of the leaders in RPA technology.

Workflows

To facilitate automation of different types of business processes, UiPath offers the following four (as of Nov 2020 ) different workflow layout types

  1. Sequences
  2. Flowcharts
  3. State Machines
  4. Global Exception Handler

RE Framework uses the State Machine layout as it’s backbone.

RE Framework?

Robotic Enterprise Framework, also popularly known as the RE framework is built on top of the Transactional Business Process template, and uses the State Machine layout for the phases of the automation project, and offers a high-level of exception handling and application recovery.

A state machine is a type of automation that uses a finite number of states in its execution. A Finite-State Machine (FSM) or simply a State Machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some external inputs; the change from one state to another is called a transition.

The framework helps developers automate processes with industry best practice principles. Thus enable us with

  • Clean starts and exists
  • Automated recoveries
  • Retries
  • Status management
  • Clean coding
  • Logging

Some of the key features of the RE Framework are mentioned below.

Benefits of RE Framework

Low code signature: The RE framework provides a handful of clearly written, commented reusable functions that anyone can understand and a commented Main.xaml which brings structure to the process design architecture

Separation of concerns: Framework implementation is separate from business logic code, allowing developers and SMEs alike to focus on building processes

Reusability: Works for any type of process, Independent of Data sources (Queue-Items, local excel files, Database data, API retrieved data), Independent of process linearity

Maintain, extend, and upgrade: Easy to maintain, thanks to code lightness and SOC. Extend to achieve process behavior by editing 6 empty workflows that connect to the Main.xaml in a standard way. Enables the developers to upgrade or extend framework independently of business code, by editing only one file, the Main.xaml

Exception recovery and retry: Top-level exception recovery is managed by the framework layer with Retry rules which can be easily configured.

Audit: Keeps track of the robot’s work, with as much detail and privacy as you choose with the new Workblock concept; Add business information of your choosing to the published log.

Going Deeper with RE Framework

RE Framework State diagram

The Finite states provided are:

  1. Init State

The initializing state is used to initiate an application and set up static variables that are needed for the process. It acts as the constructor. It is also a place for cleaning the work environment so that the robot can perform the process without any interruptions. The major responsibilities of this state machine are:

  • Reading configuration from global config file — By default, the RE framework provides a way to read the configuration from a .xlsx file. However, it is very easy to modify the template to use any other source like a DB, JSON file, etc.
  • Initialize all necessary applications — Perform steps to initialize the applications used in the workflow.
  • Recover the environment — from system error for Robot by closing and initializing the all.

2. Get Transaction Data State

In this state returns a single transaction Item to be worked upon. The transaction item that is returned by this state, acts as an input to the Process state.

By default, the transaction item provided by the RE framework is a QueueItem. However, it can be configured to use a DataRow or any other customized class, very easily.

If there are no more transaction items for processing then the robot goes to the End Process state.

3. Process Transaction

Business-specific workflows are implemented here or in short, the actual process logic is work in this state. If we consider in terms of MVC, the Process Transaction state would be a Model where we are writing our business logic.

If there is an error in execution, it process goes to Init state and the same transaction is again executed depending on the retry number configured. The retry number decides how many times the transaction is to be retried in case of error.

If the process execution is successful or there is a Business / Rule Exception, then its execution continues by getting the next transaction in the Get Transaction Data State.

4. End Process

The process goes in this state if there are no more transactions to process or there is a System Error and the process cannot go ahead with the execution.

Conclusion

RE-Framework will help us to build scalable and robust RPA BOTs. The framework is available as a template project in UiPath studio which can be leveraged to start building an automation project in a few clicks. Additionally, you can make tweaks in the template that fits best to your requirement.

--

--

Bantu Kumar
Globant
Writer for

Technical Director at Globant India. A technology enthusiast with 13+ years of industry exp. developing & designing solutions, and architecturing applications.