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
- Initialize Tables Manually
- Setup Conversation Table
- Setup FAQ Table
- When WhatsApp Message Received
- Set Configuration Parameters
- Parse WhatsApp Messages
- Filter Unread Messages
- Log New Messages
- Route by Message Type
- Extract Media Link
- Verify File Accessibility
- Fetch Media File
- Set Skipped File Info
- Route Media Type
34 steps in total.
Similar automations
Forms & SurveysCreate Instagram and Facebook carousels from articles with Claude, OpenAI and Slack64 stepsSocial Media PublishingPublish approved Facebook and Instagram image posts via Telegram and Gemini31 stepsChatbots & Messaging BotsRun WhatsApp AI support bot on Google Drive docs with Telegram handoff58 stepsAI Agents & AssistantsSales Agent for WhatsApp, Facebook and Instagram with MCP54 steps