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
former_member453654
Discoverer
Good Job ! very clear and helpful.
former_member675708
Discoverer
Awesome blog, Thanks a lot .. keep posting dear
cherifabir
Participant
0 Kudos
Thank you  🙂
cherifabir
Participant
0 Kudos
Thank you  🙂
Thank you for sharing with us your knowledges. Good Work ! 
cherifabir
Participant
0 Kudos
Thank you  🙂
MaiaraEllwanger
Product and Topic Expert
Product and Topic Expert
Thank you for this nice tutorial and good luck in the tutorials challenge 😊
cherifabir
Participant
0 Kudos
Thank you 😊
vijay_kumar49
Active Contributor
Thank you for this nice tutorial and provided step by step 🙂
cherifabir
Participant
0 Kudos
Thank you 🙂

Amazing blog abir,  so helpful thank you 😉

 

cherifabir
Participant

Thanks  😉

mahaboob_pathan
Contributor
Excellent work and in detail documentation .
cherifabir
Participant
0 Kudos

Thank you !!

former_member741230
Discoverer
Good thought process and nicely executed !keep up the good work
cherifabir
Participant
0 Kudos
Thank you !!
Great use-case and execution, thanks for the nice blog post!
cherifabir
Participant
0 Kudos
Thank you  🙂
former_member741277
Discoverer
Very interesting, thank you!!
cherifabir
Participant
0 Kudos
Thank you !!
Good Job Abir..

very intersting !
cherifabir
Participant
0 Kudos
Thank you Ramzi !!
Paul_P
Product and Topic Expert
Product and Topic Expert
Hello

Thanks for publishing this awesome blog.

Would you be able to tag "SAP Conversational AI" as a primary tag in your article?
It will help the SAP Conversational AI community to find it!
cherifabir
Participant
Hello Paul,

Thank you 🙂 .

Sure, it's done!!
Hi Abir

Great Job, Thanks for sharing.
cherifabir
Participant
0 Kudos
Thank you Sukanta 🙂.
Great Job Abir 🙂

 
cherifabir
Participant
0 Kudos

Thank you Naoufel 🙂

p0667
Newcomer
0 Kudos
Hello Abir,

Thank you for this nice tutorial.

I have a problem. The date field (dateOfBirth) does not map with the Employee variable. How can I solve this?

Can you send me the configurations of the activities in the scenario you created?

 

cherifabir
Participant
0 Kudos
Thankyou Danis,

Here is the configuration of the activity.


 

For the different types of fields in employee they are defined in DATA TYPE definition.


I hope this will help you.

Hello Abir,

Nice Information!.. Keep going..

I need to learn SAP IRPA 2.0 from scratch. Can SAP provide SAP IRPA2.0 for trial practice?

Can you please send some good step by step tutorials to learn SAP IRPA2.0?

 

Thanks

Gary

cherifabir
Participant
0 Kudos

Hello Gaurav Aggarwal,

Thank you!

I advise you to take these two courses in OPEN SAP:

  1. Enter Next-Level Bot Building with SAP Intelligent RPA 2.0.
  2. What's New with Bot Building in SAP Intelligent RPA 2.0.

 

I hope this will help you.

Best regard,

Abir.

 

Labels in this area