Automated Facebook Messenger Chatbot with AI & Admin Escalation
Who Is This For?
Businesses, support teams, and page admins who want intelligent, automated Messenger responses with escalation to human agents when needed. Ideal for e-commerce stores and service providers.
What This Workflow Does
This n8n workflow processes incoming Facebook Messenger messages, classifies them, handles attachments, generates AI-powered responses in English or Bengali, and escalates to human admins if required.
Key Features
- Multi-language support: English & Bengali
- Message classification for human escalation
- Attachment detection and processing
- AI-generated, context-aware responses using OpenAI
- Seamless admin escalation for complex messages
- Conversation memory management for natural interactions
- Document integration via Google Docs
- Webhook verification for Facebook integration
Requirements
- Facebook Page with Messenger enabled
- Facebook Graph API credentials
- OpenAI API credentials
- Google Docs API credentials (optional)
- n8n instance (self-hosted or cloud)
- Admin Facebook user ID for escalation
Workflow Components
Webhook Setup
- Webhook node for incoming messages
- If3 node: Verifies webhook subscription requests
- Respond to Webhook: Completes verification
Message Processing
- If node: Checks if message has text or attachments
- Classify Text: Determines need for human intervention
- AI Agent1: Identifies attachment types
AI Response Generation
- AI Agent & OpenAI Chat: Generates intelligent responses
- Think node: Matches response to language and tone
- Memory node: Maintains conversation context
- HTTP & Google Docs: Reference external data if needed
Escalation Logic
- If2: Determines if escalation is required
- Edit Fields1: Prepares data for admin messages
- Wait3: Adds delay before sending messages
Message Delivery
- Admin Message: Notifies admin of escalated conversation
- User Message: Confirms message forwarded to admin
- Admin Message1: Notifies admin about attachments
- User Replay Message: Sends AI-generated replies to users
Notes
- Custom session key used for memory management
- Admin ID must match your Facebook user ID
- Configured to respond in English and Bengali
- Webhook verification requires a verify token
- Delays included to prevent API rate limiting
Ideal Use Cases
- Customer service automation for e-commerce stores
- Lead qualification and initial responses
- After-hours support
- Information dissemination for organizations
- Appointment scheduling and basic inquiries
- Product information and recommendations
Support & Help