Technical Articles
Step-by-Step SAP IRPA and CAI Integration
Hello There,
This is my first blog post on SAP Intelligent Robotic Process Automation, In this blog post I want to share my mini project on Integrating SAP Intelligent robotic process automation with SAP Conversational AI.
Introduction:
SAP Intelligent Robotic Process Automation – Automate repetitive manual processes by creating intelligent bots at the same time you can schedule, monitor and manage your bots on cloud.
SAP Conversational AI – It’s a platform to build, train, connect and monitor chat bots, Access Link
In this blog post, will go though the step-by-step process to integrating SAP Intelligent Robotic Process Automation and SAP Conversational AI bots.
Refer the links to know more about SAP IRPA & SAP CAI.
Main Part:
The prerequisites are:
- Desktop studio – Installed on your machine
- Desktop Agent – Installed on your machine
- SAP IRPA Factory – Access to upload project to cloud
- Client ID and Secret – To setup Integration
- Conversational AI – To create chat bot
- Chrome web browser – Live the chat bot
This project has six simple steps, in sequence:
- Step#1. We create a project using desktop studio
- Step#2. Uploaded project into Intelligent Robotic Process Automation Factory
- Step#3. We create a chat bot using Conversational AI
- Step#4. Setup Integration of Intelligent Robotic Process Automation and Conversational AI bots
- Step#5. Setup Connect SAP Conversational AI Web Client
- Step#6. Test our project by communicating with our custom chat bot
Step#1.
First, we create a project using desktop studio. Desktop studio is an on-premise component used to build and test bots.
Open Desktop studio, go-to file menu tab and click on new project or Ctrl+N. A pop-up window will appear, fill all mandatory input fields and click save button.
Create new Workflow, in this scenario I have given “integration” as its name. Press save button.
Then go to activities window. From file section find Read text activity, drag and drop it to workflow screen.
Properties of read file activity, set up as follows
For source file path, here we can use direct file path in single codes or use ctx.options.path.log + “\\filename.extension”
Further we are reading the data from text file and storing in variable Target Data
To create variable(s), we need to go to context tab.
In the above screen shot, data is a folder name and the variable item name is ws_text as used in target data.
Next step I have created custom activity to display the read data from text file, as this is custom activity, we need to add the code. ctx.log(rootData_data.ws_text);
To end the workflow, use the function end you can find out in scenario section of activities window. Below screenshot is the complete workflow.
After completing the project, we must save, and press build (Ctrl + B) to generate the code lines.
Once you complete above steps of build, you will be finding output window. Make sure that there are no errors and warning messages.
Now we need to save the project, test and export.
Note: the best practice is that we must test bot(s) using debug option in desktop studio before uploading project into factory.
Step#2.
To upload project into Intelligent robotic process automation factory, here are the steps
Select the new project, enter the project name and description details, it will take you to new window. You need to select the import desktop package. Once the project is selected and saved, close the window and go back to project tab in Intelligent Robotic Process Automation factory.
Now generate the package from the project, once the package is generated successfully set it up in released status.
Now to set up the trigger, there are three options to create trigger. Choose an option from select an environment, Deploy and select a trigger type.
Once we complete trigger setup, system will generate the URL and trigger token.
Step#3.
Create a chat bot using SAP Conversational AI, login URL into SAP Conversational AI and click on create new chat bot. Here I have created a chat bot called ‘integration’.
Create an intent say ‘System’ and we must add expressions. Here in this scenario, I have added 4 expressions.
Go to build and create a new skill say ‘Integration_Check’
Double click on skill to set up trigger functionality.
Actions tab
Step#4.
Now we have to setup integration via API service configuration, for that you must have client secret and ID details.
Go back to Intelligent Robotic Process Automation Factory, now add notifier(s) to the trigger which we created in our earlier steps
Conversation ID is ${invocation_context.conversationId}
Token we need to copy from Conversational AI chat bot -> settings (Every chat bot has it’s won developer token).
Enter message content which will respond to Conversational AI, here I am entering output variable from IRPA bot sent to Conversational AI.
Format is ${output.Output_Variables}. In this scenario, output field from Intelligent Robotic Process Automation bot is ws_text.
To validate the input and output parameters of an Intelligent Robotic Process Automation bot, go to project tab in Intelligent Robotic Process Automation Cloud Factory. Select the project you want and then click on scenarios. On right side of the window, find I/O parameters.
Step#5.
Now setup a connect. In this scenario I have selected SAP Conversational AI web client.
Once complete connection setup process, it will generate a script which we need to copy and create a html file.
Save the file on your desktop.
Step#6.
To run the bot, we must open the html file which we created in the above step. Here is the chat conversation in below screenshot.
You can monitor the bot status in Intelligent Robotic Process Automation Cloud Factory.
click on the record to check complete details of the job status..
Conclusion:
Following the above process steps, we can successfully integrate SAP Intelligent Robotic Process Automation and Conversational AI systems.
This can be used in various scenarios based on business requirements. If you face any difficulties in implementing the above process steps, you can leave your comments or queries in this blog post, will try my best to respond at the earliest.
I hope that you enjoyed this blog post, I will research more in depth in SAP Intelligent Robotic Process Automation and Conversational AI and will come up with new blogs with various scenarios.
Keep visiting my blogger page and keep sharing your thoughts.
Thanks for your time!
Hello Raghunath Shyamala !!! excellent blog!!! I tried to follow all steps but chatbot shows an error... could you please help me?
first
Second
Third
Hello! Robot executed successfull but message shows error! 🙁
4
Hi Jorge Alberto Diaz Casique
on your screenshots, It’s seems that you are missing the process step #5. Please complete the step number 5 and retest the chat bot. It should work.
If you find any difficulties, please let me know.
Regards,
Raghunath Shyamala
Hi,
how did you ws_text as output parameter in SAP iRPA?
Regards,
Nikhil
Hi Nikhil,
Here are the steps to choose input/output parameters of any bot.
Regards,
Raghunath Shyamala
Hi,
Which one is the OAuth 2's Authorization URL? I have downloaded service key json and clientID and clientURL in that.
Regards,
Nikhil
Hi Nikhil,
Once we complete trigger setup in IRPA, the system will generate the URL and trigger token. The same URL is used in CAI setup.
Regards,
Raghunath Shyamala
Hi Raghunath,
i am using this programm for the very first time in my life, how do i come from Step 3 to Step 4 where do i open the API Service configuration.
Greetings,
Ahmet
Hi Ahmet,
here are the steps to setup API services:
Login to CAI -> Open Custom Bot -> Go to Build tab -> Go to Action tab -> selection connect to external services -> select consume API service.
Regards,
Raghunath Shyamala
Hi Raghunath,
Do you know how a trigger (with a message and postback) can be made default/ show up as soon as that chatbot is opened before a user enters in a message?
The webchat has a welcome message option but there is no way to add a button to this I believe.
Any help would be appreciated!
Thanks,
Magdalean