๐Ÿ’ฌ Classify and respond to Facebook Messenger inquiries with GPT-4, Slack and Sheets

โšก 388 views ยท ๐Ÿ’ฌ Support Chatbots

๐Ÿ’ก Pro Tip โ€” If youโ€™ve run into Facebookโ€™s Graph API permission restrictions, ScraperNode is a community node that scrapes pages, groups, posts, and comments directly โ€” no app review needed.

View All Scrapers

Description

๐Ÿ“Š Description

Streamline Facebook Messenger inbox management with an AI-powered categorization and response system. ๐Ÿ’ฌโš™๏ธ This workflow automatically classifies new messages as Lead, Query, or Spam using GPT-4, routes them for approval via Slack, responds on Facebook once approved, and logs all interactions into Google Sheets for tracking. Perfect for support and marketing teams managing high volumes of inbound DMs. ๐Ÿš€๐Ÿ“ˆ

What This Template Does

1๏ธโƒฃ Trigger โ€“ Runs hourly to fetch new Facebook Page messages. โฐ 2๏ธโƒฃ Extract & Format โ€“ Collects sender info, timestamps, and message content for analysis. ๐Ÿ“‹ 3๏ธโƒฃ AI Categorization โ€“ Uses GPT-4 to identify message type (Lead, Query, Spam) and suggest replies. ๐Ÿง  4๏ธโƒฃ Slack Approval Flow โ€“ Sends categorized leads and queries to Slack for quick team approval. ๐Ÿ’ฌ 5๏ธโƒฃ Facebook Response โ€“ Posts AI-suggested replies back to the original sender once approved. ๐Ÿ’Œ 6๏ธโƒฃ Data Logging โ€“ Records every message, reply, and approval status into Google Sheets for analytics. ๐Ÿ“Š 7๏ธโƒฃ Error Handling โ€“ Automatically alerts via Slack if the workflow encounters an error. ๐Ÿšจ

Key Benefits

โœ… Reduces manual message triage on Facebook Messenger โœ… Ensures consistent and professional customer replies โœ… Provides full visibility via Google Sheets logs โœ… Centralizes team approvals in Slack for faster response times โœ… Leverages GPT-4 for accurate categorization and natural replies

Features

Requirements

Facebook Graph API credentials with page message permissions OpenAI API key for GPT-4 processing Slack API credentials with chat:write permission Google Sheets OAuth2 credentials

Environment Variables:

FACEBOOK_PAGE_ID GOOGLE_SHEET_ID GOOGLE_SHEET_NAME SLACK_CHANNEL_ID

Target Audience

Step-by-Step Setup Instructions

1๏ธโƒฃ Connect Facebook Graph API credentials and set your page ID. 2๏ธโƒฃ Add OpenAI API credentials for GPT-4. 3๏ธโƒฃ Configure Slack channel ID and credentials. 4๏ธโƒฃ Link your Google Sheet for message logging. 5๏ธโƒฃ Replace environment variable placeholders with your actual IDs. 6๏ธโƒฃ Test the workflow manually before enabling automation. 7๏ธโƒฃ Activate the schedule trigger for ongoing hourly execution. โœ…

๐Ÿ”— Nodes Used

Google Sheets, Slack, Facebook Graph API, Schedule Trigger, AI Agent, OpenAI Chat Model

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup