Facebook Messenger Bot with GPT-4 for Text, Image & Voice Processing
How it Works
This workflow lets you build a Messenger AI Agent capable of understanding text, images, and voice notes, and replying intelligently in real time.
It starts by receiving messages from a Facebook Page via a Webhook, detects the message type (text, image, or audio), and routes it through the right branch. Each input is then prepared as a prompt and sent to an AI Agent that can respond using text generation, perform quick calculations, or fetch information from Wikipedia.
Finally, the answer is formatted and sent back to Messenger via the Graph API, creating a smooth, fully automated chat experience.
Set Up Steps
Connect credentials
Add your OpenAI API key and Facebook Page Access Token in n8n credentials.
Plug the webhook
Copy the Messenger webhook URL from your workflow and paste it into your Facebook Page Developer settings (Webhook → Messages → Subscribe).
Customize the agent
Edit the System Message of the AI Agent to define tone, temperature, and purpose (e.g. “customer support”, “math assistant”).
Enable memory & tools
Turn on Simple Memory to keep conversation context and activate tools like Calculator or Wikipedia.
Test & deploy
Switch to production mode, test text, image, and voice messages directly from Messenger.
Benefits
💬 Multi-modal Understanding — Handles text, images, and audio messages seamlessly. ⚙️ Full Automation — End-to-end workflow from Messenger to AI and back. 🧠 Smart Replies — Uses OpenAI + Wikipedia + Calculator for context-aware answers. 🚀 No-Code Setup — Build your first Messenger AI in less than 30 minutes. 🔗 Extensible — Easily connect more tools or APIs like Airtable, Google Sheets, or Notion.
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