How RPA Works
An RPA bot works by watching how a user interacts with a computer and then repeating those interactions automatically. It identifies the exact buttons, fields, and windows on the screen and controls them just like a human would with a mouse and keyboard.
The Three-Step Engine Behind Every Bot
Every RPA workflow runs on three core operations: Read, Process, Write.
Diagram: The Read–Process–Write Loop
┌───────────────┐ ┌───────────────────┐ ┌──────────────────┐
│ READ │────▶│ PROCESS │────▶│ WRITE │
│ │ │ │ │ │
│ - Open email │ │ - Check condition │ │ - Fill form │
│ - Open file │ │ - Apply rules │ │ - Send email │
│ - Scrape web │ │ - Calculate value │ │ - Save record │
│ - Query DB │ │ - Make a decision │ │ - Update system │
└───────────────┘ └───────────────────┘ └──────────────────┘
▲ │
└─────────────── LOOP (repeat for next item) ◀────┘
Step 1 – The Bot Identifies Screen Elements
When a bot runs, it first needs to locate the correct element on the screen — such as a text box, a button, or a dropdown menu. It does this using something called a selector.
A selector is like a home address for a screen element. It describes the exact location and identity of a button or field using properties like its name, ID, position, or the window it appears in.
Real-World Example: Login Form
Screen Element: Username field in SAP Login Window Selector (simplified): Window Title = "SAP Logon 750" ► Field Label = "User" ► Field Type = "Text Input" ► Field ID = "wnd[0]/usr/txtRSYST-BNAME" Bot Action: Type "john.doe@company.com" into this field
Step 2 – The Bot Executes Actions
Once the bot locates a screen element, it performs the required action. Common bot actions include:
- Clicking a button
- Typing text into a field
- Selecting a value from a dropdown
- Copying and pasting data
- Opening and closing applications
- Downloading or uploading a file
- Taking a screenshot for logging
Step 3 – The Bot Follows a Workflow
Bots do not perform random actions. They follow a workflow — a structured sequence of steps defined by the developer. A workflow is built using an RPA tool like UiPath or Automation Anywhere using a visual drag-and-drop editor or code.
Diagram: Sample Bot Workflow – Invoice Processing
START │ ▼ Open Outlook → Search for emails with subject "Invoice" │ ▼ Download PDF attachment from each email │ ▼ Open PDF → Extract: Vendor Name, Invoice No., Amount, Date │ ▼ Open ERP System (e.g., SAP) → Navigate to "Post Invoice" screen │ ▼ Fill fields: Vendor Name | Invoice No. | Amount | Date │ ▼ Click "Post" → Confirm success message appears │ ▼ Log result in Excel: Invoice No. | Status | Timestamp │ ▼ Move to next email → Repeat until all emails processed │ ▼ END → Send summary report by email
How Bots Handle Decisions
Bots can follow rules to make simple decisions. For example: "If the invoice amount is greater than $10,000, send it for manual approval. Otherwise, post it directly."
This type of logic uses standard programming concepts like IF-ELSE conditions. The bot does not guess or think — it checks a rule and picks the right path.
Decision Flow Example
Invoice Amount Received
│
▼
Amount > $10,000?
/ \
YES NO
│ │
▼ ▼
Send for Post directly
manual in ERP
approval
How Bots Handle Repetition
Most RPA tasks involve processing not just one record, but hundreds or thousands. Bots use loops for this. A loop tells the bot to repeat the same set of steps for each item in a list — such as each row in a spreadsheet or each email in an inbox.
Loop Example
Excel file has 200 rows of customer data Loop starts at Row 1 → Read customer name, email, account ID → Log into CRM → Create customer record → Save and confirm Move to Row 2 → Repeat ... Loop ends at Row 200 → Done. 200 records created.
How Bots Interact with Applications
RPA bots interact with software at the UI (User Interface) layer. This means they work on screen just like a human does — they do not connect through back-end APIs by default. This is why RPA works with almost any application, even old legacy systems that have no modern API.
Interaction Methods
| Method | Used When | Example |
|---|---|---|
| UI Automation | Desktop apps | Clicking in SAP, filling Excel forms |
| Web Automation | Browser-based apps | Filling web forms, scraping web tables |
| Image Recognition | No selectors available | Clicking a scanned image button |
| API Calls | Modern apps with REST APIs | Sending/receiving JSON data |
| OCR (Text Recognition) | PDFs, scanned documents | Reading invoice amounts from images |
Where the Bot Lives
A bot runs on either a physical machine or a virtual machine (VM). In large companies, many bots run simultaneously on separate virtual machines managed by an Orchestrator — a central control panel that schedules, monitors, and manages all bots.
Summary
RPA bots work by identifying screen elements using selectors, executing a sequence of actions defined in a workflow, and repeating tasks in loops. They make rule-based decisions using IF-ELSE logic. Bots interact with the visible user interface of applications — which means they work on any software a human can operate, without needing back-end code changes.
