Skip to main content

Complete business WhatsApp AI-powered RAG chatbot using OpenAI

Workflow preview

Workflow preview
100%
Complete business WhatsApp AI-powered RAG chatbot using OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

The provided workflow in n8n is designed to create a Business WhatsApp AI RAG (Retrieval Augmented Generation) Chatbot. How it works: 1. Webhook Setup : The workflow begins by setting up webhooks f...

Best for

  • Support Chatbot automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.respondtowebhook, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.vectorstoreqdrant, n8n-nodes-base.httprequest, n8n-nodes-base.googledrive

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Davide.

Original n8n.io source

1.1 Workflow description

Title
Complete business WhatsApp AI-powered RAG chatbot using OpenAI
Workflow name
Complete business WhatsApp AI-powered RAG chatbot using OpenAI

The provided workflow in n8n is designed to create a Business WhatsApp AI RAG (Retrieval-Augmented Generation) Chatbot.


How it works:

  1. Webhook Setup: The workflow begins by setting up webhooks for verification and response. The Verify webhook receives GET requests and sends back a verification code, while the Respond webhook handles incoming POST requests from Meta regarding WhatsApp messages.
  2. Message Handling: Once a message is received, the workflow checks if the incoming JSON contains a user message. If it does, the message is processed further; otherwise, a generic response is sent.
  3. AI Agent Interaction: The user's message is passed to the AI Agent node, which uses a conversational agent with a predefined system message tailored for an electronics store. This ensures that the AI provides accurate and professional responses based on the knowledge base.
  4. Knowledge Base Utilization: The AI Agent references a knowledge base stored in Qdrant, a vector database. Documents from Google Drive are downloaded, vectorized using OpenAI embeddings, and stored in Qdrant for retrieval during conversations.
  5. Response Generation: The AI Agent generates a response using the OpenAI chat model (gpt-4o-mini) and sends it back to the user via WhatsApp.

Set up steps:

  1. Create Qdrant Collection:

    • Update the QDRANTURL and COLLECTION variables in the workflow.
    • Use the Create collection HTTP request node to initialize the collection in Qdrant.
  2. Vectorize Documents:

    • Configure the Get folder and Download Files nodes to fetch documents from a specified Google Drive folder.
    • Use the Embeddings OpenAI node to generate embeddings for the downloaded files.
    • Store the vectorized documents in Qdrant using the Qdrant Vector Store node.
  3. Configure Webhooks:

    • Ensure both Verify and Respond webhooks have the same URL.
    • Set the Verify webhook to use the GET HTTP method and the Respond webhook to use the POST HTTP method.
  4. Set Up AI Agent:

    • Define the system prompt for the AI Agent, specifying guidelines for product information, technical support, customer service, and knowledge base usage.
    • Link the AI Agent to the OpenAI chat model and configure any additional tools as needed.
  5. Test Workflow:

    • Trigger the workflow manually using the When clicking ‘Test workflow’ node to ensure all components are functioning correctly.
    • Monitor the flow of data through the nodes and verify that responses are being generated and sent accurately.

By following these steps, the workflow will be fully operational, enabling a robust AI-powered chatbot capable of handling customer inquiries via WhatsApp.


Need help customizing?

Contact me for consulting and support or add me on Linkedin.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 3 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 5 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 6 - Qdrant Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1

Block 7 - Create collection

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Refresh collection

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Get folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 10 - Download Files

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 11 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.1

Block 12 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 13 - Token Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterTokenSplitter - textSplitterTokenSplitter
Config choices
Version 1

Block 14 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Verify

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 17 - Respond

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 18 - is Message?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 19 - Only message

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 20 - Send

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 21 - Window Buffer Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 22 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 28 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Complete business WhatsApp AI-powered RAG chatbot using OpenAI
Complexity advanced
Nodes 28
Categories Support Chatbot, AI RAG
Author Davide
Published 04 Feb 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2845/2845.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Complete business WhatsApp AI-powered RAG chatbot using OpenAI do?

The provided workflow in n8n is designed to create a Business WhatsApp AI RAG (Retrieval Augmented Generation) Chatbot. How it works: 1. Webhook Setup : The workflow begins by setting up webhooks f...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI RAG use case.