I have an action set up in Dialogflow using webhook pointing to local server using ngrok tunnel. When using Dialogflow's "Test now" feature the webhook is working, the request is being sent to webhook and response is being received, but when testing in Simulator it says "Action isn't responding right now". In ngrok logs I can see the request being made to the endpoint the same as when using "Test now". In the Simulator's logs it's showing "MalformedResponse: Failed to parse Dialogflow response into AppResponse".

Here's the fulfillment response as seen from Dialogflow's diagnostic info:

{
  "payload": {
    "google": {
      "expectUserResponse": false,
      "richResponse": {
        "items": {
          "simpleResponse": {
            "textToSpeech": "test",
            "displayText": "test"
          }
        }
      }
    }
  }
}

1 Answers

1
Nicolas On

Found a solution in this comment https://stackoverflow.com/a/55238042/2197296, Turns out the simpleResponse element inside the items array has to be wrapped up in another array, like this:

"webhookPayload": {
  "google": {
     "richResponse": {
     "items": [
        {
          "simpleResponse": {
            "displayText": "test",
            "textToSpeech": "test"
          }
        }
      ]
    },
    "expectUserResponse": false
  }
},