Automated WhatsApp Support Agent with AI
detail.loadingPreview
Enhance your customer support with an AI-powered WhatsApp agent. This workflow automatically answers user inquiries using Gemini AI, cleans the responses, and logs interactions, ensuring prompt and accurate communication.
About This Workflow
This n8n workflow streamlines your WhatsApp customer support by leveraging the power of AI. Upon receiving a message, it intelligently processes the inquiry using a Google Gemini chat model, drawing information from a provided knowledge base. The AI's response is then meticulously cleaned to ensure a professional and user-friendly format before being sent back to the customer. For comprehensive record-keeping, all interactions are logged in a Google Sheet, including the user's message, the AI's response, and a timestamp. This solution also includes a 24-hour window check to manage conversation flow and sends a pre-approved template message if the conversation is outside this window, ensuring continued engagement.
Key Features
- AI-Powered Responses: Utilizes Google Gemini to understand and answer user questions accurately.
- Intelligent Prompt Preparation: Dynamically crafts prompts with current date, knowledge base content, and user queries.
- Response Cleaning: Automatically formats AI answers, removing markdown and unwanted preamble for clarity.
- 24-Hour Conversation Window: Manages interaction flow by checking message recency.
- Automated Logging: Records all conversations and responses in Google Sheets for audit and analysis.
How To Use
- Configure WhatsApp Trigger: Set up the
when message receivednode with your WhatsApp Business API credentials and webhook. - Integrate Knowledge Base: Ensure your knowledge base content is accessible to the
Prepare Promptnode (e.g., via a Google Sheets or Google Docs node). - Set up AI Model: Configure the
Google Gemini Chat Modelnode with your Gemini API key and desired model settings. - Define Agent Behavior: Customize the
AI Agentnode'ssystemMessageto define its persona and constraints for the[Company]'s support assistant. - Implement Response Cleaning: Review and adjust the
cleanAnswernode's JavaScript code to match your desired output formatting. - Configure Logging: Set up the
Google Sheetsnode with your Google Sheets API credentials and specify the desired columns for logging messages and responses. - Define Logic Branches: Adjust the
Ifnode's conditions to control the flow based on the 24-hour window check and integrate the appropriate WhatsApp sending nodes.
Apps Used
Workflow JSON
{
"id": "a8830edd-30a5-4b40-bb61-db2f52331538",
"name": "Automated WhatsApp Support Agent with AI",
"nodes": 6,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: a8830edd-30a5...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.