Skip to Content
Technical Articles
Author's profile photo Simardeep Singh

Understanding dataflow(Input/Output) between API Triggers and Notifiers in Intelligent RPA

Introduction

One of the most asked functionality in a RPA based solution is to run bots from a third party tools. SAP Intelligent RPA provides a flexible integration with external systems allowing customizable input and output parameters.

The idea of this blog post is to provide an understanding of dataflow between triggers and notifiers. An API Trigger is the entry point for external systems to trigger an RPA bot and requires a REST based invocation. Similarly, Notifiers can be customized to send out REST based notifications containing the output of bot execution.

Following diagram gives high-level overview of data handover between Triggers and Notifiers:

API Trigger allows two types of objects in Payload:

  1. Input – This variable is used during the bot execution. Data required for bot execution should be passed in this object. It allows nested structure.
  2. Invocation Context – Business or Transactional data which is not required for the bot execution should be set in this object.

Example Business Use-Case

Scenario

A Bank wants to process loan application for a customer. Loan application requires numerous processing steps which includes Credit Score check and other cumbersome activities. To save time and avoid human errors, the Bank creates a bot(Credit Check Bot) to minimize the human effort.

Now bank wants to integrate Credit Check Bot with the Bank’s workflow system. This bot will be triggered by Bank’s workflow system by providing Customer Data as input and Customer ID as correlation identifier. After the bot execution, Bank workflow expects Credit Score as output along with the supplied Customer ID.

Customer ID will serve as a correlation between input and output. So, it will be sent as Invocation Context since it is independent of the bot execution.

Steps

Configuration in Desktop Studio

First step would be to configure Desktop Scenario to receive Customer Data as input and Credit Score as output.

  1. Create Context Variable IO with two nested variables for input and output as shown below:

    In this example, Customer variable corresponds to Input and CreditValidation variable corresponds to Output.
  2.  Set Input, Output and Input Data Manager in Properties tab of Scenario as shown below:
  3. Configure source data for each input field for Scenario using Set activity as shown below:
  4. For Output, use Get activity to save the output as shown below:

Once scenario setup is completed, export project using Desktop Studio.

Configuration in Cloud Studio

  1. Import Scenario using Import Desktop Package option in Project window and expose the scenario as skill as shown below:
  2. Once the scenario is imported, DataTypes for the Input and Output variables are created automatically as shown below: 

  3. Generate Package and create deployment in Cloud Studio.
  4. Create API Trigger on the deployed package by selecting the required Scenario
  5. Once you click on create, a dialog box will appear containing example payload. This payload allows two types of variables namely invocationContext and input. In this example the invocation context is a string but it could also be an object.
  6. Create API Success Notifier and create payload using output from Bot execution as shown in the image. Output variables defined in the scenario can be used while defining the payload. Customer ID can be retrieved from Invocation Context set during the execution. Pressing “Ctrl + Space” would suggest available variables.

    Execution

    API Trigger can be executed using any REST clients using following details. Here you can see an example of how to use the invocation context and input: 

    1. Trigger URL
    2. Headers:
      1. irpa-trigger-token
      2. Authorization Token
    3. Payload:
      { 
      	"invocationContext": {
                 "custID": "dcba98765"
             }, 
      	"input": {
              "Customer": {
                  "HouseNumber": "00",
                  "LastName": "Meyer",
                  "FirstName": "Sarah",
                  "StreetName": "AnyStreet",
                  "City": "AnyCity",
                  "ZipCode": "97792",
                  "Country": "Germany",
                  "Email": "felix.meyer@sample.com",
                  "MobileNumber": "+4900000000",
                  "DateOfBirth": "13/July/1985",
                  "JobSituation": "Salaried",
                  "MaritalStatus": "None",
                  "CountryOfResidence": "Germany",
                  "Nationality": "German",
                  "PassportNumber": "C01XXXXX",
                  "PassportNumberMasked": "C*****X",
                  "CertificateOfResidence": "https://localcert"
                         }
      	}
      }

Conclusion

I hope this business use-case could clarify the difference between Input, Output and Invocation context and give you an overview of the dataflow concept in SAP Intelligent RPA. 

Feel free to leave a comment with questions or feedback 🙂 

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Abhishek Malik
      Abhishek Malik

      Hi Simardeep,

      Nice blog

      My question is that how can we use lists as input parameters?

      Thanks in advance.

       

      Author's profile photo Simardeep Singh
      Simardeep Singh
      Blog Post Author

      Hi Abhishek,

      Thanks for reading the blog post. Currently, following input parameters are accepted: String, boolean, number, object(nested with child).

      Thanks,

      Simar

      Author's profile photo Jorge Alberto Diaz Casique
      Jorge Alberto Diaz Casique

      Hello Simardeep Singh,

      I conected my chatbot with RPA but have an error...

       

       

       

      Author's profile photo Nithin N K
      Nithin N K

      Hi SImardeep,

      Nice Blog and Nice presentation. I have a similar requirement and could you please help me here?

      I am using CAI  and RPA to schedule meetings. I will pass the attendees/receivers of the meeting via CAI to RPA. I have hardcoded the attendee's email ID as of now. Something similar to the below

      ctx.outlook.init();
      // Creates a basic mail.
        ctx.outlook.mail.create({To:'name@company.com', Subject:'Test mail from SAP', Body:'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'});

      How can I add "To" object by receiving input from CAI? Is that possible?

      Thanks in Advance!!

       

      Regards

      Nithin NK

       

       

      Author's profile photo Özkan YILMAZ
      Özkan YILMAZ

      Simardeep Singh, , thanks for this nice blog,

      Nithin N K Hi, yes it is possible, just use defined Input object like that;

       var rootData_IO = sc.data; 
      // Creates a basic mail.
        ctx.outlook.mail.create({To:rootData_IO.eMail, Subject:'Test mail from SAP', Body:'body msg'});

       

       

      Author's profile photo Halis Selcuk Dere
      Halis Selcuk Dere

      Hello, my purpose is to read the data from the service, to call a bapi or to write the incoming data into a table. can i do this in cloud environment? Or should I continue with desktop studio? I need an example for processing the data and next steps.