AI WhatsApp Auto Reply with n8n and WOZTELL | Step-by-Step Setup Guide

Build an AI Agent on WhatsApp Using n8n and WOZTELL

Businesses receive the same WhatsApp questions every day: “What’s your price?” “Is this available?” “Where are you located?” “Can you send more details?”

Instead of replying manually every time, you can automate intelligent responses using n8n, WOZTELL, and an AI model like Google Gemini.

This n8n workflow is ideal for teams that need to send WhatsApp template messages to a contact list for campaigns, outreach, or announcements. Suitable for event organisers, marketing, sales, or agencies managing bulk messaging. It reduces response time, saves manpower, and ensures consistent communication, letting humans focus on conversations that actually require human judgment.


What This n8n Workflow Does  

When a customer sends a WhatsApp message:

  1. The webhook receives the message from WOZTELL

  2. The workflow checks whether it qualifies for AI handling

  3. It retrieves recent conversation history

  4. It formats the chat for AI analysis

  5. Google Gemini generates a professional reply

  6. WOZTELL sends the reply back to the customer

This ensures responses are contextual, not generic.


Requirements  

Before starting, make sure you have:

  • An active n8n account

  • A WOZTELL account with a connected WhatsApp channel

  • A Google Gemini API key

Your WhatsApp Business Platform must already be connected inside WOZTELL.


Step 1: Import the n8n Template  

Import the workflow JSON into your n8n workspace.

Once imported, you will see the following nodes:

  • Webhook

  • Filter

  • Get conversation history

  • Edit Fields

  • AI Agent

  • Google Gemini Chat Model

  • Send responses


Step 2: Configure the Webhook  

The Webhook node receives inbound WhatsApp messages from WOZTELL.

After activating the workflow:

  1. Copy the Production URL from the Webhook node

  1. Go to your WOZTELL channel settings and paste the URL into the Inbound Webhook field. Check how to create a webhook in WOZTELL here.

This allows WOZTELL to forward incoming messages to n8n.


Step 3: Filter Valid Messages  

In this step, the filter is already configured and no additional settings are required. The Filter node ensures the AI only responds when appropriate.

It checks three conditions:

  • Event type equals inbound

  • Message type equals text

  • Live chat is not active

If any condition fails, the workflow stops. This prevents:

  • AI replying to media messages

  • AI interfering with live agent conversations

  • AI responding to outbound messages


Step 4: Retrieve Conversation History  

The “Get conversation history by id” node pulls previous messages for context.

It uses the sender’s WhatsApp ID to retrieve up to 100 previous messages from WOZTELL. Without it, AI replies can feel disconnected.

To configure this node:

1. Connect your WOZTELL credentials. To generate the access token, follow the step-by-step guide here.

Generate an access token with these permissions:

    • channel:list

    • channel:getBasicInfo

    • member:getConversations

    • bot:sendResponses

2. For the WOZTELL Channel API field, follow this guide to create a new token. If you have already generated a token, you may reuse it.


Step 5: Format the Conversation for AI  

The “Edit Fields” node prepares the conversation for analysis. No setup is required from your side.

It labels messages as Customer or Agent, combines them into a structured conversation block and passes the formatted conversation to the AI Agent.

This makes the AI understand conversation flow.


Step 6: Generate the AI Reply  

The AI Agent node analyzes the conversation and generates a reply. You can edit it to match your brand voice.

The Google Gemini Chat Model node provides the language model. You must connect your Google Gemini API credentials here. Connect your Google Gemini API ke following the official n8n documentation.

You can switch Google Gemini for another language model provider.


Step 7: Send the Response via WOZTELL  

The final node sends the AI-generated text back to the customer. Since you configured the credentials before, all you need to do now is choose the right credential and channel to connect.

The recipient ID is automatically taken from the inbound message.


Customization Ideas   

You can extend this workflow in many ways:

  • Modify the AI system prompt to match your brand tone and response style

  • Add additional IF nodes for routing logic, keyword detection, or data validation

  • Replace the AI provider with another supported model instead of Google Gemini

  • Customize the WOZTELL message format, tone rules, or response structure

This template is just a foundation, feel free to modify and experiment with it.