Introduction
Robotic Process Automation (RPA) has transformed how organizations handle repetitive, rule-based tasks. UiPath is one of the leading RPA platforms, enabling businesses to automate processes that involve interacting with desktop applications, web portals, spreadsheets, and legacy systems. Unlike API-based automation, RPA interacts with applications through their user interfaces, making it possible to automate systems that lack APIs.
This guide covers the fundamentals of UiPath, from building your first automation to orchestrating robots at scale and integrating AI capabilities.
Understanding UiPath
UiPath consists of several components that work together:
UiPath Studio
Studio is the visual development environment where you build automation workflows. It uses a drag-and-drop interface with activities that represent actions like clicking buttons, reading files, or sending emails. Workflows are built using flowcharts, sequences, and state machines.
UiPath Robot
Robots are the execution engines that run the workflows you build in Studio. Robots can run attended (with human interaction) or unattended (fully automated, typically on a server).
UiPath Orchestrator
Orchestrator is the centralized management platform. It handles:
- Scheduling: When robots run and how often
- Queues: Managing work items for robots to process
- Monitoring: Tracking robot performance and errors
- Deployment: Publishing and versioning automation packages
- Asset management: Storing credentials and configuration
Building Your First Automation
Let’s build a practical automation that reads data from an Excel file, processes each row, and sends an email summary.
Step 1: Create a New Process
- Open UiPath Studio and click “Process” to create a new project
- Name your project “EmailSummaryAutomation”
- You’ll see a blank sequence in the designer panel
Step 2: Read the Excel File
Use the Excel activities to read data:
' Read Range activity configuration
' Input: "C:\Data\Customers.xlsx"
' Sheet: "Sheet1"
' Range: "A2:D100"
' Output: dtCustomers (DataTable variable)
In the visual workflow, this appears as:
- Drag “Excel Application Scope” activity
- Add “Read Range” activity inside it
- Set the output variable to
dtCustomers
Step 3: Process Each Row
Use a “For Each Row” activity to iterate through the data:
' Inside For Each Row activity
' For each row in dtCustomers
Dim customerName As String = row("Name").ToString()
Dim email As String = row("Email").ToString()
Dim amount As String = row("Amount").ToString()
Dim status As String = row("Status").ToString()
' Only process pending items
If status = "Pending" Then
' Build email body
Dim body As String = $"Dear {customerName}, " + _
$"Your order amount is ${amount}. " + _
$"Please complete the payment."
' Send email activity
' To: email
' Subject: "Payment Reminder"
' Body: body
End If
Step 4: Add Error Handling
Wrap your activities in Try Catch blocks to handle errors gracefully:
Try
' Read Excel file
' Process rows
' Send emails
Catch ex As Exception
' Log the error
' Send notification to admin
LogMessage("Error: " + ex.Message, LogLevel.Error)
Finally
' Clean up resources
' Close Excel application
End Try
Using Variables and Arguments
UiPath uses variables for data within a workflow and arguments for passing data between workflows:
Common Variable Types
- String: Text values
- Int32: Whole numbers
- Boolean: True/false values
- DataTable: Tabular data from Excel or CSV
- GenericValue: Flexible type that can hold any value
Arguments
Arguments let you create reusable workflows:
' Workflow: ValidateEmail
' In argument: emailAddress (String)
' Out argument: isValid (Boolean)
' Use .NET regex for validation
Dim pattern As String = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
Dim regex As New System.Text.RegularExpressions.Regex(pattern)
isValid = regex.IsMatch(emailAddress)
Orchestrator and Queues
Orchestrator queues are essential for scaling RPA. Instead of processing all items in one run, you add items to a queue and let robots process them.
Creating a Queue
- In Orchestrator, navigate to Queues and create a new queue
- Define the queue schema with expected fields
- Set retry policies (e.g., retry failed items 2 times)
Adding Items to a Queue
' In your dispatcher workflow
' Read data from source
For Each row In dtCustomers
Dim queueItem As New Dictionary(Of String, Object)
queueItem("Name") = row("Name").ToString()
queueItem("Email") = row("Email").ToString()
queueItem("Amount") = row("Amount").ToString()
' Add to Orchestrator queue
AddQueueItem("CustomerProcessing", queueItem)
Next
Processing Queue Items
' In your performer workflow
' Get transaction item
Dim transactionItem = GetTransactionItem("CustomerProcessing")
If transactionItem IsNot Nothing Then
' Extract data from the queue item
Dim name As String = transactionItem.SpecificContent("Name").ToString()
Dim email As String = transactionItem.SpecificContent("Email").ToString()
Dim amount As String = transactionItem.SpecificContent("Amount").ToString()
' Process the item
' Send email, update system, etc.
' Mark as successful
SetTransactionStatus(transactionItem, "Successful")
Else
' No more items in queue
' Stop the robot
End If
Combining RPA with AI
The real power of modern RPA comes from combining it with AI capabilities. UiPath provides AI Center and Document Understanding for this purpose.
Document Understanding
Document Understanding uses AI to extract data from documents like invoices, receipts, and contracts:
' Digitize document using OCR
Dim digitizedDocument = DigitizeDocument("C:\Invoices\invoice.pdf")
' Classify the document type
Dim documentType = ClassifyDocument(digitizedDocument)
' Extract data using ML model
Dim extractedData = ExtractData(digitizedDocument, documentType)
' Use extracted values
Dim invoiceNumber As String = extractedData("InvoiceNumber")
Dim totalAmount As String = extractedData("TotalAmount")
Dim vendorName As String = extractedData("VendorName")
' Enter data into target system
TypeInto("invoiceNumberField", invoiceNumber)
TypeInto("amountField", totalAmount)
AI Center Integration
UiPath AI Center lets you deploy custom ML models that robots can call:
' Call a custom ML model deployed in AI Center
Dim mlSkill = New MLAsyncSkill("http://aicenter.local", "SentimentAnalysis")
Dim inputText As String = "The product quality is excellent but delivery was late."
Dim prediction = mlSkill.Predict(inputText)
Dim sentiment As String = prediction("label")
Dim confidence As Double = prediction("confidence")
If sentiment = "negative" And confidence > 0.8 Then
' Route to customer service team
AddQueueItem("CustomerServiceQueue", New Dictionary(Of String, Object) From {
{"text", inputText},
{"sentiment", sentiment},
{"confidence", confidence}
})
End If
Best Practices
-
Use the REFramework: UiPath’s Robotic Enterprise Framework provides a production-ready template with error handling, logging, and retry logic built in.
-
Separate dispatcher and performer: Use one workflow to add items to a queue (dispatcher) and another to process them (performer). This improves scalability and error handling.
-
Implement proper logging: Log key events, errors, and business metrics. This is essential for monitoring and debugging.
-
Use selectors wisely: UI selectors should be robust. Avoid selectors that depend on dynamic values like auto-generated IDs. Use anchors and relative selectors.
-
Handle exceptions gracefully: Not every error should stop the robot. Distinguish between business exceptions (data issues) and system exceptions (technical failures) and handle them differently.
-
Version your automation: Use Orchestrator’s versioning to manage updates. Never deploy untested changes directly to production.
Conclusion
UiPath provides a comprehensive platform for automating business processes that involve user interface interactions. Starting with simple automations and gradually incorporating Orchestrator queues, error handling, and AI capabilities allows you to scale from single-process automation to enterprise-wide RPA programs.
The key to successful RPA implementation is choosing the right processes to automate—those that are repetitive, rule-based, and high-volume. Start with a pilot project, measure the results, and expand from there. Combining RPA with AI capabilities like Document Understanding opens up possibilities for automating more complex, judgment-based tasks that were previously out of reach.