Hi there,
I'm receiving an error message when calling .setFollowupEvent() (only after updating to 0.6.1)
The expected result:
Switching to a new intent by using .setFollowupEvent()
The result:
Error: No responses defined for platform: ACTIONS_ON_GOOGLE
Is there a solution to this problem?
My code:
const agent = new WebhookClient({request: request, response: response});
agent.context.set(shiftContext); // shiftcontext is a valid context object
agent.setFollowupEvent(eventName)
@LukeJanissen You'll need to enable responses based on platforms you plan to use with your agent. For the specific intent you'll need to go to Responses and either add a Response under the Actions on Google tab or enable the toggle Use response from the DEFAULT tab as the first response.

@sarahdwyer I'm using responses from both Dialogflow and Google Assistant, so that's not the issue. Prior to the update, my webhook functioned fine, so I do think it has something to do with the update. Isn't there a syntax change of any kind?
I'm also having the same issue. After I did the update my setFollowupEvent calls stopped working.
@nielswh @LukeJanissen Please include your fulfillment code
@sarahdwyer No matter the agent.requestSource, if the fulfillment calls only:
agent.setFollowupEvent('event-name');
it just fails with:
Error: No responses defined for platform: null (null or whatever platform)
even though some static response text is defined in that intent. I'm only using the DEFAULT tab on the static responses, and I actually receive that text when my fulfillment breaks.
I need to set any dummy text in the fulfillment for it to work:
agent.add('Some dummy text');
agent.setFollowupEvent('event-name');
text which, as expected, doesn't reach the user. But it just feels unnatural the need to set some text in spite of the setFollowupEvent call.
"actions-on-google": "^2.4.1",
"firebase-admin": "~6.0.0",
"firebase-functions": "^2.1.0",
"dialogflow-fulfillment": "^0.6.1"
I'm having the same issue here. I have the default response and Telephony custom response and call transfer setup in the intent and when my fulfillment code calls .setFollowupIntent('intent_name') it crashes with that same 'no responses defined' error.
While this issue is open is there anyway to pass a payloadResponse via agent.add to make Telephony transfer the call? I've been looking all over and the documentation on payload is somewhat limited.
Just a hunch, your issue is in v2-agent.js on the following function, more specifically on the first conditional.
sendResponses_(requestSource) {
let responseJson = this.responseJson_;
if (!responseJson) {
throw new Error(`No responses defined for platform: ${requestSource}`);
}
responseJson.outputContexts = this.agent.context.getV2OutputContextsArray();
if (this.agent.followupEvent_) {
responseJson.followupEventInput = this.agent.followupEvent_;
}
if (this.agent.endConversation_) {
responseJson.triggerEndOfConversation = this.agent.endConversation_;
}
debug('Response to Dialogflow: ' + JSON.stringify(responseJson));
this.agent.response_.json(responseJson);
}
On v0.5.0 is was being handled by the sendJson_ function:
sendJson_(responseJson) {
responseJson.outputContexts = this.agent.outgoingContexts_;
if (this.agent.followupEvent_) {
responseJson.followupEventInput = this.agent.followupEvent_;
}
if (this.agent.endConversation_) {
responseJson.triggerEndOfConversation = this.agent.endConversation_;
}
debug('Response to Dialogflow: ' + JSON.stringify(responseJson));
this.agent.response_.json(responseJson);
}
This will be fixed in the v0.6.2 release
Thanks Matt
When will the new version be released? Is there any workaround in this case.
@hima2897 To workaround, just add some blank space string or dummy text before setting the followup event:
agent.add('Some dummy text');
agent.setFollowupEvent('event-name');
@maganap Thanks it worked for me
The same bug exists in 0.5.0 and this is the only documented workaround I was able to find. Please add this to the official documentation so others can find more easily.
Most helpful comment
@hima2897 To workaround, just add some blank space string or dummy text before setting the followup event: