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
- Open the n8n editor.
- Download the workflow file using the Download button on this page.
- In n8n, choose “Import from File” and upload the downloaded file.
Configuring Credentials and Settings
- Enter your WhatsApp Business API OAuth credentials in the WhatsApp Trigger node and message sending nodes.
- Set your OpenAI API Key in the OpenAI Chat Model node.
- Input the Lemolex API Key in both the list_links node and get_page node.
- Provide Postgres database connection details in the Postgres Users Memory node.
- Update the system message inside the AI Agent node with your company name and website URL.
- Check any IDs, templates, or table names if needed.
Testing and Activating
- Send a test WhatsApp message to ensure the workflow triggers and replies correctly.
- If all works, turn on the workflow using the toggle at the top right of n8n.
- 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.
