...
Intent - You can choose the intents for which this Pre hook request node should be triggered. The Prehook request node will be triggered for the intents listed in this field irrespective of the state.
Prehook handler
To handle the requests from the prehook, place the below code in the function node after the Pre Hook Request node.
Code Block |
---|
msg.payload.handleRequest = false;
msg.payload.preHookData = {name: 'arun'};
return msg; |
The msg.payload.handleRequest
takes boolean values.
If set to
true
, the corresponding intent will not get triggeredIf set
false
, the corresponding intent will get triggered appending the data stored inmsg.payload.preHookData
Pre Hook Response node
...
Name - Custom name given to the node.
Prehook usage
In the below example, using login intent will invoke the login directive if the user is not logged in.
When the Login intent is invoked by the chatbot user, the prehook node is invoked and checks if the user is logged in or not. If the user is not logged in, the login directive will be invoked.handleRequest - true, the actual flow wont get executed.
handleRequest - false, preHookData is filled, then it will get triggered before the actual response.
Related Articles
Filter by label (Content by label) | ||||||||
---|---|---|---|---|---|---|---|---|
|