Robotic Process Automation (RPA) tools are designed to carry out all human repetitive tasks. Bots can retrieve information from legacy and modern applications and extract data from emails, documents and even web pages. They interact with applications using keyboard and mouse clicks just like we humans do. MuleSoft is a new player in the RPA market. MuleSoft RPA was released only a few weeks ago, and the great news is that it is fully integrated with MuleSoft Anypoint Platform and Composer.
In the first part of this post, I want to demonstrate the step-by-step process of publishing automation from MuleSoft RPA Manager to Anypoint Exchange. Moreover, I will show how to invoke process automation (Bot) from a Mule Application by using Anypoint Studio.
In the second part of this blog, you will learn how to deploy an application to CloudHub and add a callback URL to be executed after a bot completes execution I will also explain how to configure and invoke a bot via Composer.
Use case - Hello World
Known as the first example in nearly every programming language, why not start with the two most famous words “Hello World” for my first process automation integration with Anypoint Platform and Composer?
Before publishing the process automation asset to Exchange, we must create a Connected App with RPA Integrator scope configured in Access Management. We also have to connect the MuleSoft RPA Manager with the Anypoint Platform account. These steps are described below:
- Create a Connected App in Access Management.
- Connect MuleSoft RPA Manager with Anypoint Platform Account.
- Publish process automation from MS RPA Manager to Anypoint Exchange.
- Create a User API Key.
- Add the asset published in Exchange into the API.
1. Create a Connected App in Access Management
Below, I have listed the steps required to create a Connected App in the Anypoint Platform.
After you log in MuleSoft Anypoint Platform, open Access Management and click Connected Apps.
Click Create App.
Specify a Name for the Connected App (RPA), and in Type select App acts on its own behalf(client credentials).
Click Add Scopes and enter RPA In the filter box, then select RPA Integrator and click Next.
Select Business Group and click Review.
Click Add Scopes to confirm and click Save.
After creating a Connected App, you need to copy the Id and Secret to configure RPA Manager to connect to the Anypoint platform.
2. Connect MuleSoft RPA Manager with Anypoint Platform Account.
Once you have configured a Connected App in Access Management, you can connect MuleSoft RPA Manager with your Anypoint Platform account by following the following steps:
Log in to MuleSoft RPA Manager.
Open Organization Management and click Settings.
Select the Anypoint tab.
Click Configure Settings and provide the Connected App values (Id and Secret) for Client Id and Client Secret. For Domain enter the Anypoint Platform URL instance and click Next.
Select the Anypoint Organization to connect to and click Finish.
RPA Manager is connected with the Anypoint Platform.
3. Publish process automation from MS RPA Manager to Anypoint Exchange
Using MuleSoft RPA Builder, I created simple process automation with a Message Box component to display the “Hello World” message passed by the “message” variable.
Once the process automation is completed and is in the production phase, we need to create an Invokable production configuration by clicking the create an Invokable run production configuration button.
Provide a Configuration name and a short description and click Next.
Select a Bot to deploy the process automation and click Save & Publish.
Production configuration is now configured, and the process automation is published in Exchange.
Asset published on Exchange.
4. Create User API Key
You are required to create a User API Key to integrate the RPA processes with your API.
Log in to MuleSoft RPA Manager.
Open User Management, click User API Keys and Create.
Enter the details for the form Create User API Key and click OK.
Create User API Key
5. Add the asset published in Exchange into the API
Now it is time to find the RPA process published in Exchange to add it to the project and invoke the Bot via my API flow:
On Mule Palette click Search in Exchange…
Search by the RPA Process name (hello), click Add and once the dependencies are downloaded, click Finish.Add dependencies to project
Drag and drop the startProcess into the flow and configure the Connector Configuration. Also add getProcessesExecutionStatus to the flow and a Transform Message to pass the “message” attribute as a variable to the Bot before startProcess processor as shown in the below example.
Add dependencies to Project.
The properties.yaml file has the following values
Once the application runs, we can call the application to view the invoked bot.
Bot being invoked
What do you think? Would you agree that the process of publishing a process automation to MuleSoft Anypoint Exchange was quite straightforward? I found it easy to search and add the API dependencies to the project and configure and invoke the Bot deployed in MuleSoft RPA Manager.
In the second part of this blog, I will show you how to deploy the application to CloudHub. We will add a callback URL to be called after the bot finishes running and then we will configure and invoke the bot via MuleSoft Composer.
I hope you liked this post and see you in the next one .
Meanwhile, why not explore how to build a bot? Take a look at our recent blog MuleSoft RPA in action, where we tested MuleSoft RPA by automating a simple process of extracting data from a spreadsheet and creating a new record into Salesforce.