n8n

How to Automate WhatsApp Website Support with Live Site Search?

Turn WhatsApp into a smart website assistant that answers customer questions in real time. It reads your site, finds the right page, and sends a clear reply back in chat. Great for support teams that want faster answers without extra staff.

Incoming messages start in WhatsApp and are passed to an AI agent that uses the OpenAI chat model. The agent has two tools. One tool lists up to 100 internal links from your site, and the other fetches the full text of any page. It uses this fresh content to build the answer. A Postgres memory stores chat history by phone number so the agent keeps context across messages. A code step checks the 24 hour rule. If the window is closed, a pre approved template message reopens the chat. A clean up step removes markdown so the final message is easy to read. Then the reply is sent back to WhatsApp.

Setup needs WhatsApp Business access, an OpenAI API key, a Postgres database, and an auth token for the crawl tools. Expect shorter first response times and fewer tickets, since common questions are handled by the bot. Use it for product FAQs, policies, pricing, or store info pulled straight from your site, all without retraining.

What are the key features?

  • WhatsApp trigger captures incoming customer messages instantly.
  • OpenAI chat model drives the assistant to produce clear and helpful replies.
  • Link listing tool returns up to 100 internal URLs to guide the agent to the right pages.
  • Page fetch tool pulls full plain text from any site page for accurate answers.
  • Postgres memory stores message history by phone number in the message_history table.
  • Code step checks if the last customer message is within 24 hours and routes the flow.
  • Template sender reopens closed conversations with a pre approved WhatsApp template.
  • Clean answer step removes markdown and link formatting for readable chat messages.
  • System message is easy to customize with your company name and site URL.

What are the benefits?

  • Reduce first response time to under 10 seconds for common questions
  • Automate up to 70 percent of repetitive support replies
  • Follow the WhatsApp 24 hour rule automatically with a template message
  • Use live site content so answers are always up to date without retraining
  • Keep context across chats with per user memory to improve accuracy
  • Handle 5 times more conversations without adding headcount

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with WhatsApp, OpenAI and PostgreSQL. See the Tools Required section above for links to create accounts with these services.
  3. Open the WhatsApp Trigger node and the two WhatsApp send nodes. In the Credential to connect with dropdown, click Create new credential, then follow the on screen steps to connect your WhatsApp Business account. Confirm the phone number ID matches your sender number.
  4. Open the OpenAI Chat Model node. In the credentials dropdown, click Create new credential and paste your OpenAI API key from the OpenAI dashboard. Save and test a simple prompt in the node if needed.
  5. Open the Postgres Users Memory node. Create a new PostgreSQL credential with host, port, database, user, and password. Use your Supabase or Postgres values. Ensure the message_history table exists with suitable columns.
  6. Open the list_links and get_page tool nodes. In the body parameters, add your auth token value and confirm the url field points to your website root. Save the nodes.
  7. Open the AI Agent node. In the system message, replace the company name and root URL with your own. Keep the tool names as they are so the agent can call them.
  8. Open the Send Pre approved Template Message to Reopen the Conversation node and choose your approved template from the Template field. Make sure the language matches your account.
  9. Check the 24 hour window code node and the If node. No edits are required, but you can adjust the cutoff in milliseconds if your policy changes.
  10. Run a live test. Send a WhatsApp message to your business number. In n8n, watch the execution. If the last message was older than 24 hours, you should see the template message go out before the AI reply.
  11. Verify memory. After a few messages, query the message_history table and confirm new rows are written with the correct session key based on the WhatsApp user ID.
  12. Troubleshoot common issues: if no trigger fires, recheck WhatsApp webhook setup; if answers are empty, confirm the auth token and that your site allows fetching; if messages fail to send, confirm the phone number ID and template approval; if the agent rambles, reduce max iterations in the AI Agent options.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

PostgreSQL

Sign up

Free: $0 (open-source PostgreSQL License; self-hosted)

WhatsApp

Sign up

Service conversations: $0 (free; unlimited since Nov 1, 2024)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.