Skip to Content
Technical Articles
Author's profile photo Abir Cherif

SAP RPA 2.0 Challenge Submission: Automate the generation of a Derogatory Travel authorization using IRPA.

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.

 

 

 

Assigned tags

      30 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Raef Zenati
      Raef Zenati

      Good Job ! very clear and helpful.

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you  🙂

      Author's profile photo Surya Narayan Padhy
      Surya Narayan Padhy

      Awesome blog, Thanks a lot .. keep posting dear

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you  🙂

      Author's profile photo khaoula trimeche
      khaoula trimeche

      Thank you for sharing with us your knowledges. Good Work ! 

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you  🙂

      Author's profile photo Maiara Regina Schardong Ellwanger
      Maiara Regina Schardong Ellwanger

      Thank you for this nice tutorial and good luck in the tutorials challenge 😊

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you 😊

      Author's profile photo Vijay Kumar Kalluri
      Vijay Kumar Kalluri

      Thank you for this nice tutorial and provided step by step 🙂

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you 🙂

      Author's profile photo sonia zbidi
      sonia zbidi

      Amazing blog abir,  so helpful thank you 😉

       

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thanks  😉

      Author's profile photo Mahaboob Pathan
      Mahaboob Pathan

      Excellent work and in detail documentation .

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you !!

      Author's profile photo ganesh jayakumar
      ganesh jayakumar

      Good thought process and nicely executed !keep up the good work

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you !!

      Author's profile photo Christoph Gross
      Christoph Gross

      Great use-case and execution, thanks for the nice blog post!

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you  🙂

      Author's profile photo David Felix
      David Felix

      Very interesting, thank you!!

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you !!

      Author's profile photo Ramzi ZMAMLA
      Ramzi ZMAMLA

      Good Job Abir..

      very intersting !

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you Ramzi !!

      Author's profile photo Paul PINARD
      Paul PINARD

      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!

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Hello Paul,

      Thank you 🙂 .

      Sure, it's done!!

      Author's profile photo Paul Sukanta
      Paul Sukanta

      Hi Abir

      Great Job, Thanks for sharing.

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you Sukanta 🙂.

      Author's profile photo Naoufel EL KHAYATI
      Naoufel EL KHAYATI

      Great Job Abir 🙂

       

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      Thank you Naoufel 🙂

      Author's profile photo MUCAHIT DANIS
      MUCAHIT DANIS

      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?

       

      Author's profile photo Abir Cherif
      Abir Cherif
      Blog Post Author

      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.