Skip to main content

Facebook Messenger chatbot with GPT-4.1 & human escalation support

Workflow preview

Workflow preview
100%
Facebook Messenger chatbot with GPT-4.1 & human escalation support preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this for? This n8n workflow is designed for businesses, customer support teams, and page administrators who want to automate their Facebook Messenger responses while maintaining the ability ...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.respondtowebhook, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.toolthink, n8n-nodes-base.wait, n8n-nodes-base.if, n8n-nodes-base.httprequesttool, n8n-nodes-base.googledocstool

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by SpaGreen Creative.

Original n8n.io source

1.1 Workflow description

Title
Facebook Messenger chatbot with GPT-4.1 & human escalation support
Workflow name
Facebook Messenger chatbot with GPT-4.1 & human escalation support

Who is this for?

This n8n workflow is designed for businesses, customer support teams, and page administrators who want to automate their Facebook Messenger responses while maintaining the ability to escalate to human agents when needed. It's perfect for e-commerce stores, service providers, and organizations that receive customer inquiries through Facebook Messenger and want to provide instant, intelligent responses 24/7. The workflow can handle both text messages and attachments, automatically detects when human intervention is needed, and seamlessly transfers the conversation to a human admin.

What this Workflow Does

This n8n workflow creates an intelligent Facebook Messenger chatbot that can understand and respond to customer messages in both English and Bengali. It automatically classifies incoming messages to determine if they require human assistance, processes attachments by identifying file types, generates appropriate responses using AI, and escalates conversations to human admins when necessary. The workflow maintains conversation context through memory and can reference external documents for more accurate responses.

Key Features

  • Multi-language Support: Automatically detects and responds in English or Bengali
  • Message Classification: Determines if a message requires human intervention
  • Attachment Handling: Identifies and processes different file types (images, documents, etc.)
  • AI-powered Responses: Generates intelligent, context-aware responses using OpenAI
  • Admin Escalation: Seamlessly transfers conversations to human agents when needed
  • Memory Management: Maintains conversation context for more natural interactions
  • Document Integration: Can reference external Google Docs for information
  • Webhook Verification: Properly handles Facebook's webhook verification process

Requirements

  • Facebook Page with Messenger functionality
  • 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

1. Webhook Setup

  • Webhook: Receives incoming messages from Facebook Messenger
  • If3: Verifies webhook subscription requests
  • Respond to Webhook: Completes the verification process

2. Message Processing

  • If: Determines if the message contains text or attachments
  • Classify text: Analyzes text messages to determine if human intervention is needed
  • AI Agent1: Identifies attachment types

3. AI Response Generation

  • AI Agent: Generates intelligent responses to user messages
  • OpenAI Chat: Powers the AI Agent with language model capabilities
  • Think: Ensures responses match the user's language and tone
  • Memory: Maintains conversation context
  • HTTP: Enables external data retrieval
  • Google Docs: Allows referencing external documentation

4. Escalation Logic

  • If2: Determines if escalation is needed based on classification
  • Edit Fields1: Prepares data for escalation messages
  • Wait3: Adds delay before sending messages

5. Message Delivery

  • Admin Message: Notifies admin when escalation is needed
  • User Message: Confirms to user that their message was forwarded
  • Admin Message1: Notifies admin about attachments
  • User Replay Message: Sends AI-generated responses to users

Notes

  • The workflow uses a custom session key for memory management
  • Admin ID should be updated to match your Facebook admin user ID
  • The system is configured to respond in both English and Bengali
  • Webhook verification requires a specific verify token (set to "admin" in this example)
  • The workflow includes appropriate delays to prevent rate limiting

Ideal Use Cases

  • Customer service automation for e-commerce stores
  • Lead qualification and initial response
  • After-hours customer support
  • Information dissemination for organizations
  • Appointment scheduling and basic inquiries
  • Product information and recommendation requests

Support & Help

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 2 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 4 - Think

Type / Role
@n8n/n8n-nodes-langchain.toolThink - toolThink
Config choices
Version 1.1

Block 5 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 6 - AI Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 7 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - HTTP

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 9 - Google Docs

Type / Role
n8n-nodes-base.googleDocsTool - googleDocsTool
Config choices
Version 2

Block 10 - Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 11 - Wait1

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 12 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Edit Fields1

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - If2

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 15 - Wait3

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 16 - Admin Message

Type / Role
n8n-nodes-base.facebookGraphApi - facebookGraphApi
Config choices
Version 1

Block 17 - User Message

Type / Role
n8n-nodes-base.facebookGraphApi - facebookGraphApi
Config choices
Version 1

Block 18 - Admin Message1

Type / Role
n8n-nodes-base.facebookGraphApi - facebookGraphApi
Config choices
Version 1

Block 19 - User Replay Message

Type / Role
n8n-nodes-base.facebookGraphApi - facebookGraphApi
Config choices
Version 1

Block 20 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 32 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Facebook Messenger chatbot with GPT-4.1 & human escalation support
Complexity advanced
Nodes 32
Categories Support Chatbot, AI Chatbot
Author SpaGreen Creative
Published 30 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10321/10321.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Facebook Messenger chatbot with GPT-4.1 & human escalation support do?

Who is this for? This n8n workflow is designed for businesses, customer support teams, and page administrators who want to automate their Facebook Messenger responses while maintaining the ability ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.