Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Dialogflow CX on webhook disconnect

Hello, 

I am working with dialogflow and botcopy integration. Whenever a intent use a webhook, it works fine, and return the response, but my issue is in case the webhook is down, botcopy freezes and stays with 3 dots waiting for the response, how could I solve this when the webhook is down, and no response go through.

 

Thanks!

Something like: "Sorry could you try again later" in case the timeout is out.

Solved Solved
0 7 1,080
1 ACCEPTED SOLUTION

7 REPLIES 7

Hi!

There is an event to match webhook failures! Check the docs! https://cloud.google.com/dialogflow/cx/docs/concept/handler#event-built-in

Taking advantage of the fact that we are here, I wanted to ask another question related to the webhook, in the best practices section: 

webhook-errors, I don't understand how they manage the errors, I got confused without examples. Currently I have this part where I know that if there is a webhook error, the transition is to the webhook_error page, but I don't understand how to make it general and repeat a webhook function 3 times.  Is this correct ? 

In my top flow, I have the preset parameter setted before the next one that have the webhook action. 
GerLC_0-1687183043406.png

Then where the webhook action is, I have an event handler that it will make a transition if there is a webhook error to the page if_webhook_error 

GerLC_1-1687183110102.png

 

Finally, I have my if_webhook_error page, that it will take the counter in the fulfillment response, and also two conditions, the ❤️ will return to the previous page so I can reuse this pages for every webhook error in that flow. And the =>3 that will end the session.

GerLC_2-1687183176443.png

 

But I don't understand this part in the documentation: 

  • Do not supply a transition target from the state handler that triggers the webhook call, otherwise, the webhook error event handler will not be invoked. Instead, set the transition target in the webhook response from the webhook service.

 

Is there someone who knows this? 

Hey sorry!

so just to understand the issue, what you are trying to achieve is using different transition depending on the number of failures?

Cheers,
Xavi

That's correct, I am trying to follow what it said in the best practice section here: https://cloud.google.com/dialogflow/cx/docs/concept/agent-design#webhook-errors

But there is some part that I don't understand like this part: 

  • Do not supply a transition target from the state handler that triggers the webhook call, otherwise, the webhook error event handler will not be invoked. Instead, set the transition target in the webhook response from the webhook service.

It this best practice? The previous page will have to have the webhook on the page fulfillment for it to fire on entry.

  

that depends on the use case. I would suggest most of the same:

  1. try the webhook 2-3 times (probably 2 as maximum)
  2. If it still fails, move to another flow/page to tell the user how to contact you

it should not be too complex from the user's perspective. When you design a conversation, think about the en user journey and how they are gonna interact with your assistant

Hello,

I have a similar error, Dialoglow CX disconnect the webhook after 6 seconds, and I have configured the webhook timeout in 30 seconds. 
What could the issue be? Could you help me to know what happened?

Error calling webhook 'https://xxx-x-webhook.t.com/webhook': State: URL_REJECTED, Reason: REJECTED_DEADLINE_EXCEEDED
This is the error, the request is done before to 30 secods.

Regards!