How to Build an AI WhatsApp Customer Support Assistant with n8n

This workflow automates customer support via WhatsApp using AI that dynamically crawls your company’s website to answer queries instantly. It saves hours of manual responses and ensures up-to-date, precise information.
WhatsApp Trigger
agent
toolHttpRequest
+7
Workflow Identifier: 1282
NODES in Use: WhatsApp Trigger, AI Agent, list_links, get_page, OpenAI Chat Model, Postgres Users Memory, Code, If, Send Pre-approved Template Message to Reopen the Conversation, Send AI Agent’s Answer
Automate WhatsApp support with n8n and AI agents

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow makes WhatsApp a smart helper to answer customer questions fast. It solves the problem of business owners spending lots of time replying to repeated questions. The workflow uses live website data and AI to give quick and correct answers. Customers get replies in seconds, and businesses save hours daily.

It works by catching WhatsApp messages, finding answers from the website in real time, and sending clean replies back. It also stores chat history to keep conversations natural. This keeps answers fresh as the website changes.


Who Should Use This Workflow

This is good for small or big businesses using WhatsApp to talk with customers. If many people ask similar questions like about products, shipping, or payment, this workflow helps a lot. It cuts down hours spent on simple replies and lowers mistakes. It also works for those who want answers always based on the current website.


Tools and Services Used

  • WhatsApp Business API: gets and sends customer messages.
  • OpenAI GPT-4o-mini: understands questions and helps create good answers.
  • Lemolex API (list_links and get_page tools): finds website links and reads page text.
  • Postgres database: saves chat memory for each customer.
  • n8n automation platform: runs and manages the workflow.

How the Workflow Works: Inputs, Processing, and Output

Inputs

  • Customer sends a message to the business WhatsApp number.
  • Message text and sender info are captured by the WhatsApp Trigger node.

Processing Steps

  • The message text is sent to AI Agent node, which uses AI and website crawling tools to find the best answer.
  • list_links node calls Lemolex API to get internal URLs from the company’s website.
  • get_page node fetches clean text from those URLs for analysis.
  • Postgres Users Memory node keeps the chat history per user to add context.
  • A Code node named cleanAnswer removes markdown and formats the AI reply for WhatsApp.
  • An If node checks if the user contacted within 24 hours to follow WhatsApp rules.
  • Depending on timing, a pre-approved message template node reopens chats or the AI reply is sent.

Output

  • User gets a fast, accurate, and easy-to-read answer to their WhatsApp message.
  • The conversation continues smoothly with stored context.

Beginner Step-by-Step: How to Use This Workflow in n8n

Importing the Workflow

  1. Open the n8n editor.
  2. Download the workflow file using the Download button on this page.
  3. In n8n, choose “Import from File” and upload the downloaded file.

Configuring Credentials and Settings

  1. Enter your WhatsApp Business API OAuth credentials in the WhatsApp Trigger node and message sending nodes.
  2. Set your OpenAI API Key in the OpenAI Chat Model node.
  3. Input the Lemolex API Key in both the list_links node and get_page node.
  4. Provide Postgres database connection details in the Postgres Users Memory node.
  5. Update the system message inside the AI Agent node with your company name and website URL.
  6. Check any IDs, templates, or table names if needed.

Testing and Activating

  1. Send a test WhatsApp message to ensure the workflow triggers and replies correctly.
  2. If all works, turn on the workflow using the toggle at the top right of n8n.
  3. Monitor executions and adjust settings if needed.

For users who prefer more control, consider self-host n8n on your server.


Customizations

  • Change company name and website URL in the AI Agent’s system message to fit your brand.
  • Modify or replace the pre-approved WhatsApp template message to match your style.
  • Adjust how long chat history is kept by changing Postgres retention settings.
  • Pick a different OpenAI model if you want other balances of cost and response quality.

Handling Common Problems

  • If AI Agent returns “Non-subscribed user.”, check your Lemolex API Key is correct and active.
  • If WhatsApp Trigger node doesn’t work, verify the OAuth credentials and try reconnecting.
  • If replies are empty or irrelevant, update company name and URL in the AI Agent node.
  • If get_page node shows 404 errors, ensure URLs are only from your website collected by list_links.

Pre-Production Checklist

  • Confirm all API Keys and credentials for WhatsApp, OpenAI, Lemolex, and Postgres are set.
  • Make sure the AI Agent’s system message has accurate company data.
  • Test sending a WhatsApp message to activate the workflow.
  • Check Postgres database stores chat sessions after test runs.
  • Manually run list_links and get_page nodes and verify correct website data.
  • Verify 24-hour window logic sends proper responses.

Deployment Guide

Turn the workflow from inactive to active in n8n. Make sure all nodes have working credentials before activating.

Once active, the workflow listens to WhatsApp messages and replies automatically. You can watch workflow runs in logs for errors or delays and tune settings as needed.


Summary

✓ This workflow answers WhatsApp queries fast by crawling live website data.

✓ It saves many hours by stopping repetitive manual replies.

✓ Replies are clear, accurate, and always up to date.

→ Businesses get happier customers and less work.

→ Conversations stay natural with stored chat memory.

→ The workflow can be customized for any company or website.


Automate WhatsApp support with n8n and AI agents

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The AI Agent uses the customer’s message and calls the list_links and get_page tools to fetch current website text. Then it processes this info with OpenAI to generate an answer.
Check the WhatsApp Business API OAuth credentials in the WhatsApp Trigger node and reconnect if invalid.
The Postgres Users Memory node saves user chat sessions keyed by WhatsApp user ID to keep context.
404 errors happen if get_page is called with invalid or off-site URLs. Use only URLs fetched by list_links from the company website.
Author
Written By
Ritu Sanjali

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.