sean_murphy1@dell.com

Amazon Alexa Integration with Boomi

Blog Post created by sean_murphy1@dell.com Employee on Mar 3, 2017

In order to add an additional "Wow!" factor to our product demos, I've been playing around with using Amazon's Alexa service to execute various Boomi actions via voice command. In this post I wanted to share how to configure a custom Alexa skill that calls a Boomi process to do something interesting, such as triggering a new process deployment for example.

 

Note: In order publish web services processes, your account must have the Services Enablement feature.

                                                                                                                                                           

 

Creating the Custom Alexa Skill

 

Building the Skill

Log into the amazon developer page at https://developer.amazon.com.

 

Select "Alexa from the top menu, then click "Get Started" in the Alexa Skills Kit.

 

 

You will then be have the option of adding a new skill, or editing an existing skill.

 

 

From here, you will walk through the five steps in developing an Alexa Skill

 

Skill Information

Define the Name and the Invocation Name for the skill.

 

  • Name - Unique identifier for the skill
  • Invocation Name - Verbiage you will speak to Alexa to have her invoke the Boomi Process

 

 

Interaction Model

The interaction model require that you insert a JSON "intent" structure that will be used to pass information into the Boomi process.

 

Here's a simple sample Intent Schema:

{
  "intents": [
     {
       "intent": "DeployBoomiProcess" 
     }
   ]
}

 

You can replace the actual intent name ("DeployBoomiProcess") with some tag for your Boomi action.

 

Next, you will associate the intent name with the verbiage used to invoke the action (same as verbiage from above).

 

 

Configuration

The Configuration section configures how to invoke the Boomi process.

 

Select "HTTPS", "North America", and put in the URL to invoke your Boomi process. Because the Boomi process will be running on the Boomi Atom Cloud you must provide AtomSphere web services user credentials. You'll need to provide these using the boomi_auth parameter as part of the URL. See API security for how to format this parameter.

 

 

SSL Certificate

Simply check the first option here--the Boomi Cloud environment has a trusted SSL.

 

 

Test

In the testing section, you can copy and paste the verbiage used to invoke the process into the "Enter Utterance" text box. This will invoke the Boomi process and display the request and response JSON documents. You'll use these samples later to generate the JSON profiles within the Boomi process.

 

 

Creating Your Boomi Process

In the example below, we'll create a series of Boomi processes that asynchronously create a new process deployment to a given environment.

 

The high level approach is:

  1. User speaks command to Alexa.
  2. Alexa API calls a Boomi web service process running in the Boomi Atom Cloud.
  3. This process receives the request and then asynchronously executes a second Boomi process running a local Atom via the AtomSphere platform API (executeProcess) and responds to Alexa. This pattern allows you to easily trigger any process running on any Atom (cloud or local) which may perform a lengthy action.
  4. Meanwhile the second Boomi process runs and actually performs the real work. In this case we're creating a new process deployment (again using the AtomSphere platform AP) I but you can imagine this being any workflow to perform an action or sync data, etc.

 

You will need to provide appropriate credentials to invoke the AtomSphere API.

 

 Get the Alexa listener example process from the Process Library here. The second "work" process is not included.

 

Create a RESTful Listener Service

Create a standard RESTful web service that receives the request from Alexa, performs the desired logic (in this case executing a second Boomi process on a local Atom via the AtomSphere platform API), and returns a response to Alexa.

 

Your process might look something like this:

 

 

Tech Note: Because the Alexa API has an 8 second response timeout, you'll want to have an Atom Worker provisioned for your Boomi Cloud atom to minimize latency. Contact Boomi support if you need one provisioned.

 

Define Request and Response Profiles

In the Web Services Server Operation in the Start Shape, you will need to define specific input and output JSON documents. You can use the sample JSON files below to generate the Boomi profiles:

 

 

Sample JSON Request

{
   "version": "string",
   "session": {
     "new": true,
     "sessionId": "string",
     "application": {
       "applicationId": "string"
     },
     "attributes": {
       "string": {}
     },
     "user": {
       "userId": "string",
       "accessToken": "string"
     }
   },
   "context": {
     "System": {
       "application": {
         "applicationId": "string"
       },
       "user": {
         "userId": "string",
         "accessToken": "string"
       },
       "device": {
         "supportedInterfaces": {
           "AudioPlayer": {}
         }
       }
     },
     "AudioPlayer": {
       "token": "string",
       "offsetInMilliseconds": 0,
       "playerActivity": "string"
     }
   },
   "request": {}
}

Sample JSON Response

{  

   "version": "string",

   "response": {

     "outputSpeech": {

       "type": "string",

       "text": "string",

       "ssml": "string"

     },

     "card": {

       "type": "string",

       "title": "string",

       "content": "string",

       "text": "string",

       "image": {

         "smallImageUrl": "string",

         "largeImageUrl": "string"

       }

     },

     "reprompt": {

       "outputSpeech": {

         "type": "string",

         "text": "string",

         "ssml": "string"

       }

     },

     "directives": [

       {

         "type": "string",

         "playBehavior": "string",

         "audioItem": {

           "stream": {

             "token": "string",

             "url": "string",

             "offsetInMilliseconds": 0

           }

         }

       }

     ],

     "shouldEndSession": true

   }

}

 

Mapping the Alexa Response

There are only three fields that need to be mapped in the response profile:

  • Version - Set Default Value to "1.0"
  • Response/Object/outputSpeech/Object/type - Set Default Value of "PlainText"
  • Response/Object/outputSpeech/Object/text - Set Default Value to the literal text you want Alexa to speak to you after the service has completed

 

Note: The source profile in the map is a "dummy" profile. It does not match the actual incoming data and no values are mapped from it.

 

 

Create the "Work" Process

I'm not going to go into details for the second, "work" process that is executed from the first listener process, but for our simple example the high level flow is simply:

  1. No Data start shape.
  2. AtomSphere API connector to call the Create Deployment API with a given process ID and environment ID.

 

These IDs values can be hard coded in that process for simplicity or read dynamically from some other data repository (perhaps staged in a database or change management tool) or even conveyed verbally via Alexa.

 

Deploy and Test

Deploy the listener process to the Boomi Atom Cloud, deploy the second work process to a local Atom (or again to the Atom Cloud), and start chatting with Alexa. For this example, say "Alexa, deploy my Boomi process" and watch what happens!

 

I encourage you to take these basic mechanics and see what cool use cases you come up with. Let me know in the comments below!

 

Sean Murphy is a Pre-sales Solution Architect for Dell Boomi with 15+ years of integration and EDI experience.

Outcomes