I am currently exploring ways to initiate another DialogFlow Intent (using its event) from a webhook server built with node.js. This will occur after gathering the user's email address, verifying their registration status by sending a POST API request to an external organization's server.
Here is a basic scenario:
User: Hi!
Chatbot: Hello, I am here to assist you. Can you please provide me with your email address for registration verification?
User: [email protected]
Chatbot: Thank you. Let me check your registration status...
---> The fulfillment code will send a POST API request and receive the user's registration status if there is a match.
Based on the user's status, I aim to trigger a new intent: either Registered_Users_Intent or New_Users_Intent. While attempting to achieve this, I have experimented with the
agent.setFollowupEvent(({ "name": "targetIntentEventName" })
method, but it does not consistently activate the desired intent. I am uncertain about how to properly implement this in the fulfillment code to ensure consistent functionality.
If anyone has any suggestions or helpful resources to aid in resolving this issue, I would greatly appreciate it.