Building Conversational Bot with Custom workflows using Google DialogFlow Contexts Part 2

This is in continuation to my previous for showing contexts capabilities in DialogFlow, I will cover implementation for setting up contexts in Dialogflow project and backend fulfillment changes using DialogFlow SDK and NodeJS.

Complete implementation is available here.

Setup Dialogflow project

  1. Download sample DialogFlow exported zip from this link.
  2. Create new dialogFlow project using steps from previous post.
  3. Once done go to DialogFlow console

3. Click on setting section

4. Select “Export and Import” link from right section.

Trending Bot Articles:

1. Case Study: Building Appointment Booking Chatbot

2. IBM Watson Assistant provides better intent classification than other commercial products according to published study

3. Testing Conversational AI

4. How intelligent and automated conversational systems are driving B2C revenue and growth.

5. Next click “Restore from zip” link from right section and browse zip downloaded earlier and upload . This will overwrite existing project and restore sample context example project.

6. Next step is to setup fulfillment api and configure it in DailogFlow project Select “Export and Import” link from right section.

7. Follow github link for NodeJS project and clone it

7. Open terminal and go inside cloned folder and run npm i command (assuming npm already installed )

8. Start app using node app.js and server will be listening on port 4000

9. Test running browser and hitting link http://localhost:4000/google

{“error”:”No intent was provided and fallback handler is not defined.”}

This means setup is working fine.

Next steps is to expose local running api over internet so it can be configured on Dialogflow fulfillment section.

ngrok – secure introspectable tunnels to localhost

Download ngrok install and run it with same port of application

e.g. ./ngrok http 4000

10. Go to Dialogflow console and update fulfillment link .

Now go to action-on-google console and test application . Below is sample running example:-


This shows contexts are very essence for DialogFlow NLP engine and provide needed navigation controls on user journey in flow.

Connect with me on LinkedIn

Don’t forget to give us your 👏 !

Building Conversational Bot with Custom workflows using Google DialogFlow Contexts Part 2 was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.