AI Customer Support Assistant for WhatsApp (Crawl & Chat) - n8n Workflow

Deploy a powerful AI customer support assistant using this n8n workflow. It crawls your website in real-time using GPT-4o-mini and responds instantly via WhatsApp. Ideal n8n template for B2C.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Businesses needing 24/7, data-accurate customer service.

  • Users looking for a robust n8n template for AI-powered B2C communication.

  • Technical integrators requiring a customized n8n workflow that performs dynamic web crawling.

  • Teams seeking to automate responses via the WhatsApp Business API.

Overview

This advanced n8n workflow provides a comprehensive solution for instant B2C customer support. Instead of relying on static, pre-trained models, this system uses an intelligent n8n agent powered by GPT-4o-mini to actively crawl your live website when a user asks a question. This ensures the answers are always based on the freshest data, such as real-time pricing or inventory status, making this a crucial n8n template for dynamic e-commerce sites. The entire automation is initiated by a WhatsApp message, leveraging the robust WhatsApp Trigger, an essential n8n trigger component. The integration includes critical flow control using an If n8n node to respect the 24-hour WhatsApp messaging window, maintaining compliance while delivering high-quality service. This powerful n8n node combination simplifies complex web crawling and communication tasks, giving you a custom-built solution far superior to typical off-the-shelf chatbots.

How it Works


  1. Trigger Reception: The process begins with the WhatsApp Trigger, an essential n8n trigger, capturing an incoming customer message and extracting the query text and user ID.

  2. AI Orchestration: The message is passed to the AI Agent n8n node. This agent uses the OpenAI Chat Model (GPT-4o-mini) as the LLM, connects to a Postgres Users Memory n8n node for chat history, and is governed by strict system instructions.

  3. Real-Time Crawling: The AI Agent intelligently selects one of two available tools: listlinks to find relevant URLs or getpage to extract the visible, plain text content of a specific page. This dynamic n8n workflow loop continues until an answer is found or limits are reached.

  4. Window Check: Once the AI generates an output, the logic flows into the 24-hour window check n8n node, which verifies if the message timestamp is within the 24-hour WhatsApp response window.

  5. Data Cleaning: Regardless of the time check, the cleanAnswer n8n node meticulously removes any remaining Markdown symbols and converts Markdown links to plain text links, ensuring the final message is clean and compliant.

  6. Response Logic: The If n8n node routes the flow:

If within the window (True path), the clean answer is sent immediately via the Send AI Agent's Answer WhatsApp n8n node.
If outside the window (False path), a Send Pre-approved Template Message to Reopen the Conversation is sent to re-engage the customer while respecting API constraints. This intricate n8n template ensures continuous engagement.

Installation Guide


  1. Import: Import this n8n workflow JSON into your n8n instance.

  2. External Tools Setup: Note that this n8n workflow relies on external web scraping tools (listlinks and getpage) that require a membership/API key. You must replace the auth-token placeholder in both listlinks and getpage parameters with your actual key.

  3. Customization: Open the AI Agent n8n node's System Message and replace [Company Name] and https://www.your-company-url.com with your actual business details. Repeat this for the url parameter in the listlinks and getpage tools.

  4. Credential Setup: Connect credentials for the following services:

OpenAI Chat Model (using a valid API key).
Postgres Users Memory (used for session history; requires a Supabase or similar Postgres connection).
* All three WhatsApp nodes (WhatsApp Trigger, Send Pre-approved Template Message, and Send AI Agent's Answer) require your WhatsApp Business API credentials.

  1. Template Selection: In the Send Pre-approved Template Message n8n node, select the appropriate pre-approved template you wish to use for re-engagement.

Node Details

WhatsApp Trigger


  • Function: The initiating n8n trigger. It listens for incoming messages on the configured WhatsApp webhook.

  • Key Configuration: Uses the updates: [messages] setting.

AI Agent (LangChain)


  • Function: The central processing n8n node. It orchestrates the LLM interaction, tool use, and memory retention to generate the customer answer.

  • Key Configuration: Input is the message body. Utilizes gpt-4o-mini via the linked LLM n8n node. System message contains the precise search strategy and strict output formatting rules (no markdown, quoting facts).

listlinks & getpage (ToolHttpRequest)


  • Function: These are the crucial web scraping tools used by the AI Agent to crawl the site in real-time. They are connected to external webhooks to perform the fetching.

  • Key Configuration: Both require an external auth-token and the target website's root url set in the body parameters.

Postgres Users Memory


  • Function: Provides conversational memory to the AI Agent, allowing the chatbot to reference previous parts of the conversation.

  • Key Configuration: Uses the WhatsApp user's wa_id as the unique sessionKey.

cleanAnswer (Code)


  • Function: A critical JavaScript n8n node that standardizes the AI output, stripping all Markdown symbols (like bold or italics) and converting Markdown links to simple text + URL format, ensuring clean delivery over WhatsApp.

24-hour window check (Code) & If


  • Function: Checks the timestamp of the incoming message against the current time to determine if the conversation is still within the 24-hour allowed messaging window as enforced by WhatsApp. The If n8n node then controls the flow.

WhatsApp (Send AI Agent's Answer)


  • Function: Sends the final, cleaned response generated by the AI back to the user.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Passionate about AI-driven automation, LLMs, and intelligent systems that enhance efficiency and engagement. Let’s build smarter workflows, send me a message!

Featured*