Create an intelligent Facebook Messenger chatbot with GPT-4o-mini & message memory
Needs changesWhat this workflow does
This AI workflow has 19 nodes and runs when an HTTP GET request hits its webhook URL (plus 1 other trigger). Along the way it connects OpenAI Chat Model.
How it runs
Trigger: When an HTTP GET request hits its webhook URL (plus 1 other trigger).
- Is Token Valid? (If): checks a condition and branches into true / false
- Acknowledge Event (Respond to Webhook): sends the response back to the webhook caller
- Respond with Challenge (Respond to Webhook): sends the response back to the webhook caller
- Respond Forbidden (Respond to Webhook): sends the response back to the webhook caller
- Filter Valid Messages (If): checks a condition and branches into true / false
- Store Message for Batching (Code): runs custom JavaScript code
- Send Seen Indicator (HTTP Request): calls an HTTP API (POST)
- Wait: waits 3 seconds
- Retrieve Batched Messages (Code): runs custom JavaScript code
- Has Messages to Process? (If): checks a condition and branches into true / false
…plus 5 more steps. See the full node list below.
Services it uses
Other OpenAI + Facebook templates (107)
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (10)
- Webhook
n8n-nodes-base.webhook - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Wait
n8n-nodes-base.wait - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Edit Fields (Set)
n8n-nodes-base.set
From the author
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…