Introduction
OpenRPA
OpenRPA is a free, open-source, enterprise-grade Robotic Process Automation (RPA) platform that can automate tasks and processes. OpenRPA is easy to use, flexible, scalable, and secure. It has a drag-and-drop interface, pre-built activities, and supports various input and output formats. OpenRPA can also interact with multiple applications and systems.
OpenCore (formerly OpenFlow)
OpenIAP Flow (OpenCore) is a versatile framework designed to simplify the creation, deployment, and management of distributed code. And it’s an orchestrator of node red instances and OpenRPA robots.
Node-RED
Node-RED is a visual programming tool used to automate Software APIs and hardware devices (IoT). In OpenIAP flow we can start an agent with Node-RED preloaded with a lot of OpenIAP flow specific nodes. It provides an in-browser editor where you can connect flows using any nodes available. Each node represents a step that when wired together forms a meaningful task. It also follows a common pattern: input, processing and output. It simply connects the inputs to the workflows and allows them to process it.
Requisites:
- Git (optional) — For cloning the Docker repository
- Docker Desktop — For containerized application deployment
- Node-RED — For scheduling OpenRPA bot tasks
Setup OpenFlow (OpenCore) in Localhost
Detailed steps for the OpenFlow setup can be found in the blog:
If this is already done, this step can be skipped and go to the next step.
Step 1: Install Git (Optional)
Git is a version control system. We’ll use Git to pull the OpenRPA-Docker repository required for the OpenFlow connection.
Download & Install Git
- Visit the official Git website. Download the latest Git installer for your OS and run the installer.
- Continue through the installation wizard, keeping the default settings unless you have specific requirements.
Verify the Installation
- In the Command Prompt or Terminal, type the following command:
git - version
- This command will display the installed version of Git, confirming that the installation was successful.
Step 2: Install Docker Desktop
Docker is essential for setting up OpenFlow, which will help orchestrate your Node-RED and OpenRPA bots.
Download Docker Desktop
- Go to the official Docker Desktop website. Click on the “Download Docker Desktop” button & select your OS. This will start downloading the Docker Desktop installer.
Run the Installer
- Run the Docker Desktop installer & follow the prompts in the installation wizard, keeping the default settings unless you have specific requirements.
- During installation, Docker Desktop may prompt you to enable the Windows Subsystem for Linux (WSL 2) if it’s not already enabled. Follow the on-screen instructions to do so, as WSL 2 is essential for running Docker containers on Windows effectively.
Restart Your Computer
- It’s important to restart your computer to ensure the installation changes take effect.
- Verify the Installation
- After the computer restarts, open the Docker Desktop application.
- You can verify that Docker is running correctly by opening a command prompt or Terminal and typing:
docker - version
- This command should return the installed version of Docker, confirming the installation was successful.
Step 3: Clone the Open-RPA Docker Repository
This repository provides Docker Compose files for setting up OpenFlow.
Open a Shell
- Open Command Prompt or PowerShelland navigate to Your desired directory
- Use the cd command to navigate to the folder where you want to save the cloned files.
cd C:\path\to\your\directory
- Replace C:\path\to\your\directory with your preferred location.
Clone the Repository
- If you have Git installed in the system, run the following command to clone the Open-RPA docker repository:
git clone https://github.com/open-rpa/docker.git
- This command downloads the entire repository to your local machine.
- If Git is not installed, simply go to the open-rpa/docker repository in github.
- – Click on <>Code dropdown
- – Select Download Zip option
- – This will download a zip file of the repository
- – Unzip the downloaded file and open terminal from this directory
Navigate to the Docker Directory
- After cloning/downloading, move into the newly created Docker directory:
cd docker
Step 4: Start Docker Compose
Open Docker Desktop
- Launch Docker Desktop application.
- To check the docker desktop is up and running, enter the following command in the terminal or command prompt:
docker ps
- This command lists all running Docker containers. Since there are no containers present by default, the output will display only the column headers, indicating Docker is up and ready for use.
Run Docker Compose
- To start with the docker-compose.yml file, run:
– On Windows:
.\normal-up.bat
– On Linux/Mac:
./normal-up.sh
Check Docker Container & Images created
- Click on the “Containers” tab (opened by default) to view the different images being created. We can see various containers listed as Docker Compose pull the necessary images and set them up according to the configuration specified in the docker-compose.yml file.
- Troubleshooting: If the container ‘demo’ is not created in Docker Desktop, try running normal-up.bat command again in the terminal.
- If something is still not working, make sure all instances are running, simply open the terminal and enter the following commands:
docker ps
and make sure all below instances are running.
Open OpenFlow in Localhost
Now you’re all set with the installation. Navigate to http://localhost.openiap.io to see the login page for OpenFlow running on the localhost. You can enter any username and password on this sign-in page, which will serve as the administrator of this installation.
http://localhost.openiap.io
Upon opening the dashboard, we can see all the items in OpenFlow successfully displayed, confirming that the setup was completed successfully.
Connect OpenRPA to OpenFlow
When OpenRPA is installed on the system, it is connected to OpenFlow, which is hosted in the cloud. OpenRPA is designed to work in tandem with OpenFlow, but it can also operate in standalone mode without needing to be connected to an OpenFlow instance. To connect it to our locally hosted OpenFlow, you need to modify the settings.json file, which provides the configuration for OpenRPA to run.
- Make sure OpenRPA is not running while changing the configuration
- Open the file settings.json, which is located in the following directory:
Documents/OpenRPA
- You can also open this file directly from the OpenRPA interface by selecting the ‘Settings File’ option in the File menu in the top menu bar.
- In the settings.json file, locate the wssurl property. This is usually found on the first line.
- Update the URL:
– Remove the existing URL:
– Replace it with the new URL:
- Change the property name from wss to ws. This is because we are not using certificates, and wss is typically used for secure connections with certificates (https), but we don’t need that for now.
- The first lines of settings.json file should look like this after changes:
- After making these changes, save the settings.json file.
- Open OpenRPA again. It should now connect to your locally hosted OpenFlow instance.
- After launching OpenRPA, we can see in the connection dialog to confirm that it is now connected to the local OpenFlow instance
- While OpenRPA is loading, the local browser will open automatically, opening the openflow URL, hosted on localhost.
- Login with the localhost openflow credentials if it is not already logged in.
- Now we will be seeing that OpenRPA is connected to your local OpenFlow instance.
Connect OpenFlow to Node-RED
To get started with Node-RED in OpenFlow:
- In the side menu, click Agents.
- On the Agents page, click the Add Agent button.
- Configure the following:
- Name: Enter a name that will appear on the Agents tab. Update the name if needed.
- Slug: This will create the URL for accessing the Node-RED instance.
- Image: Select Node-RED from the dropdown list of available images.
- Click Save, and OpenFlow will save and start the new Node-RED instance.
Note: If this is your first time starting Node-RED, it may take a few moments to download the Node-RED Docker image. Once complete, the status will change to Running.
- To open Node-RED in a new tab, click the last button. The first two buttons allow you to stop and start your Node-RED instance as needed.
Node-RED Editor Overview
The Node-RED editor is where all workflow creation and editing takes place. It has four main components: the header, palette, workspace, and sidebar.
- Header
The header area contains key controls:
- Deploy Button: The deploy button is used to deploy flows once you have finished creating or editing them. It is important to always deploy a flow after editing it so the changes are applied.
- Main Menu: The main menu contains many actions, such as hiding components, importing or exporting flows, searching for flows, actions (like add, rename and delete) flows and subflows, manage palettes, settings, keyboard shortcuts and a link to Node-RED’s webpage.
- User Menu: The user menu, if the user is authenticated, shows the username and the option to logout.
- Workspace: The main workspace is where flows are developed by dragging nodes from the palette and wiring them together.
- Sidebar: The sidebar contains panels that provide a number of useful tools within the editor, such as Information, Debug, Configuration Nodes, etc.
- Palette: The palette contains all available nodes, organized into categories that can be expanded or collapsed. By default, Node-RED provides a set of standard nodes. Since Node-RED is connected to OpenFlow, additional rpa nodes for workflow automation will also be pre-installed.
- Nodes and Connections: Nodes are the visual representation of actions, connected by wires to form a flow. Each node has an input port (for incoming connections) and may have multiple output ports.
- Icons to note:
– Blue circle: undeployed changes
– Red triangle: errors within the node
– Icon and status message: runtime status
- To configure a node, double-click it to open its properties, description, and appearance settings.
Importing OpenRPA Workflows into Node-RED
Workflows created in OpenRPA are automatically synced with OpenFlow. In OpenFlow’s Robot Workflows module, you can view all your OpenRPA projects and workflows. Each workflow entry displays details like the project/workflow name, the creator’s username, and the last update time. We can also:
- Run workflows remotely from OpenFlow.
- Download the workflow’s .xaml file.
Steps to Import and Use OpenRPA Workflows in Node-RED
Open Node-RED
- Navigate to the Node-RED editor.
Add a Robot Node
- From the Node-RED palette, locate the robot node under the rpa category.
- Drag and drop the robot node into the workspace.
Configure the Robot Node
- Double-click the node in the workspace to open its properties panel.
- In the properties panel, you’ll find a dropdown menu listing all workflows created in OpenRPA.
- Select the workflow you want to run from the dropdown.
Finalize
- Click Done to save the configuration.
Now, the selected OpenRPA workflow is ready to be triggered from within Node-RED. You can use the Deploy button in Node-RED to deploy this setup
Scheduling an OpenRPA Robot in Node-RED
Node-RED provides flexible options to schedule OpenRPA robots, with the cron feature being one of the most effective. Here’s a step-by-step guide for setting up a scheduled run for an OpenRPA robot in Node-RED.
Steps to Set Up Scheduling with a Cron Node
To create a cron on Node-RED. We need to import a cron node, which is usually not pre-installed by default.
Install the Cron Node
- Open the Node-RED editor.
- Click on the side menu (found in the top-right corner).
- Select Manage Palette.
- Besides the Nodes section, click on the Install tab.
- In the search box, type ‘node-red-contrib-cron’, then click Install option from the search results.
- After installation, the ‘cron’ node will appear in the palette under the ‘input’ category.
Configure the Cron Node
- Drag the cron node from the palette into the Node-RED workspace.
- Double-click the cron node to open its properties panel.
- In the properties panel, locate the Cron Expression input field.
- Enter the cron expression that defines the schedule (for example, */5 * * * * for every 5 minutes). If you are not familiar with cron, you can use cron expression generators like cron.help or crontab.guru and AI tools like ChatGPT to help define the CRON expression.
Connect the Cron Node to the RPA Robot Node
- Ensure you have an RPA Workflow node configured with the specific OpenRPA workflow you want to automate.
- Connect the output port of the cron node to the input port of the RPA Workflow node. This link ensures that the RPA workflow is triggered according to the schedule defined by the cron expression.
- Deploy the Flow
- Click Deploy in Node-RED to apply the changes.
The OpenRPA robot is now scheduled to run at the intervals specified in your cron expression. The cron node will automatically trigger the robot workflow according to the set schedule. This is the very basic step for the creation of cron-scheduled RPA bots using Node-RED.
Links
- OpenRPA: https://github.com/open-rpa/openrpa/releases
- Git Website: https://git-scm.com/
- Docker Desktop: https://www.docker.com/products/docker-desktop/
- Open-RPA Docker Repository: https://github.com/open-rpa/docker
- Cron Helpers: