Search code examples
google-cloud-platformdialogflow-esdialogflow-es-fulfillment

Connect DialogFlow to Compute Engine Instance


I have a project on GCP which contains a compute node, dns,router,load balancer and API DialogFlow. The connection of DF fulfillment (webhook) with the compute node is though the dns and the load balancer, and it's works.

I detected some random and unfrequently latency problems between DF fulfillment (webhook) and the node and I suppose that if I could connect the webhook directly I'll reduce timings.

I want to connect the DF fulfillment (webhook) directly to the internal IP of the node, but it seems not possible. The DF API and the compute node are on the same GCP project, Why I can't connect the fulfillment with the local IP of the node?


Solution

  • So, the Dialogflow webhook service has some requirements as below:

    1. It must handle HTTPS requests (I think with Compute Engine you can implement this using Ngrok)
    2. The URL for requests must be publicly accessible
      ...
      and a few more.

    Although your logic that internal IP could reduce time is correct, the problem is it is not publicly assessable. I guess that is why it is not working. Additionally, DF's waiting time is 5 second and that should be enough unless you are doing some complicated DB queries. Even in that case, I have seen people discussing some workaround to extend the waiting time.
    Here's the link for more details