AutomationMart
Home/Browse/Build a Facebook Messenger customer service AI chatbot with Google Gemini
n8n

Build a Facebook Messenger customer service AI chatbot with Google Gemini

n8nn8n16 modulesv1.0
agentcodehttpRequestiflmChatGoogleGeminimemoryBufferWindowoutputParserStructuredrespondToWebhooksetswitchwebhook

Build a customer service AI chatbot for Facebook Messenger with Google Gemini --- πŸ“Œ Overview A streamlined Facebook Messenger chatbot powered by AI with conversation memory. This is a simplified version designed for quick deployment, learning, and testing β€” not suitable for production environments. Base workflows: - Smart message batching AI-powered Facebook Messenger chatbot use Data Table - [Smart human takeover & auto pause AI-powered

At a glance

Build a Facebook Messenger customer service AI chatbot with Google Gemini is a ready-made n8n workflow you import as a workflow JSON file β€” no build required. It connects agent, code, httpRequest, if. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
agent, code, httpRequest, if, lmChatGoogleGemini, memoryBufferWindow
Modules
16
Price
Free
Version
v1.0
Build a Facebook Messenger customer service AI chatbot with Google Gemini workflow diagram

About this workflow

Build a customer service AI chatbot for Facebook Messenger with Google Gemini --- πŸ“Œ Overview A streamlined Facebook Messenger chatbot powered by AI with conversation memory. This is a simplified version designed for quick deployment, learning, and testing β€” not suitable for production environments. Base workflows: - Smart message batching AI-powered Facebook Messenger chatbot use Data Table - Smart human takeover & auto pause AI-powered Facebook Messenger chatbot --- 🎯 What This Workflow Does βœ… Core Features: - Receives messages from Facebook Messenger via webhook - Processes user messages with Google Gemini AI - Maintains conversation context using Simple Memory node - Automatically responds with AI-generated replies - Handles webhook verification for Facebook setup - Send image or video to customer through Facebook Messenger πŸ”Ή Simplified Approach: - Memory: Simple Memory node (10-message window) - Format: Cleans text, strips markdown, truncates >1900 chars - Response: Single message delivery ⚠️ Limitations & Trade-offs: 1. No Smart Batching β†’ fragmented user messages cause spam-like replies 2. No Human Takeover Detection β†’ bot continues even when admin joins 3. Basic Memory Management β†’ no persistence, not reliable in production 4. Basic Text Formatting β†’ strips markdown, truncates brutally, no smart splitting --- πŸš€ When to Upgrade Upgrade to full workflows when you need: - Production deployment with reliability & persistence - Analytics & tracking (query history, reports) - Professional formatting (bold, italic, lists, code blocks) - Handling long messages (>2000 chars) - Smart batching for fragmented inputs - Human handoff detection - Full conversation persistence Key upgrades available: - Smart message batching workflow - Smart human takeover workflow --- βš™οΈ Setup Requirements Facebook Setup 1. Create Facebook App at developers.facebook.com 2. Add Messenger product 3. Configure webhook: - URL: - Verify token: secure string - Subscribe to: messages, messagingpostbacks 4. Generate Page Access Token 5. Copy token to "Set Context" node n8n Setup 1. Import workflow 2. Edit "Set Context" node β†’ update pageaccesstoken 3. Configure "Gemini Flash" node credentials 4. Deploy workflow (must be publicly accessible) --- πŸ”„ How It Works --- πŸ—οΈ Architecture Overview Section 1: Webhook & Initial Processing - Facebook Webhook: handles GET (verification) & POST (messages) - Confirm Webhook: returns challenge / acknowledges receipt - Filters text messages only - Blocks echo messages from bot itself Section 2: AI Processing with Memory - Set Context: extracts userid, message, token - Seen & Typing: user feedback - Conversation Memory: 10-message window, per-user isolation - Process Merged Message: AI Agent with Jenix persona - Gemini Flash: Google’s AI model for response generation Section 3: Format & Delivery - Cuts replies >2000 chars, strips markdown - Sends text via Facebook Graph API --- 🎨 Customisation Guide - Bot Personality: edit system prompt in "Process Merged Message" node - Memory: adjust contextWindowLength (default 10), change sessionKey if needed - AI Model: replace Gemini Flash with OpenAI, Anthropic Claude, or other LLMs --- πŸ“Œ Important Notes ⚠️ Production Warning: testing only, memory lost on n8n restart in queue mode πŸ“Š No Analytics: no history storage, no reporting πŸ”§ Format Limitations: responses ≀1800 chars, markdown stripped, no complex formatting --- πŸ› οΈ Troubleshooting - Bot not responding β†’ check token, webhook accessibility, event subscriptions - Memory not working β†’ verify session key, ensure not in queue mode, restart workflow - Messages truncated β†’ adjust system prompt for conciseness, reduce response length --- πŸ“œ License & Credits Created by: Nguyα»…n Thiệu ToΓ n (Jay Nguyen) - Email: me@nguyenthieutoan.com - Website: nguyenthieutoan.com - n8n Creator: n8n.io/creators/nguyenthieutoan - Company: GenStaff

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n β†’ click the menu β†’ Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Qualify real estate leads automatically with OpenAI, Gmail & Airtable CRM

How It Works 1. This AI Agent automatically qualifies property buyer leads from form submissions. 2. Form Submission Trigger 3. When a user submits their details via a property inquiry form, the workflow is triggered. 4. AI Lead Classification 5. The buyer's input (budget, location, timeline, etc.) is analyzed by OpenAI to extract structured data and generate a lead score (0–100). 6. Lead Qualification Logic 7. Leads with a score of 70 or above are marked as qualified, the rest are ignored or

Free

AI-driven lead management and inquiry automation with ERPNext & n8n

Overview This workflow template automates lead management and customer inquiry processing by integrating ERPNext, AI agents, and email notifications. It streamlines the process of capturing leads, analyzing inquiries, and generating actionable responses. The workflow uses ERPNext to capture inquiries, analyzes them with AI, and notifies the appropriate team or individual, all while maintaining a professional approach. --- What This Template Does 1. ERPNext Webhook Integration: - Captures leads

Free

Automate Marker.io issues to Zendesk support tickets with full technical context

Automatically create Zendesk tickets with full technical context when your team receives new Marker.io issues 🎯 What this template does This workflow creates a seamless bridge between Marker.io and Zendesk, your customer support platform. Every issue submitted through Marker.io's widget automatically becomes a trackable ticket in Zendesk, complete with technical details and visual context. Centralizing customer issues in Zendesk helps your support agents continue the conversation right where the

Free

Generate 9:16 images from content and brand guidelines

Overview This n8n workflow automates the creation of 9:16 aspect ratio images optimized for short-form video content and thumbnails. It integrates multiple tools to retrieve content, generate scripts, and create AI-generated imagery. --- Key Features 1. Trigger Workflow Manually - The workflow starts when triggered manually in n8n. 2. Retrieve Brand Guidelines - Fetch brand elements like style, tone, and guidelines from Airtable. 3. SEO Keywords and Blog Post Retrieval - Retrieves blog pos

Free

Create product satisfaction surveys with Telegram, Google Sheets and AI

This n8n template uses a Telegram chatbot to conduct a Product Satisfaction Survey and fetches questions and stores answers in a Google sheet. It augments an AI Agent to ask follow-up questions to engage the user and uncover more insights in their responses. This template is intended to demonstrate how you'd realistically approach a workflow where there is structured conversation (static questions) but you still want to include an free-form element (follow-up questions) which can only be accompl

Free

Manage WooCommerce store operations via AI Telegram bot with OpenRouter

Who’s it for This template is built for WooCommerce store owners, eCommerce managers, and automation agencies who want to manage store operations directly from Telegram using an AI assistant. It’s ideal for users looking to save time, automate support, and access store data conversationally. How it works When a user sends a message via Telegram, the workflow triggers an AI agent that understands the request using a chat model with memory. Based on the intent, the agent executes the approp

Free

Deploy Docker MinIO, API backend for WHMCS/WISECP

Setting up n8n workflow Overview The Docker MinIO WHMCS module uses a specially designed workflow for n8n to automate deployment processes. The workflow provides an API interface for the module, receives specific commands, and connects via SSH to a server with Docker installed to perform predefined actions. Prerequisites - You must have your own n8n server. - Alternatively, you can use the official n8n cloud installations available at: n8n Official Site Installation Steps Install the Required Wo

Free

Multi-level WordPress blog generator with PerplexityAI research & OpenAI content

WordPress Auto-Blogging Pro v2 \- with DEEPER RESEARCH \- Advanced Content Automation (This version is an upgrade from v1: WordPress Auto-Blogging Pro \- with DEEP RESEARCH \- Content Automation Machine v1) Take your content automation to unprecedented depths\! This v2 template enhances the acclaimed "WordPress Auto-Blogging Pro \- with DEEP RESEARCH" by introducing Deeper Research, a multi-level research capability designed to generate exceptionally comprehensive, long-form content like detaile

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint β€” instant download
  • Setup guide PDF included
  • 5 downloads Β· valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

β‚Ή2,499/ session
3 hrs Β· video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free