n8n Templates

n8n WhatsApp Chatbot Template: Build a Sales Agent From Your Product PDF

A walkthrough of n8n's WhatsApp sales chatbot template: the services you connect, the Yamaha-specific settings you must replace, and the limits you will hit in production.

"Building your first WhatsApp chatbot" by n8n creator jimleuk has more than 540,000 views on n8n.io. It turns a product brochure PDF into a sales assistant that answers customer questions on WhatsApp. The sample data is a Yamaha loudspeaker catalogue, and that detail sits in several places in the workflow. Miss one and your chatbot starts selling speakers.

What the template does

The workflow has two parts on one canvas.

Part one builds the knowledge base. An HTTP Request node downloads a PDF, an Extract from File node pulls out the text, and a text splitter cuts it into chunks. OpenAI's text-embedding-3-small model turns each chunk into a vector, and an in-memory vector store holds them. You run this part by hand, once.

Part two answers customers. A WhatsApp Trigger receives incoming messages. A Switch node separates text from everything else. Text goes to an AI Sales Agent running gpt-4o-2024-08-06, which queries the vector store through a tool and replies with a WhatsApp node. Voice notes, images, and other message types get a fixed reply asking for text.

Services to connect

What to change after you copy it

1. Replace the brochure

The "get Product Brochure" node points at a Yamaha PDF URL. Change it to your own catalogue, price list, or FAQ document. If the file sits on your machine, swap the HTTP Request node for a Read Binary File or Google Drive node. Text-based PDFs work. Scanned image PDFs need OCR first, or the extracted text will be empty.

2. Rewrite the system message

The AI Sales Agent's prompt names Yamaha Powered Loudspeakers and the 2024 catalogue. Replace the company, the product line, and the year. Spell out what the agent may promise, what it must never quote, and where it sends buyers who want a human. The template tells the agent not to push a sale, so change that line if selling is the point.

3. Fix the tool description

The Vector Store Tool is named query_product_brochure and described as "valid for the year 2024". The agent reads that description to decide when to call the tool. Rename it and describe your own content, or the agent may skip the tool.

4. Change the phone number ID

Both WhatsApp reply nodes carry the template author's phone number ID. Set the Phone Number ID in each one to the ID from your own Meta WhatsApp app, or the replies fail.

5. Rename the vector store key

Chat memory is already separate for each customer, because the Window Buffer Memory node builds its session key from the sender's WhatsApp number. The vector store uses the fixed key whatsapp-75 in both the build node and the query node. The two must match. Rename them to something that describes your catalogue. This matters if you run more than one bot on the same n8n instance, since in-memory stores that share a key share data.

6. Move off the in-memory vector store

The in-memory store disappears when n8n restarts, and you must rebuild it by hand. The template author recommends Qdrant for production. Pinecone, Supabase, and Postgres with pgvector also work. You swap the vector store node in both the build step and the query step, and the rest of the canvas stays.

Use cases

Watch the 24-hour window. WhatsApp lets a business send free-form replies only within 24 hours of the customer's last message. Anything later needs a pre-approved message template. The sales agent replies in real time, so the window stays open. It closes on you the moment you add follow-up messages. Check Meta's current messaging rules before you build those.

Common questions

Do I need a Meta business verification to try it?

You can test with the sandbox number Meta provides to every developer app, and send to up to five verified recipients. Business verification matters once you want your own number and wider use.

Can the bot hand a chat to a person?

Not in the template. Add an IF node that checks the agent's output or the customer's message for a handoff request, then send a Slack, email, or Telegram alert with the customer's number and a link to the conversation.

What happens when a customer sends a voice note?

The Switch node catches non-text messages and sends a canned reply asking for text. The same author has a second template that handles audio and images. Transcribing voice with OpenAI's speech-to-text node is a short addition.

Want this built and maintained for you?

Tell us which workflow you need. We set up the credentials, adapt the template to your business, and document it so your team can run it.

Start a Project →