Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
cherifabir
Participant

Introduction:


This post is a part of the SAPRPA2.0_TutorialChallenge2021, in which I will share with you how to launch an RPA 2.0 automation scenario via a chatbot created with the SAP Conversational AI.

Use case: requests for derogatory COVID travel authorizations.


Due to the pandemic situation, changes in regulations, the needs of our employees to travel to various agencies, our HR department is crumbling under the growing number of requests for professional travel certificates.

The objective of this project is to automate the management of these different certifications while guaranteeing a limited number of people in accordance with the current safety regulations and that's by building a digital assistant (chatbot) that automates requests for derogatory COVID travel authorizations.


 

The chatbot collects the employee's name, date of birth, address, and email to use it when calling the API which will trigger an RPA use case.

The RPA bot uses the information provided by the user to perform some checks (user identity, valid current position…), if all checks are valid, Robot will prepare the certificate and send it back to the user by email.

Technical architecture :



We started by creating an RPA automation process and adding an API trigger to launch this scenario.
Then, we created a chatbot using SAP Conversational AI, and we used the CAI Notifier to get the RPA result in the conversation and update it.

Main Part:


The prerequisites:



  1. Desktop studio installed.

  2. Desktop Agent installed.

  3. SAP IRPA Factory access.

  4. Client ID and Secret ID to setup Integration.

  5. Postman to test the API service.

  6. Conversational AI to create chatbot.


The steps:


This project is based on 6 steps:

  1. Create project using Intelligent Robotic Process Automation Factory.

  2. Test API services using Postman.

  3. Create a bot using SAP Conversational AI.

  4. Setup Integration of Intelligent Robotic Process Automation and Conversational AI bots.

  5. Add CAI Notifier to the trigger to get the output of RPA scenario.

  6. Setup and connect the SAP Conversational AI Web Client.


Step 1: Create project using Intelligent Robotic Process Automation Factory.


We started by creating a project in the cloud Factory with «New Project ».


 

And we created an automation.


 

Before creating the scenario, we added all the dependencies needed for this automation (irpa_core, irpa_excel, erpa_outlook, irpa_pdf, irpa_word).

Go to the project -> «Dependencies» -> «Setting» -> «Dependencies» -> «Add Dependency».


 

Define the fields of the data type as show in the picture below.

Use « New Field» to add a new row.


 

The figure below shows the scenario created.


 

This Excel sheet is used as a company database.


 

This authorization template is used as a model in this scenario.


In this scenario, «FullNameEmployee», «DateOfBirth», «HomeAdress», «TitleJob», «DateNow», will be updated to create a customized authorization certificate to the employee.

Now, our project is deployed by clicking on «Generate Package».


 

After the successful deployment of the package, we added an API trigger to it.

Go to «Environments» -> select «Packages» -> click on «Add Trigger».


 

Select API Trigger.


 

Copy the URL provided by the trigger in this step. You will need it in the chatbot configuration later.


 

Also, copy the API KEY from the «Environments» section.


 

Step 2: Test API services using Postman.


Before calling the API service in the chatbot, we need to test it with Postman.

Please refer to this post in order to achieve this step.

In order to do this test, we need a client ID and a secret client, so go to «Service Marketplace» ->  click on «sap intelligent Robotic Process» -> choose «instances» -> click on «Skey» -> «view».


 


 

To get the jobs list launched and see the RPA workflow logs Go to «Monitoring » -> «Jobs ».


 

Select a job.


 

Step 3: Create a bot using SAP Conversational AI.


To create a chatbot you can follow this course.

Create the Bot.


 

Create the intent «Authorization ».


 

Go to «build» and create a new skill called «authorization».


 

Set up a «trigger» functionality.


 

Add the «requirements».


Create a requirement asking the bot to save the recognized «#person» entity into a memory variable called «FullName», save «#datetime» entity into «DateOfBirth» and the «#email» entity into «Email».

{{memory.FullName.raw}}, {{memory.DateOfBirth.raw}}and {{memory.Email.raw}} will be used as filters parameters in the API Query.

 

Test BOT:


 

Step 4: Setup Integration of Intelligent Robotic Process Automation and Conversational AI bots.


To consume the API Services, Put the Trigger URL copied in step 1 in the API Service Configuration with Post method.

Fill the tab authentication, select «OAuth2 Authentication» and add the «Client ID», the «Client Secret» and the Authorization URL copied in step 2.


 

Add «irpa-api-key» in the Headers section.


 

Fill the body section with {{conversation_id}} as a first element that defines the conversation id.

The second element defines the input element of the RPA scenario {{memory.Email.raw}}.


 

Step 5: Add CAI Notifier to the trigger to get the output of RPA scenario.


An API notifier provides information about the execution of a scenario or process by calling a web API. In our scenario, we created two notifiers: success notifier (a notification is sent when the task is successful) and failure notifier (a notification is sent when the job fails).

To create a notifier, we need to use the «Developer Token» of the chatbot.

To get the token, go to «Settings» of the chatbot in SAP Conversational IA.


 

To create the notifier, go to «Environments section» -> select «Triggers» -> click on «More Options» -> «Add notifier».


 

Now, we need to choose the type of the notifier.

Select the CAI type.


 

Choose the success event in the «Notify on ».

Add the conversation ID, the token and the message content.


 

Step 6: Setup and connect the SAP Conversational AI Web Client.


To test SAP Conversational IA notifier, we need to create a web page.

Go to «Connect» -> Click on «New SAP Conversational IA web Client».


Set a «name» and click on «create».


Copy the script and save it in an HTML file.


 


 

When launching the chatbot from the HTML page, we get this result.


 

And we receive the Email.


Here is the customized template to the employee.


 

Conclusion:


By following this post, you can create a chatbot that allows you to consume an API service in order to trigger an RPA workflow.

Please share with us your feedback and comment about this use case, and feel free to get in touch with us for further details.

Your support / like would be very helpfull.

 

 

 
32 Comments
Labels in this area