I've integrated Amazon Lex bot with Facebook workplace messenger, which responds to utterances (questions) and fills up all slots. But when user answers all questions, it just returns the parameters to messenger (intent name and all slots and their values in key-value pairs) as final output, instead of the actual output which Lambda function returns. Below is the final returned output:
Intent: TestIntent
Slots: month:jan year:2015 channel:testChannel type:testType main:salesVolume category:testCategory region:testRegion
I have specified a Lambda function in the fulfilment (but not in lambda initialization and validation), which gives the final output. This bot is working in Lex Test Bot and returning correct output, which I suppose is because of successfully calling Lambda function.
In the Channels tab of Lex console, the IAM role for messenger integration is AWSServiceRoleForLexChannels
, but this cannot be changed.
Is the Facebook messenger not calling the Lambda function? Why is the Lex bot working in test but not in Facebook workplace messenger?
The issue was related to bot aliases and versioning. The alias used by Messenger integration was pointing to an old version. Changed the alias pointer to latest version and it worked.