Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

Integrating watsonx Orchestrate Agents with IBM RPA

By Michael Oliva posted 4 days ago

  

Combining IBM watsonx Orchestrate Agents with IBM Robotic Process Automation (RPA) bots allows you to drive complex automations through a natural language interface. This blog is a step-by-step guide for configuring and connecting IBM watsonx Orchestrate to IBM RPA in a SaaS environment.

Building the bot

For the purpose of the demo, the bot will be very simple. It will take an input parameter and return it concatenated to another string which demonstrates data flowing between watsonx Orchestrate and IBM RPA.

 

IBM RPA bots are built in the Studio application, documentation for using the Studio can be found here.

This is my WAL script for the bot, the log command will help verify all is working correctly in the IBM RPA Control Center.

defVar --name input_name --type String --parameter  --required
defVar --name hello_output --type String --output
concatTexts --text "Hello," --value "${input_name}!" hello_output=value
logMessage --message "${hello_output}" --type "Info"

Once you've built a bot in the IBM RPA Studio, publish it and mark it as production and schedulable.

Configuring IBM RPA

Login to the IBM RPA Control Center to configure it with watsonx Orchestrate.

Creating a Computer Group

To run unattended IBM RPA bots you will need to configure a group of computers which will run the script. If you have already configured a Computer Group, you can skip this step.

Navigate to Computers > Computer groups and create a computer group with at least one available computer.

Creating a Project

An IBM RPA Project is a collection of one or more bots which we will export to watsonx Orchestrate. To create a Project, navigate to the Projects tab and click the Create project button. Make sure your Project has the correct shared access for the user which will be running the bot from watsonx Orchestrate.

Once created, navigate to your Project and click the Create bot button

The first page will ask you to give the bot a name, make sure this is a clear name of the bots intent as this will help watsonx Orchestrate determine when to run the tool.

On the next page, select the script you created and the Computer Group to run the script.

Review the summary on the last page, if all looks good then create the bot!

Testing your bot (optional)

At this stage I like to run the bot directly from the IBM RPA Control Center to verify everything is configured correctly. Select the vertical ellipses (...) on your RPA bot and select Run.

Enter your input variable and click Run!

Navigate to the Bot runs tab to see your bot running:

Refresh the list after a couple minutes and verify your both has successfully finished. Once finished, click on your bot and navigate to the Logs tab to verify the log we added to the script looks as expected.


Enabling call-backs

IBM RPA's integration with watsonx Orchestrate works on a call-back mechanism, where IBM RPA will return the result of a bot run to the caller asynchronous to the invoking call. So, to allow IBM RPA to communicate with watsonx Orchestrate it must be whitelisted in your IBM RPA tenant. This can be done as the tenant administrator by navigating to Tenants > Security settings and creating a new entry as the following screenshot show:

Exporting the Project

We're now ready to export the IBM RPA Project as an OpenAPI spec so that it can be imported into watsonx Orchestrate as a tool! To do this, navigate to your Project page and click the Download OpenAPI at the top right. At the time of writing, only Token is supported in watsonx Orchestrate, so ensure you download that scheme.

Configuring watsonx Orchestrate

Authentication

NOTE: IBM RPA only support token authentication for non-SSO users. If your RPA tenant is configured for SSO authentication then you must create a non-SSO user to connect to watsonx Orchestrate. The user must have an email address as their username.

To connect watsonx Orchestrate to IBM RPA we need to create a new Connection. On the watsonx Orchestrate homepage, navigate to Manage > Connections and select Add new connection

Open the IBM RPA Project OpenAPI spec that we downloaded from the IBM RPA Control Center, at the bottom is the tokenUrl attribute which will help fill in the following form. Set the Authentication type to Oauth2 Client Credentials and fill in the form as follow, inserting your token URL from the OpenAPI spec.
Add two additional attributes, username and password which are sent in the body.

Your form should look similar to this:

Press Connect to verify the connection is successful. 

Once connected, press Next and copy the Draft setting to the Live settings and create the Connection.

Setting up the Agent

It's time to put it all together! From the watsonx Orchestrate homepage, navigate to Build > Agent builder and click the Create agent button. Once you're happy with the agent's configuration, click the Create button.

Now we have an Agent, we need to import our IBM RPA bot as a tool. Scroll down to the Toolset section and click Add tool, on the next page select to Import the tool and then chose to Import from file. On the import page, drop your IBM RPA OpenAPI spec onto the submission box and wait for the tool to be verified. Once verified, click Next and select the bot(s) you wish to import. For this demo we only have one bot, but in a real environment you can have multiple IBM RPA bots associated to a single Project.

Click Next and associate the RPA Connection with the bot. Once happy, click Done to finish the import process. 

Hello, World!

We're all set to run the IBM RPA bot as a tool in wastsonx Orchestrate via the Agentic chat, prompt the watsonx Orchestrate Agent to run your bot and sit back!

Summary

You're all set to create complex IBM RPA bots and run them directly from the watsonx Orchestrate Agentic chat!

In this blog we've covered:

  1. Creating a simple IBM RPA bot.
  2. Turning that bot into a Project for export.
  3. Importing the bot into wastsonx Orchestrate.
  4. Building a watsonx Orchestrate Agent to run the bot.

For your next IBM RPA Project, try creating a collection of bots which are part of the same business process/flow and chaining them together with a watsonx Orchestrate Agent. The natural language interface enables you to flow between IBM RPA bots with a conversation, allowing you to ask questions about the data returned from the bots.

0 comments
32 views

Permalink