I built a Facebook Messenger AI chatbot with Google Gemini + conversation history - free template

Hey community! Sharing a workflow I built as an n8n Verified Creator - a full Facebook Messenger customer service AI chatbot powered by Google Gemini.

What it does:

  • Receives messages via Facebook Messenger webhook
  • Maintains full conversation history per user
  • Gemini AI generates context-aware responses
  • Handles multiple users simultaneously
  • Stores chat history in n8n Data Table

Why I built this:
I needed a production-ready chatbot for a client’s e-commerce store. Most tutorials skip the conversation memory part - this workflow handles it properly.

Tech stack:

  • n8n + Facebook Graph API
  • Google Gemini (gemini-1.5-flash)
  • n8n Data Table for memory
  • Webhook trigger

Free template: Build a Facebook Messenger customer service AI chatbot with Google Gemini | n8n workflow template

Happy to answer any questions! I’ve run this in production with 1,100+ uses. The key challenge is Facebook’s webhook verification - let me know if you hit issues there.

– Jay (nguyenthieutoan) | n8n Verified Creator

1 Like

nice, the data table memory approach is solid. how’d you handle webhook retries if the gemini response times out? we had issues with facebook’s webhook timeout window before.

1 Like