Invoke an RPA process in MuleSoft using HTTP and Postman – Part 1

Why Even Invoke an RPA process in MuleSoft using HTTP?

Simple!  Sometimes, it is required that a system Invoke an RPA process in MuleSoft using HTTP so that another system can call said RPA process. In such cases, the RPA must be moved into the Production phase and an Invokable Run Configuration must be configured for it in MuleSoft RPA Manager. After creating the invokable run configuration, the URL for invoking the RPA can be found in Anypoint Exchange. To keep everything secure, credentials will also need to be set up for authorizing the HTTP request to the API.

Given an RPA process that has successfully completed its test plans in the Test phase, follow the steps below to create an Invokable Run Configuration.

  1. Create a Connected App that can invoke RPA APIs.
  2. Promote the RPA process to the Production phase in RPA Manager.
  3. Set up an Invokable Run Configuration.
  4. Get the RPA’s URL from Anypoint Exchange.

Details on each of the steps above will be explained below.

Create a Connected App

Log in to Anypoint Platform and navigate to Access Management. (This step requires the logged-in user to have Organization Administrator permission in Access Management.) From there, click Connected Apps in the left-hand panel. Then click the “Create app” button:

MuleSoft Anypoint Create Connected App button

Enter a Name for the Connected App, and for Type, select “App acts on its own behalf (client credentials)” and click “Add Scopes”:

Adding a name to the new Connected app in MuleSoft Anypoint

In the Add Scopes pop-up, find and select “RPA Invocable Process” and then click Next:

MuleSoft Anypoint - Add Scope in Connected App

Select the Business Group(s) that the relevant RPA processes belong to and click Next. Then finally click “Add Scopes”:

MuleSoft Anypoint - Add Business Group to Connect App Scope

Then click Save, at which point the Connected App is created. It should now show on the Connected Apps page, where you can click “Copy Id” and “Copy Secret”.  Be sure to save the Id and Secret values; these will be used later for invoking the RPA via HTTP call.

MuleSoft Anypoint - Connected App list

Promote the RPA Process to the Production Phase

Promote the RPA process to the Production phase in RPA Manager. To do this, go to RPA Manager -> Process Automation -> Process Management. Select the relevant Category. Then select the relevant RPA process. Click the “Publish (Production)” button. In the pop-up window, check the checkbox to confirm the release of the process and click “Release to Production”:

MuleSoft Anypoint - Promote RPA Process to Production

MuleSoft Anypoint - Release to Production screen

Create an Invokable Run Configuration

To set up an Invokable Run Configuration on an RPA process that is in the Production phase, navigate to that RPA process in RPA Manager. To do this, go to RPA Manager -> Process Automation -> Process Management, then select the relevant Category and Process. Then under “Production configurations”, select “Create an invokable run configuration”.

Enter a name and description:

RPA Settings - Add name and description

Configure the default values for the process’s activity parameters:

Configure default values for RPA activity parameters

 

Configure any needed user tasks:

RPA config user tasks

Configure the Execution (“Run in secure session as default user” is recommended):

Set RPA execution settings

Configure the bot(s) for the process to run on:

RPA configure bot settings

And lastly, click “Save & Publish”.

Get the RPA API URL from Anypoint Exchange

Upon creating the invokable run configuration for the RPA process, a “REST API” asset gets created in Anypoint Exchange. Within that asset, the URL can be found for invoking the RPA process via HTTP. To find the URL, navigate to Exchange. Then search for the name of the RPA (in my case, my RPA process is named “Get Widget Data from Legacy Inventory Site”) and select the asset with a matching name and a type = “REST API”:

MuleSoft Anypoint Exchange main screen

After clicking the link to open the REST API asset, the asset’s Exchange page opens. Click on the second entry under Endpoints (the one starting with “/v2/”; this v2 URL is the one required for use with OAuth 2.0-based Connected App credentials we are using in this demo) in the left-hand panel to expand it.

MuleSoft RPA Asset executionID

MuleSoft RPA Endpoint

 

Then click on the PUT startProcessV2 link:

MuleSoft RPA PUT process.

After you do this, it will show a URL on the page:

MuleSoft RPA PUT URL

This is the URL that will be used in Part 2 of this series to show how to use Postman to invoke the RPA process. Stay tuned for Part 2 next week!  Until then, watch the video version of this blog on YouTube:

Talk to the Professionals!

To learn more about our MuleSoft RPA or Salesforce services, please visit our website or fill out a Contact Us form here.

CloudFirst Labs logo