Execution-based ROI for API automation

In this example, you will build an API automation for an opportunity and use the Pipeline Accelerator package and actions to calculate the duration and the successful execution counts of the automation.

Procedure

  • Create and configure the opportunity in CoE Manager.
    1. Create an opportunity, see Create and manage opportunity.
    2. Follow one of the below options to configure the opportunity to measure the number of times the automation has run.
      • In the opportunity intake form, select # of times performed for How is the process measured question.
      • In the Opportunity > Details > Forecasted Savings tab, select # of times performed in How is Process Measured option.
    3. Specify the number of times per month the automation is expected to execute and time (in hours) required by a person to perform the task.
  • Create an API automation in the Control Room to open a web page.
    1. On the left panel, click Automation.
      A list of available bots and forms are displayed.
    2. Click Create > API Task.
    3. In Name field, enter Calculate execution ROI.
    4. Click Create & edit.
      The API automation is now created. Note down the unique automation ID of the automation. In this example, it is 1234.
  • Create the following user-defined variables using the Create variable (+) icon at the top of the Variables menu.
    Variable name Variable type
    StartTime Datetime
    EndTime Datetime
    SampleString Text
    DurationInSeconds Number
  • Create a session to enable connection and interaction with Shibumi.
    1. From the Actions panel, double-click or drag the Pipeline Accelerator > Start Pipeline Accelerator Session action.
    2. In the Session name field, provide a name, enter executionROI.
    3. In the Shibumi base URL field, enter the base URL as per your region.
      In this example, base URL used is https://app.shibumi.com.
    4. In the Shibumi enterprise ID field, enter the enterprise ID.
      In CoE Manager, navigate to Admin Advanced > Additional Settings.
    5. In the Shibumi program id field, enter the program ID.
      Click the menu (three vertical dots) on the right and select Info > ID. Example, 1.
    6. Enter the Client ID and Client secret.
      Raise a service request to receive the client ID and secret through email.
    7. Enter the API username and password.
      The username and password of your CoE Manager instance tied to the client ID and client secret.
  • For execution ROI, note down the start date and time.
    1. From the Actions panel, double-click or drag the Datetime > To string action.
      1. From the Select the source date and time variable field, choose the Variable option and enter the $System:Date$.
        Note: You can use the System:Date variable to get the current date.
      2. Select the date format from the Select date time format dropdown.

        In this example, the System:Date value is considered as ISO_INSTANT(‘2011-12-03T10:15:30Z’).

      3. In Assign the output to a variable field, select SampleString variable.
    2. From the Actions panel, double-click or drag the Datetime > Assign action.
      1. In the Select the source datetime variable/ value > Enter the date time field, choose the Variable option and select the SampleString variable.
      2. For the Select date time format field, choose the ISO_INSTANT(‘2011-12-03T10:15:30Z’) prebuilt format.
      3. In the Select the destination datetime variable field, select StartTime variable from the dropdown.
    3. From the Actions panel, double-click or drag the REST Web Services > Get method action.
      1. In the URI field, enter the URI of the web page you want to open.

        Example, https://www.salesforce.com/in/.

      2. In the Proxy configuration field, select System.
      3. In the Authentication Mode dropdown, select No Authentication.
      4. In the Wait for action to complete (in milliseconds) field, enter 60000.
      5. Assign the output to a variable field, choose the Dictionary option and select ResponseDictionary variable from the dropdown.
  • For execution ROI, note down the end date and time.
    1. Perform steps 1 to 2.
    2. From the Actions panel, double-click or drag the Datetime > Difference between dates action to calculate the difference between start and end date and time.
      1. In the Source Date and time Variable field, select Variable option and choose the StartTime variable.
      2. In the Date and time variable to be compared field, select Variable option and choose the StartTime variable.
      3. In the Time unit field, select seconds.
      4. In the Assign the output to a variable field, select the variable DurationInSeconds.
  • Send execution ROI details including duration.
    1. From the Actions panel, double-click or drag the If > If action to configure the conditional statement.
      1. In the Condition drop-down list, select Dictionary.
      2. From the Dictionary variable drop-down list, select the variable ResponseDictionary.

        The Key field is automatically updated to the value Response.

      3. From the Dictionary type drop-down list, select String.
      4. In the Operator drop-down list, select Equals to(=).
      5. In the Target Value field, type HTTP/200 OK.
    2. From the Actions panel, double-click or drag the Pipeline Accelerator > Update process metrics action into the If container.
      1. In the Session name field, enter executionROI.
      2. In the Automation ID field, enter 1234.
      3. In the Process name field, enter Calculate execution ROI.
      4. In the Date field, choose Variable option and enter the $System:Date$.
      5. In the Mode field drop-down, select Add.
      6. In the Process metrics field, select Dictionary option.
      7. Click Add and in the Entry field provide the following details to update the automation duration in CoE Manager.
        Field Value
        Type Number
        Key Actual_Automation_Duration_Time_per_Day__m
        Value $DurationInSeconds$
      8. Click Add to update the successful automation execution count in CoE Manager.
        Field Value
        Type Number
        Key Actual_Successful_Executions_per_Day__m
        Value 1
      9. Click Add to update the failed automation execution count in CoE Manager.
        Field Value
        Type Number
        Key Actual_Failed_Executions_per_Day__m
        Value 0
      10. In the Status field drop-down, select the variable SampleString.
    3. From the Actions panel, double-click or drag the If > Else action to configure the alternative sequence of action.
    4. From the Actions panel, double-click or drag the Pipeline Accelerator > Update process metrics action into the Else container.
      1. Perform steps 2.a to 2.g.
      2. Click Add to update the successful automation execution count in CoE Manager.
        Field Value
        Type Number
        Key Actual_Successful_Executions_per_Day__m
        Value 0
      3. Click Add to update the failed automation execution count in CoE Manager.
        Field Value
        Type Number
        Key Actual_Failed_Executions_per_Day__m
        Value 1
      4. In the Status field drop-down, select the variable SampleString.
    You can see the updated metrics in CoE Manager (Opportunity > Transaction Tracking > Transaction Metrics) .
    execution roi transaction metrics
    You can see the ROI information in the CoE Manager opportunity dashboard.
    execution roi dashboard