Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Chatbots & Messaging Bots

Chatbots & Messaging Bots

Handle WhatsApp customer chats with an OpenAI agent and Data Tables

Runs on incoming WhatsApp messages: an OpenAI agent answers customers using stored history and FAQs in n8n Data Tables, handles media, and escalates to Telegram.

What it does

## Build a production-ready WhatsApp AI agent with OpenAI and Data Tables ### How it works This workflow builds a production-ready WhatsApp AI assistant that receives customer messages, normalizes text and supported media, stores conversation history, and replies using an OpenAI-powered agent. It creates and uses n8n Data Tables for persistent memory, FAQ lookup, duplicate-message handling, buffering, and answer tracking. The workflow also handles media transcription/description/PDF extraction, sends WhatsApp replies, and can notify the owner via Telegram when escalation or errors occur. ### Setup steps - Run the manual setup branch once to create the conversation and FAQ Data Tables. - Configure WhatsApp Cloud API credentials and webhook settings for the trigger and WhatsApp send/media nodes. Use a permanent System User token, because test tokens expire after 24 hours. - Configure OpenAI credentials for the chat model, voice transcription, and image description nodes. - Populate the Business FAQ Data Table with the questions, answers, and business knowledge the agent should use. - Update the Configuration node with the business name, assistant name, business information, and message buffer timing. - The read/typing HTTP request node uses the same WhatsApp API credential. The phone number ID is read from each incoming message, so nothing else needs to be configured. - Configure Telegram credentials and chat destination if owner alerts should be sent. ### Customization Adjust the prompt-building logic, FAQ table contents, supported media branches, bufferSeconds value, fallback message, and owner-alert conditions to match the business tone, hours, escalation rules, and response length preferences.

The steps

  1. Initialize Tables Manually
  2. Setup Conversation Table
  3. Setup FAQ Table
  4. When WhatsApp Message Received
  5. Set Configuration Parameters
  6. Parse WhatsApp Messages
  7. Filter Unread Messages
  8. Log New Messages
  9. Route by Message Type
  10. Extract Media Link
  11. Verify File Accessibility
  12. Fetch Media File
  13. Set Skipped File Info
  14. Route Media Type

34 steps in total.

Similar automations