Skip to main content

Facebook Messenger Bot with GPT-4 for Text, Image & Voice Processing

Workflow preview

Workflow preview
100%
Facebook Messenger Bot with GPT-4 for Text, Image & Voice Processing preview
Open on n8n.io

Important notice

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

1. Workflow Overview

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 fr...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.toolcalculator, @n8n/n8n-nodes-langchain.toolwikipedia, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.switch, n8n-nodes-base.function

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Stéphane Bordas.

Original n8n.io source

1.1 Workflow description

Title
Facebook Messenger Bot with GPT-4 for Text, Image & Voice Processing
Workflow name
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

1.	Connect credentials

Add your OpenAI API key and Facebook Page Access Token in n8n credentials.

2.	Plug the webhook

Copy the Messenger webhook URL from your workflow and paste it into your Facebook Page Developer settings (Webhook → Messages → Subscribe).

3.	Customize the agent

Edit the System Message of the AI Agent to define tone, temperature, and purpose (e.g. “customer support”, “math assistant”).

4.	Enable memory & tools

Turn on Simple Memory to keep conversation context and activate tools like Calculator or Wikipedia.

5.	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.

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 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 2 - Simple Memory

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

Block 3 - Calculator

Type / Role
@n8n/n8n-nodes-langchain.toolCalculator - toolCalculator
Config choices
Version 1

Block 4 - Wikipedia

Type / Role
@n8n/n8n-nodes-langchain.toolWikipedia - toolWikipedia
Config choices
Version 1

Block 5 - Download Audio

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

Block 6 - Audio Transcriber

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 7 - Identify and ReRoute Message Types

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 8 - Download Image

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

Block 9 - Identify Message Type

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

Block 10 - Edit Fields1

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

Block 11 - Edit Fields2

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

Block 12 - Edit Fields3

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

Block 13 - Code1

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

Block 14 - Code

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

Block 15 - Send Response

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

Block 16 - AI Agent Messenger

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

Block 17 - Analyze image

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 18 - Webhook1

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

Block 19 - Sticky Note2

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

Block 20 - Sticky Note3

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

Block 21 - Sticky Note

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

Block 22 - Sticky Note4

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

Block 23 - Sticky Note5

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

Block 24 - Sticky Note6

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

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

3. Summary Table

Workflow Facebook Messenger Bot with GPT-4 for Text, Image & Voice Processing
Complexity advanced
Nodes 34
Categories Support Chatbot, AI Chatbot
Author Stéphane Bordas
Published 07 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9347/9347.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 Bot with GPT-4 for Text, Image & Voice Processing do?

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 fr...

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.