n8n workflow template · 18 nodes · WhatsApp Business Cloud
Building Your First WhatsApp Chatbot is a free n8n workflow template that starts from the WhatsApp Business Cloud Trigger node and works with WhatsApp Business Cloud and OpenAI. It has 18 nodes, 11 of them AI nodes (OpenAI Chat Model, Window Buffer Memory, Vector Store Question Answer Tool and OpenAI Embeddings). The notes inside the workflow say: “Join the Discord or ask in the Forum!” To run it, you add your own credentials for OpenAI API, Whats App Trigger API and WhatsApp Business Cloud API.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
Join the Discord or ask in the Forum!
Read more about the HTTP Request Tool
Import your marketing PDF document to build your vector store. This will be used as the knowledgebase by the Sales AI Agent.
For this demonstration, we'll use the HTTP request node to import the YAMAHA POWERED LOUDSPEAKERS 2024 brochure (Source) and an Extract from File node to extract the text contents.
Run this step to populate our product catalogue vector. Run again if you want to update the vector store with a new version.
Read more about the In-Memory Vector Store
Vector stores are powerful databases which serve the purpose of matching a user's questions to relevant parts of a document. By creating a vector store of our product catalog, we'll allow users to query using natural language.
To keep things simple, we'll use the In-memory Vector Store which comes built-in to n8n and doesn't require a separate service. For production deployments, I'd recommend replacing the in-memory vector store with either Qdrant or Pinecone.
To start using the WhatsApp chatbot, you'll need to activate the workflow. If you are self-hosting ensure WhatsApp is able to connect to your server.
For non-text messages, we'll just reply with a simple message to inform the sender.
Check out my other WhatsApp template in my creator page!
Learn more about using AI Agents
n8n's AI agents are powerful nodes which make it incredibly easy to use state-of-the-art AI in your workflows. Not only do they have the ability to remember conversations per individual customer but also tap into resources such as our product catalogue vector store to pull factual information and data for every question.
In this demonstration, we use an AI agent which is directed to help the user navigate the product brochure. A Chat memory subnode is attached to identify and keep track of the customer session. A Vector store tool is added to allow the Agent to tap into the product catalogue knowledgebase we built earlier.
Learn more about the WhatsApp Node
The WhatsApp node is the go-to if you want to interact with WhatsApp users. With this node, you can send text, images, audio and video messages as well as use your WhatsApp message templates.
Here, we'll keep it simple by replying with a text message which is the output of the AI agent.
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
Learn more about the WhatsApp Trigger
The WhatsApp Trigger allows you to receive incoming WhatsApp messages from customers. It requires a bit of setup so remember to follow the documentation carefully! Once ready however, it's quite easy to build powerful workflows which are easily accessible to users.
Note that WhatsApp can send many message types such as audio and video so in this demonstration, we'll filter them out and just accept the text messages.
The 18 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
Do you need somewhere to run it? Read our guide to self-hosted n8n.
We can adapt this workflow to your apps, data and process, then deploy and support it.
Contact Us