Simple Facebook Messenger bot

Let’s create a simple flow that integrates the logic of a Facebook Messenger bot.

To see a complete tutorial about how to create a Facebook Messenger bot using Flowize follow this link.

This bot is basically going to answer exactly with the same text that the user sends if it receives a message. Also, it will respond to the postback buttons with another message.

The configuration of each object in this flow is listed below. If you need to know more about the variables that are used in the input parameters of these objects, please visit this link.

  • POSTBACK RECEIVED: This is the webhook that will be listening for the postbacks from Facebook Messenger. It is persistent because we want it to be permanently listening until the flow ends. We reference our interface in the Sender ID value parameter as the sender.id value is available in the payload that Facebook sends to our interface when the flow starts.
  • MESSAGE RECEIVED: This is the webhook that will be listening for the messages that we send to the bot on Facebook Messenger. It is persistent because we want it to be permanently listening until the flow ends. We reference our interface in the Sender ID value parameter as the sender.id value is available in the payload that Facebook sends to our interface when the flow starts.
  • SCHEDULER: This scheduler will wait for two hours to stop the execution of our flow.
  • SEND MESSAGE: This is the object that will send a message from our bot after it receives a message from the user on Facebook Messenger. For more detailed information about the parameters please refer to this post. We reference our webhook in the Sender Identifier and Message parameters because these values are available in the payload that Facebook sends to our webhook.
  • SEND POSTBACK: This object will send a message to the user after the user has pressed a postback button on Facebook Messenger. For more detailed information about the parameters please refer to this post. We reference our webhook in the Sender Identifier and Message parameters because these values are available in the payload that Facebook sends to our webhook.

Don’t forget to publish the flow once you have done all changes.

To see a complete tutorial about how to create a Facebook Messenger bot using Flowize follow this link.