DialogFlow | NodeJS | Webhooks

Deploy NodeJS Webhook to Google Cloud

This tutorial was a series of posts which was first published in October 2017. There have been many updates in Google Cloud after this tutorial was first created, so it may not be the best learning resource for this topic. A couple of things to note: almost certainly, the interface will look different today and the screenshots may not be up to date whenever I ask you to click on a certain link, it is understood that you are already logged in to your Google account (that is, many of these links take you directly to specific feature pages inside the Google Cloud Console) If you would like me to update this tutorial, please leave a comment below. If I…

DialogFlow | NodeJS | Webhooks

Reader Question: Why are you using RunKit for your code samples instead of inline editor?

I got this question from a reader recently: In your course “Dialogflow for Non-programmers” you are using Runkit to develop your webhook code. What are the benefits of using Runkit over the Dialogflow’s inline editor? The reason I use RunKit for my code samples in that course is a) it is possible for someone to clone my notebook and have working sample code. Here is what they say on the RunKit home page: b) the same cannot be said of code I write using Dialogflow’s inline editor. In fact, it is almost the exact opposite. I vaguely mentioned it in a recent article (the 4th challenge), and the main issue is this: Because of the speed at which the Dialogflow…

DialogFlow | NodeJS | Webhooks

You can use only NodeJS in the inline editor of Dialogflow

I got this question in a comment recently: I have been asked this question a few times, so this might be a good opportunity to clarify. The inline editor uses Firebase cloud functions The code editor inside the Dialogflow console, also called as the Inline Editor, is actually used only for writing Firebase cloud functions. And even the type of code you can write within the inline editor using cloud functions is a bit limited. (For example, right now, if you want to write code that saves to a database you cannot do so from the inline editor, to the best of my understanding. You need to go to the regular webhook in that case.) Summary The inline editor in…

DialogFlow | NodeJS | Webhooks

Dialogflow NodeJS Webhook – the 10 minute guide

NOTE: the code samples that the Dialogflow team used to provide have either been deleted or moved to some completely different GitHub project. I don’t have the bandwidth at the moment to retrace my steps and get the old code. So I suggest you skip this tutorial and find other material elsewhere. Recently Dialogflow announced (rather, provided) a new library for helping people get started with building out a NodeJS webhook in very quick time. It is called the Dialogflow Fulfillment library and it is intended to help you build a NodeJS webhook inside your inline webhook editor. While the library is super helpful, the documentation on the GitHub page misses a few things. This article is intended to fill…

DialogFlow | NodeJS | Webhooks

Handling multiple intents in your NodeJS webhooks

In a previous article, I explained how you can get started with Firebase for your Dialogflow agent. I got a question from a reader asking how we can handle multiple actions in the same Firebase code. I will explain the process in this tutorial. Since we already wrote some code to handle a single intent in the tutorial, we can derive an example for handling multiple intents by adding to the old index.js file. The display message intent The actual intent is quite simple. The user will type “display message”, and we will have an action called displayMessage, and the intent will call the webhook which will send a message to be displayed in the console. Since the index.js already…