Skip to main content

Automated Facebook message response with GPT-4o and Airtable inventory matching

Workflow preview

Workflow preview
100%
Automated Facebook message response with GPT-4o and Airtable inventory matching preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Description This workflow automates AI driven Facebook Messenger product inquiry handling, connecting Facebook DMs with Airtable inventory and returning instant automated replies based on produc...

Best for

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

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.airtable, n8n-nodes-base.facebookgraphapi, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.lmchatazureopenai, n8n-nodes-base.merge, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automated Facebook message response with GPT-4o and Airtable inventory matching
Workflow name
Automated Facebook message response with GPT-4o and Airtable inventory matching

πŸ“˜ Description

This workflow automates AI-driven Facebook Messenger product inquiry handling, connecting Facebook DMs with Airtable inventory and returning instant automated replies based on product availability. It runs hourly, fetches new messages, extracts the latest customer query, uses GPT-4o to identify the product and intent, merges this with the Airtable inventory dataset, performs an AI-assisted product match, and replies automatically inside the same Facebook conversation. Invalid or malformed messages are logged to Google Sheets for review.

βš™οΈ What This Workflow Does (Step-by-Step)

▢️ Trigger – Fetch New Facebook Messages (Every Hour) Schedules hourly polling of new conversations from Facebook Messenger.

🟦 Fetch Facebook Conversation List (Graph API) Retrieves conversation threads from the connected Facebook Page.

πŸ’¬ Fetch Facebook Conversation Messages (Graph API) Loads message details (content, sender, timestamp) for the selected conversation.

πŸ“© Extract Latest Facebook Message (Code) Sorts all messages and picks the latest one β†’ this is the message analyzed by AI.

πŸ” Validate Record Structure (IF) Ensures the incoming message has required fields. Valid β†’ AI analysis Invalid β†’ logged to Google Sheets.

πŸ“„ Log Invalid Records to Google Sheet Stores malformed or unprocessable messages for audit and correction.

🧠 Configure GPT-4o β€” Message Classification Model Defines AI model used to extract product details and intent from the customer’s message.

πŸ€– AI – Extract Product & Customer Intent AI identifies: product name (standardized) customer intent (availability, pricing, inquiry) cleaned query always returns structured JSON No inventory lookup happens here.

πŸ“¦ Fetch Inventory Records from Airtable Pulls complete product inventory list to cross-match with customer request.

πŸ” Merge AI Output With Inventory Dataset Combines: AI-interpreted message data Airtable inventory records This prepares a unified object for product lookup.

πŸ“ Build Combined AI + Inventory Payload (Code) Constructs { ai: {...}, inventory: [...] } for the product-matching AI agent.

🧠 Configure GPT-4o β€” Product Matching Model Sets strict rules for identifying whether the requested product exists in inventory.

πŸ€– AI – Match Requested Product in Inventory AI checks: exact / close match to product name whether item exists generates structured JSON reply text + confidence score.

🧹 Parse AI Product Match JSON (Code) Ensures the AI output is valid JSON before making decisions.

πŸ” Check If Product Exists (IF) If found β†’ sends β€œproduct available” reply If not β†’ sends β€œproduct not found” reply.

πŸ“¨ Send Facebook Reply β€” Product Found (Graph API) Sends a personalized Messenger reply including matched product details.

πŸ“¨ Send Facebook Reply β€” Product Not Found (Graph API) Replies politely informing customer that the product is not available.

🧩 Prerequisites

  • Facebook Graph API access token
  • Airtable API token
  • Azure OpenAI GPT-4o credentials
  • Google Sheets OAuth

πŸ’‘ Key Benefits

βœ” Fully automated Facebook DM handling βœ” AI-powered product identification even with typos or unclear wording βœ” Real-time product availability responses βœ” Unified Airtable-driven catalog lookup βœ” Automatic fallback for invalid messages βœ” Zero manual intervention for customer support

πŸ‘₯ Perfect For

  • Ecommerce stores
  • Catalog-based product businesses
  • Teams handling large volumes of Facebook DM inquiries
  • Businesses wanting instant customer replies without agents

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 - Trigger – Fetch New Facebook Messages (Every Hour)

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Fetch Inventory Records from Airtable

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

Block 3 - Fetch Facebook Conversation List

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

Block 4 - Fetch Facebook Conversation Messages

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

Block 5 - AI – Extract Product & Customer Intent

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

Block 6 - Extract Latest Facebook Message

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

Block 7 - Configure GPT-4o β€” Message Classification Model

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

Block 8 - Merge AI Output With Inventory Dataset

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

Block 9 - Build Combined AI + Inventory Payload (

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

Block 10 - AI – Match Requested Product in Inventory

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

Block 11 - Configure GPT-4o β€” Product Matching Model

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

Block 12 - Parse AI Product Match JSON

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

Block 13 - Check If Product Exists

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

Block 14 - Send Facebook Reply β€” Product Found

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

Block 15 - Send Facebook Reply β€” Product Not Found

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

Block 16 - Log Invalid Records to Google Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 17 - Validate Record Structure

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

Block 18 - Sticky Note

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

Block 19 - Sticky Note1

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

Block 20 - Sticky Note2

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

Block 21 - Sticky Note3

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

3. Summary Table

Workflow Automated Facebook message response with GPT-4o and Airtable inventory matching
Complexity advanced
Nodes 22
Categories Support Chatbot, AI Chatbot
Author Rahul Joshi
Published 28 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11321/11321.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 Automated Facebook message response with GPT-4o and Airtable inventory matching do?

Description This workflow automates AI driven Facebook Messenger product inquiry handling, connecting Facebook DMs with Airtable inventory and returning instant automated replies based on produc...

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.