Create an Intelligent Facebook Messenger Chatbot with GPT-4o-mini & Message Memory
Who is this for?
Businesses and developers who want to automate customer support or engagement on Facebook Messenger using AI-powered responses.
What does it do?
Creates an intelligent Facebook Messenger chatbot that: Responds to messages using OpenAI (gpt-4o-mini) Batches rapid-fire messages into a single AI request Maintains conversation history (50 messages per user) Shows professional UX feedback (seen indicators, typing bubbles)
How it works
Webhook Verification - Handles Facebook's GET verification request Message Reception - Receives incoming messages via POST webhook Message Batching - Waits 3 seconds to collect multiple quick messages AI Processing - Sends combined message to OpenAI with conversation context Response Delivery - Formats and sends the AI response back to Messenger
Setup
Configure Facebook Graph API credential with your Page Access Token Configure OpenAI API credential with your API key Set your verify token in the "Is Token Valid?" node Register the webhook URL in Facebook Developer Console
Key Features
Message Batching: Combines "Hey" + "Can you help" + "with my order?" into one request Conversation Memory: Remembers context from previous messages Echo Filtering: Prevents responding to your own messages Response Formatting: Cleans markdown for Messenger's 2000-char limit
Related Templates
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
Task Deadline Reminders with Google Sheets, ChatGPT, and Gmail
Intro This template is for project managers, team leads, or anyone who wants to automatically remind teammates of tasks ...
š¤ Build Resilient AI Workflows with Automatic GPT and Gemini Failover Chain
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. How it works This...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments