With the introductions of Actions and Integrations, there are now 3 main methods to connect to backend APIs. I am trying to work out all the pros and cons of the different methods and why someone would use one method over another.
1) Method 1: Webhooks
This is a cut down version of the older Classic Assistant webhook. No pre-message webhook unless you are using the Classic Assistant, so you can only make the webhook call now once the users message has been received and processed by Watson.
There is only one webhook per dialog skill, so the API called by the webhook effectively does any orchestration required to call various external APIs, aggregate data, etc.
8 second timeout on webhook call.
State/Context needs to be passed to the API if it is needed.
2) Method 2: Actions/Integrations
Actions can use Integrations to call backend services.
Multiple Integrations can be configured with multiple operations with request and response parameters defined. Max 100 Integrations per Assistant
State/Context needs to be passed to the Integration as request parameters if it is needed.
3) Method 3: Custom "Orchestration" Application
According to the documentation this is a "client application that communicates with an assistant at run time, use the new v2 API. By using this API, you can develop a user-facing client that can be deployed for production use, an application that brokers communication between an assistant and another service (such as a chat service or back-end system)"
Option to use automatic state management (manual/stateless state management also available)
Full control over all aspects of integration and orchestration of conversation flow.
Could be more prone to being left behind as Watson Assistant develops (eg. the move from V1 to V2 API calls in the past) as all actions are manually orchestrated by the code. (I am thinking that Method 1 and 2 only call externally for additional information and rely on the core WA capability to manage flow, state and context)
I've got a new project that will need to call on multiple backend services via API's, integrate with a web front end as well as a mobile app and possibly voice, and I'm trying to determine the best approach for this project.
I'd be interested in any comments, feedback, expansion, correction on the above.
------------------------------
Graham Walker
------------------------------
#WatsonAssistant