Skip to Content
Technical Articles
Author's profile photo Ashish Baghel

SAP Intelligent RPA and SAP CAI – An Easy Guide to Integration Between the Two

Introduction:

SAP’s two most powerful platforms – SAP Conversational AI and SAP Robotics Process Automation – have their own uniqueness.
In this blog, I am going to explain how developers can leverage the functionalities that these platforms offer and trigger an SAP Intelligent RPA Bot using an SAP CAI Bot.

An SAP CAI bot can be accessed using a simple chat window and allows users to send external commands using webhooks, whereas SAP Intelligent RPA has the capability to run end to end business processes on the click of a button. Let’s try to run a creation of “Goods Receipt” process using “Robotic Process Automation + AI-based chatbots”.

Below is the simple architecture diagram using which we will complete our integration process.

 

For this development, following are the prerequisites:

  1. SAP CAI Bot (How to build first CAI Bot –Blog post)
  2. SAP Intelligent RPA Bot (Sample Blog post)
    • API trigger and notifiers in SAP Intelligent RPA – Blog post
  3. SAP Cloud Platform (for the deployment of our webhook service)

 

SAP Intelligent RPA Bot Details:

After the successful deployment of the SAP Intelligent RPA Bot on the cloud factory, create an API trigger and copy the URL and irpa-trigger-token from the fields shown in the below image.

 

For access of any SAP Intelligent RPA cloud factory bot, it requires OAuth 2.0 type of authentication and for the same we would require the following parameters from the service instance of SAP Intelligent RPA cloud tenant, as highlighted in the image below:

For more information, follow this help guide and get the url , client id, and client secret.

With this, we now have the following parameters to proceed with:

  1. URL- (Service Instance URL)
  2. Client ID
  3. Client Secret ID
  4. URL – (Cloud factory IRPA API Trigger URL)
  5. SAP Intelligent RPA Header Token

Note: You can also try to trigger your SAP Intelligent RPA bot via postman for the testing, using the above parameters.

Node Service on Cloud Foundry:

This is a simple 3 method-based node service which will do our work of communication between SAP CAI and SAP Intelligent RPA bots. So, let’s start with our first method for getting OAuth token for SAP Intelligent RPA tenant access.

1st Method –

In this method we will use parameters – #1, #2, #3 retrieved in the  above section of “SAP Intelligent RPA Bot Details”.

 

2nd Method –

In this method, we will use the authorization token retrieved from the above method plus parameters – #4,#5 from the section of “SAP Intelligent RPA Bot Details”.

3rd Method:

In our last method we will consecutively call the above methods.

After successful implementation of the above three methods, deploy this node application on cloud foundry and get the URL which we can use further as a web hook in SAP CAI.

(If you are new to the deployment process of node services on cloud, I would recommend that you follow this blog post.)

SAP Conversational AI Bot:

For the Webhook Configuration, here we can use the service without any authentication. You can also put the authentication on your node service and the same can be configured using SAP CAI.

For this example, I have used no authentication.

Now we can use your node application deployment URL here in the webhook directly.

As you can see, it worked successfully.

Conclusion:

Now that we know how to successfully integrate bots from these two platforms, we can try several use cases as it is now fairly easy to send data from CAI and get data in SAP Intelligent RPA.
Again, this might not be the ideal way to do the integration between CAI and Intelligent RPA, but this is one of the possible ways. With each release, SAP CAI and SAP Intelligent RPA are becoming more flexible in terms of integration and data exchange.

Do check out this blog post where we can also avoid node service implementation.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Paul PINARD
      Paul PINARD

      Great blog! 🙂

      Author's profile photo Ashish Baghel
      Ashish Baghel
      Blog Post Author

      Thanks Paul 🙂

      Author's profile photo kratika varshney
      kratika varshney

      Hi  Ashish Baghel,

      Thanks for the nice blog.

      I have a doubt. What we have to put in Authorization.

      Thanks

      Author's profile photo Ashish Baghel
      Ashish Baghel
      Blog Post Author

      Thanks Kratika.

      Authorization token will be a dynamic value which we will get it from 1st method.It's a combination of "Bearer + access.token(retrieved from 1st method)".

      In above example, it is an argument of 2nd method "authorizationHeader".

      Author's profile photo Vladimir Kosovtsev
      Vladimir Kosovtsev

      Hello, Ashish!

      Method no.2:

      should it be 'irpa-trigger-token'?

      or 'irpa-api-key'?

      Author's profile photo Vladimir Kosovtsev
      Vladimir Kosovtsev

      Hello Ashish!

      Is the

      Authorisation:

      field is filled with

      Access Token that is retrieved in POSTMAN?

      If this entity is dynamic etc., how is this not kept in variable, and called from variable in Method no.2? Looking at the code I find that you fulfill this manually. How? Everytime rewrite node after Token expiers?

      This all procedure is as opaque as can be.

      Also everyone in charge of explaining it provides blurred fields. Why not create fresh trial account, provide it's secure fields in an non-blurred way, and then delete account?

      I get 401 error time after time in POSTMAN trying to trigger an RPA API trigger and find zero effective manuals on the matter.

      Author's profile photo Ashish Baghel
      Ashish Baghel
      Blog Post Author

      Hi Vladimir,

      Authorization field is filled with "authorizationHeaderValue" which is dynamic and coming from argument from the calling method.

      Thanks for pointing this out.

       

      Regards,
      Ashish