Skip to main content

Basic Concepts

Can't wait to start using Laiye RPA to create automated processes?

Before diving into the core aspects of Laiye RPA, it's important to understand some basic concepts. In this chapter, you will be introduced to four basic concepts of Laiye RPA: Process, Block, Command, and Property. They are vital for the rest of the tutorial, so please take your time to read this chapter carefully.


Let's first look at these four basic concepts, and notice how they contain one another. A Process contains multiple Blocks, a Block contains multiple Commands, and a Command contains multiple Properties.

  • Process
  • Block
  • Command
  • Property

A Process is a task to be completed by Laiye RPA, and each Process corresponds to exactly one task. Though you can use Laiye RPA to build multiple Processes, you can only edit and run one Process at a time. Later in this tutorial, you will see that Processes constitute the basic unit in RPA Worker and RPA Commander.

If you have used Quick Macro, a "Process" in Laiye RPA roughly corresponds to a "script" in Quick Macro, but it differs in several important points. For example, a Process is a folder of files, while a script is typically just one file. More significantly, a Laiye RPA Process is displayed in the form of flowcharts.

We recommend that you open RPA Creator and follow along as we introduce new materials. Play around with the software, experiment a little, and see everything in action yourself. As people say, practice makes perfect, and the best way to become a skilled Laiye RPA user is to use it.

RPA Creator already has some built-in example Processes. We encourage you to check them out, run the Processes, and get familiar with how everything works. Of course, you can always create a new Process yourself.


After creating or opening a Process in Laiye RPA, you can see that each Process is represented by a flowchart.

There are four components in the flowchart: "Start", "Block", "Decision", and "End"; and they are connected by arrows. See the figure below:

**Figure 3: The flowchart in RPA Creator**

Each flowchart contains exactly one "Start" component. As the name implies, the Process starts from here and follows the arrows to run sequentially through subsequent components.

There can be zero or more "End" components in each flowchart. Once the Process reaches an "End" component, it stops. When there is no "End" component, the Process simply stops when it reaches a component that has no outgoing arrows.

In each flowchart, there can be any number of "Decision" components. A "Decision" component is associated with a user-defined condition and branches out to two components. When the Process reaches a Decision component, it evaluates the condition and, depending on the result, directs the Process to one of its two branches. If the condition is true, the Process will follow the arrow "yes"; otherwise, the Process will follow arrow "no". If you are a beginner, the component "Decision" may not be needed at the moment. We'll introduce it in detail later.

Last but not least, there must be one or more "Blocks" in the flowchart. And Block is the second important concept to be introduced in this chapter.

We can divide a task into multiple steps, each of which is described by a "Block" in Laiye RPA. For example, if our task is to "put an elephant in the refrigerator", then we can divide this task into three steps:

  • Open the refrigerator door
  • Put the elephant in
  • Close the refrigerator door

Each of the above steps is a Block. Of course, this example is just an analogy. Laiye RPA cannot help us open the refrigerator door. Nevertheless, through this example, we can see that in Laiye RPA, a Block only describes what should be done in a step and does not involve the details of how to do it.

Laiye RPA does not specify how detailed a Block should be. A Block can be very high-level. Indeed, you can have a Process with only one Block. In this case, the Process and the Block can actually be regarded as the same concept. On the other hand, Blocks can be very specific, and a Process can be split into many Blocks. So how many Blocks should a Process have? It depends on your personal preferences. However, there are two principles that should guide your decision. First, each Block should contain relatively independent logic that makes sense as its own step. Second, you shouldn't have too many Blocks in a Process. Our recommended limit is 20 Blocks.

Why do we give these principles? Well, the "flowcharts" in Laiye RPA are designed to be a tool to facilitate communication between "business experts", who design RPA Processes, and "regular employees", who use RPA Processes. The two parties can lay out the general steps of a Process together during the design phase and divide the Process into Blocks. Then, the business experts are responsible for filling in the implementation details of each Block, which the regular employees do not need to know.At this stage, if there are too many Blocks, it will naturally be more difficult for them to communicate.

Notice the button "Run" on the RPA Creator toolbar, located at the top of the screen. Pressing this button in the flowchart interface will run the Process, starting from the component "Start" and executing each subsequent component in a sequence as the arrows indicate. There is also a small blue triangle on each Block. Pressing the triangle runs the Block on its own. This is a convenient function for us to test each Block separately when developing an RPA Process.

You can also view and edit the specific content in each Block by pressing the "edit" button, which is the "pen and paper icon" located next to the triangle button. The editing of an individual Block is done through the "Visual View".

Visual View

As mentioned in the previous section, there is an edit button on each Block. Clicking this button allows you to view and edit the specific content in this Block, and the interface will change from "Flowchart View" to "Visual View".

**Figure 4: Click and edit the Block in the flowchart view**

The interface of "Visual View" that RPA Creator edits a Block looks as follows:

**Figure 5: The interface to edit a Block (Visual View)**

In figure 5, the three main areas are marked with three red boxes.From left to right: the command area, assembly area, and property/variable area.

Here you may notice our third important concept, a Command. In a Block, Laiye RPA needs to be told exactly what action to take and how to do it in each step, andLaiye RPA will execute each Command we give dutifully.Using the previous example, if the Block is "Open the refrigerator door", then the specific Commands might be:

  • Find the handle of refrigerator door
  • Grab the handle of refrigerator door
  • Open the refrigerator door

Of course, as before, this example is just an analogy, and Laiye RPA cannot actually open a refrigerator door.Almost all the Commands that Laiye RPA can complete are listed in the Command area on the left, which is marked by the first red box in the figure above. Commands are divided into many categories, such as Mouse and Keyboard, Text, etc. You can expand each category to further view the specific Commands.

The second red box in the figure contains the "assembly area". Commands can be arranged and combined here to form the specific content of the Block.You can add Commands to the "assembly area" by double-clicking a Command or by dragging and dropping a Command from the "command area" to the "assembly area". You can also drag Commands within the "assembly area" to adjust their ordering or inclusion relationship. You may refer to our Laiye RPA tutorials to see how to interact with these tools.

A Command is an action we ask Laiye RPA to do, but it is not enough on its own. We also need to specify the details of this action. These details are the fourth concept we want to introduce, Property.If a Command is a verb, then Properties are the nouns and adverbs related to this verb. Only by combining them together can we provide Laiye RPA with enough details to execute our request.

In the example earlier, the Command "open the refrigerator door" should have the following Properties:

  • How much force to use to open the refrigerator door
  • Left or right hand
  • How wide an opening to make

When writing a Block, you can highlight a Command by left-clicking it in the "assembly area". The "property/variable area" on the right displays the Properties of the currently highlighted Command. All Properties are either "required" or "optional". Generally speaking, Laiye RPA will automatically set the default value of each Property for you, but please pay attention to the "required" Properties, which often have to be modified as required.For "optional" Properties, it is easier to just use the default values, unless you have specific needs in mind.

The display mode currently shown in the "assembly area" is called "Visual View". In this view, the order and inclusion relationship of all Commands are displayed as a list of boxes, stacked on top of each other, and some implementation details are hidden to simplify the view. The "Visual View" reflects an important feature of Laiye RPA as an RPA platform: it is "simple"to use. Therefore, our designers have put a lot of thought into the layout, degree of detail, and aesthetics of the "Visual View". Even a beginner without any programming experience can quickly learn how to navigate the "Visual View".

Code View

You may have noticed that there is a switch that can be toggled between "Visual" and "Code" above the assembly area, which allows us to access another view, the "Code View". When you toggle to it, the property/variable area disappears,and the assembly area looks as shown in Figure 6.

**Figure 6: The interface to edit a Block (Code View)**

Similar to the "Visual View", the "Code View" also shows the Commands contained in the current Block, as well as the Properties of each Command.However, the Commands are no longer contained in neat boxes, and there is no property area to list each Command's Properties. Instead, they are all displayed as program code.

If you are already familiar with Laiye RPA, the "Code View" allows you to write Commands and specify Properties using only your keyboard.Laiye RPA Creator implements many optimizations to help you quickly select Commands and fill in their Properties in the "Code View", which makes implementing Blocks a breeze.

**Figure 7: Add Commands in the Code View**

The "Visual View" and the "Code View" describe the same content within a Block. They are actually two different ways to display the same underlying content.The "Visual View" highlights each Command and their relationship graphically, which is great for showing the overall logic of the Block. The "Code View" emphasises the essence of the Block in the form of program code and fully exposes all the details.

**Figure 8: The two views of an aircraft**

For example, the Visual View and Code View are like the two views of plane above.In fact, the left and right wings of this F-16 aircraft are basically symmetrical, but why do they look so different? Well, the right wing is drawn in exterior view to show the overall shape, while the left wing is drawn in perspective view to show the internal structure.By using the two views to show different aspects of the same aircraft, we highlight different aspects of our content to the audience.In the same way, using two views to show the different contents of the same Block in Laiye RPA allows us to be both "simple" and "fast", two of the important indicators of an RPA platform.

Some of you might be wondering whether you should use the Visual View or the Code View to develop RPA processes. The answer is that you don't have to worry about this, because no matter which view you use, you can switch to the other one at any time. No matter what you write in one view, the content will be 100% retained when you switch to the other, and it will be shown in the other view's format.Therefore, you can use the Visual View first. After being more familiar with it, you can switch to the Code View and learn each Command's internal principles. If you feel it is still difficult to understand, you can always switch back to the Visual View. So, there is no need to worry about which view to use, and this capacity to toggle between the two views at any time is a great strength of Laiye RPA!

Finally, the Code View has another advantage. When you ask others for help on our Laiye RPA community or in other platforms, you can just switch to Code View, copy your source code, and share your Blocks as text. Others can read your source code directlyor copy your source code into their own Laiye RPA Creators and switch to the Visual View to inspect your Blocks. In this way, the efficiency of communication will be greatly improved.

The programming language used in the Code View is Laiye RPA's self-developed BotScript language, and its specific language features will be introduced in detail later.


In this chapter, we learned four important concepts: Process, Block, Command, and Property.A Process contains multiple Blocks, a Block contains multiple Commands, and a Command contains multiple Properties.We also checked out three different views: Flowchart View, Visual View and Code View. The Flowchart View provides a visual overview of the whole Process, while Visual View and Code View are two different ways to display a Block. Their relationship is shown in the following figure:

**Figure 9: The relationship between the four concepts and the three views**

Advanced Content

This section is advanced content, introducing how to transfer data between multiple Blocks and how to use the Decision component in the flowchart. If you are a beginner in Laiye RPA, you can skip it for now.

Global Variable

Both flowcharts and Blocks can use variables to store data. However, variables in a Block can only be used in that Block and cannot be accessed by the flowchart or other Blocks directly. Starting from RPA Creator Version 5.0, users can also define variables in the flowchart. Variables defined in the flowchart can be used directly in all Blocks in the flowchart.

Now let us exemplify the specific usage of global variables.

Suppose there is a flowchart with two Blocks, named "Block 1" and "Block 2", as shown in the Figure 10. "Block 1" runs first. Itobtains the current system time, formats it as a string, and outputs to "Block 2". Then, "Block 2" starts to run. It displays the output of "Block 1" as debug information in RPA Creator.

**Figure 10: The two Blocks running in sequence**

Since the "System Time in String Format" is needed in both "Block 1" and "Block 2", we need to define this variable first in the flowchart. In the flowchart, global variables are listed on the right side in the "Flowchart variable" area. And when a Block is selected, its properties will be shown in the property/variable area. Click the button "New variable" to enter X (not case sensitive).

**Figure 11: Add variables in the flowchart view**

Click the "edit" button on Block 1 to enter its Visual View. Insert a Command "Get Time" and then a Command "Format Time" (under the category "Time"), and set the Property "Time" of the Command "Format Time" as the result of the command "Get Time". In this way, you can get the current time and save it in the variable "sRet" in an easy-to-read format. Since the "System Time in String Format" is also needed in Block 2, the command "Variable Assignment" should be inserted to assign the value of the variable "sRet" to the global variable "X".

**Figure 12: The Visual View of Block 1**

On the right side of the "Visual View" and "Code View", as you can see, there is a button to check block variables in this Block and global variables that can be used in all Blocks.

**Figure 13: The global variables**

**Figure 14: The block variables**

Return to the Flowchart View and click the edit button on Block 2 to insert the Command "Output Debug Info" and set the Property "output to" to "X" ( "X" can be directly used in Block 2 as it is a global variable.).

**Figure 15: The Visual View of Block 2**

After finishing editing the two Blocks, we can click the "Run" button to see the result of the whole process. The current time in the string format will be output.

Input and Output of Flowchart

Global variable is supported in RPA Creator 5.0 and versions above, providing a new method to transfer data among different Blocks. There is another way to transfer data between Blocks in Laiye RPA. When a Block starts running, it can take an "input" value from the flowchart, which is either a variable or an expression, to use within the Block. When a Block stops running, it can also "output" a value to a variable in the flowchart.

In the flowchart, left-click select a Block, and its Properties will appear in the Property area on the right. It contains two fields: "input" and "output", as shown in the left figure of Figure 16. If you need to transfer data from the flowchart into a Block, then fill in the "input" field with the data to be transferred (variables, expressions, etc.). Doing so creates a special variable called Self.Input within this Block, which has the same value as specified. If you need to transfer data out of a Block, write a Return statement inside the Block and enter a variable name in the "Property" field in the Flowchart View to store the Block output value to the variable.

As we will mention later, the programming language used by Laiye RPA is not case sensitive (for keywords and variable names), meaning that you can write SELF.INPUT , self.input , or RETURN , and they are all accepted.

**Figure 16: The flowchart property**

Next, we will illustrate the specific use of Block input and output with the example from the previous section.

First, select "Block 1" and fill in a variable name in its "output" field, naming it X. Then, select "Block 2" and fill in the variable name x as its "input" property (notice how Laiye RPA is case-insensitive).Through the flowchart variable X , the output of "Block 1" and the input of "Block 2" are connected, as shown in the Figure 17.

**Figure 17: Connect the output of Block 1 to the input of Block 2 through the same variable**

This variable X is only valid in the current flowchart, and its role is just to connect the two Blocks. Neither Block 1 nor Block 2 can access X directly.

Insert a "Jump Out and Return" Command (under the category "Grammar") and set "sRet" as the return value, so that Block 1 outputs the correct value, and the value of "sRet" is stored in the variable X in the flowchart, as shown in Figure 18.In order to help you understand, the figure has both the Visual View and Code View of this Block, and you can choose which one to read.

**Figure 18: Output current time in Block 1**

Then, return to the Flowchart View and click the "edit" button to enter Block 2. You only need to insert a "Output DebugInfo" Command, and set the Property "Content of output" to Self.Input (In this case, the value of the global variable X has been stored in Self.Input in the Block), as shown figure 19.Similarly, we also provide both the Visual View and Code View of this Block for better understanding.

**Figure 19: Output the output of Block 1 as debug information in Block 2**

Return to the Flowchart View and click the "Run" button. You can see the output of the whole process at the bottom of RPA Creator. Please note that since Block 2 relies on the output of Block 1, you need to run the entire process (which includes Block 1 and 2) to see the correct result.If you run Block 2 on its own, the results may be different due to the lack of output from Block 1.

Comparison of Data Transfer Methods in Flowcharts

Global variables and the input and output of flowchart are two methods to transfer data between Blocks. Generally speaking, the former more convenient, intuitive and fast to use, while the latter is logically clearer. In general, we recommend using global variables.

Implementation of Complex Flowcharts

Some of you may be wondering why Laiye RPA only provides four components: "Start", "Block", "Decision", and "End". Moreover, "Start" and "End" are not really "powerful" components, but signposts to direct the flow of the process. Is Laiye RPA up to the task for creating complex flowcharts by using only the "Block" and "Decision" components?

**Figure 20: Complex flowchart**

Don't underestimate the components of Laiye RPA. No matter how complex the flowchart is, we can implement it by simply arranging and combining our four components.

Let's break it down. No matter how complex a flowchart is, it can be decomposed into one of three types of structures: sequential, conditional, and iterative.Let's take a look at how these three types of flowcharts are implemented with Laiye RPA respectively.

Sequential Structure

A sequential flowchart has the simplest structure. Each step is executed one after another, in a given order. As shown in Figure 21, A, B, and C are three consecutive steps of the flowchart, and they are executed in order, so the next action begins only after the operation specified in the previous action is completed.

**Figure 21: Sequential structure**

In Laiye RPA, you can implement this structure using a sequential flowchart, as shown in Figure 22.

**Figure 22: Sequential flowchart**

Conditional Structure

A conditional structure is also called the branching structure. It controls the flow of the process based on some specified conditions. If the condition is true, the process takes one route; if the condition is false, the process takes the other route. In practice, you may leave one of the branches empty (see the second and third examples in Figure 23).

**Figure 23: Conditional structure**

In Laiye RPA, you can implement a conditional structure using a Decision component in the flowchart. See Figure 24.

**Figure 24: Implement conditional structure example 1 in Laiye RPA**

**Figure 25: Implement conditional structure examples 2 and 3 in Laiye RPA**

Loop Structure

A loop structure is also called a repetition structure. It instructs the process to repeatedly execute a given operation under certain conditions. A loop structure can be classified into a while structure and an until structure.

A loop structure can be seen as a combination of a conditional andgo back operation. When implementing in a flowchart, you need to specify a condition in the Decision component, and one of the two branches of the Decision component points back to the Decision component itself.

While Structure : decide whether the condition P is satisfied. If it is, execute step A. Then, loop back to the conditional and decide whether P is satisfied again. If it is satisfied again, execute step A. Repeat this process indefinitely whileP is satisfied, but when P finally evaluates to false, leave this process.

**Figure 26: The while structure**

Until Structure : execute step A, and then decide whether the condition P is satisfied. If it is not, then execute A again. Repeat this process until P is satisfied, then leave this process.

**Figure 27: The until structure**

In Laiye RPA, these loop structures can be implemented by loop flowcharts shown in Figure 28.

**Figure 28: Implement loop flowchart in Laiye RPA**

Specifically, Laiye RPA uses the component "Decision" to implement this logic. Drag a "Decision" component into the flowchart, and left-click it to view its Properties, as shown in Figure 29.The Property "Expression" is very important, and you may fill in a variable or an expression. When the process reaches this "Decision" component, it will decide which output branch to continue along based on how condition evaluates.

**Figure 29: The expression**

The component "Decision" has twoarrows pointing outwards, one marked with "yes" and one marked with "no". When the Decision component's condition is satisfied, it continues along the "yes" arrow; otherwise, it continues along the "no" arrow.

**Figure 30: Determine the process based on the expression**