Chatbot via make

I’d like to create a chatbot that interacts with users after they message me. The bot shouldn’t be a one-liner, it should act like a chatbot and send-receive messages while knowing the whole context of the conversation.
I’m curious what module would be good for that and how I should go about holding the previous conversation in the context of the new replies. Also, how can I exit via that first “conversation loop” and start a new one.

Example scenario:

  • ig user writes “appointment” in the chat
  • bot asks them personal info until it gets all the information (loop 1)
  • bot then asks appointment related questions until it gets the desired date/hour for the appointment (loop 2)
  • checks if it’s available (my module)
  • if not goes back to the questions

My unknown is regarding the ping-pong chat in which the users writes on consecutive lines the information, then the bot answers, then it writes again. How can I do this in make? Is there a recommended module, do I need to do a loop or multiple automations (one for each loop) which are triggered by one master automation? If someone has a blueprint that does something similar would love to take a look.

Thank you for sharing! If you’re interested in learning more about how to create a chatbot, you can check out this article: https://www.cleveroad.com/blog/how-to-make-a-chatbot/.