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

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

Needs changes

by Stéphane Bordas · 6,380 views · created 2025-10-07 · Support Chatbot, AI Chatbot

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Function (legacy). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 18 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model, Wikipedia and OpenAI. It also calls graph.facebook.com over HTTP.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. Identify Message Type (Function): runs custom JavaScript (legacy Function node)
  2. Identify and ReRoute Message Types (Switch): routes items into 3 branches
  3. Download Image (HTTP Request): calls an HTTP API
  4. Download Audio (HTTP Request): calls an HTTP API
  5. Edit Fields (Edit Fields (Set)): sets 1 field: user_prompt
  6. Analyze image (OpenAI): analyze (image)
  7. Audio Transcriber (OpenAI): transcribe (audio)
  8. AI Agent: runs an AI agent, with model: OpenAI Chat Model; 2 tools (Wikipedia, Calculator); memory: Simple Memory
  9. Edit Fields (Edit Fields (Set)): sets 1 field: user_prompt
  10. Edit Fields (Edit Fields (Set)): sets 1 field: user_prompt

…plus 3 more steps. See the full node list below.

Services it uses

OpenAI Chat ModelWikipediaOpenAI

HTTP calls to: graph.facebook.com

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • Function (legacy) in Identify Message Type: replace with Code node, mode 'Run Once for All Items'.
Removed in 3.0Replace with
Function (legacy)
Identify Message Type
Code node, mode 'Run Once for All Items'

Nodes used (12)

From the author

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,…

Excerpt from Stéphane Bordas's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.