Skip to content
Back to Blog

How To Build An AI WhatsApp Agent In Minutes Using N8n Wassenger And OpenAI

šŸ’¬ ā€œWhat if every WhatsApp message could be answered instantly, 24/7, with natural AI-generated replies?ā€ Ā Spoiler alert: You don’t need a developer team—just a few clicks in n8n, a Wassenger account, and OpenAI.

🤩 šŸ¤– Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

Requirements

Important! šŸ’¬ If you’re new to using n8n with Wassenger, check out our setup guide to get started quickly.

Now, let’s create our new AI ChatBot! šŸ¤–

1. Create a new Workflow onĀ n8n

Within the n8n interface, go to ā€˜Workflows’ and click ā€˜Create Workflow’

how to build an ai whatsapp agent in minute

2. Connect the Wassenger Trigger

Okay, now that we are inside our new Workflow, we are going to create the connection with Wassenger in the following way:

Click on ā€˜Add first step’

how to build an ai whatsapp agent in minute

Then search for ā€œWassengerā€. Remember, you need to install the Wassenger node first. If you haven’t done it yet, check out our related article here.

how to build an ai whatsapp agent in minute

Then select the ā€˜On new inbound message received’ trigger

how to build an ai whatsapp agent in minute

A window like this will open

how to build an ai whatsapp agent in minute

Now, we need to add our Wassenger API credentials to connect n8n with Wassenger:

  1. Go to the API key page in Wassenger and copy the given API key or create one

how to build an ai whatsapp agent in minute

2. And copy it into the n8n trigger

how to build an ai whatsapp agent in minutehow to build an ai whatsapp agent in minute

🤩 šŸ¤– Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

Then, select the connected WhatsApp number on Wassenger you want to trigger the event from and go back to your canvas

how to build an ai whatsapp agent in minute

3. Connect the Advanced AIĀ node

Now we need to connect the node that will allow us to build autonomous agents, summarize or search documents

how to build an ai whatsapp agent in minute

Next

how to build an ai whatsapp agent in minute

And a window like this will show up

how to build an ai whatsapp agent in minute

We will leave this for now to get back to our canvas to add our Open AI node, where the magic happens!

4. Connect the OpenAI chatĀ Model

how to build an ai whatsapp agent in minute

A window like this will open, and we will insert our OpenAI credentials

how to build an ai whatsapp agent in minute

Create an OpenAI account and find your credentials here

how to build an ai whatsapp agent in minute

Then add it to n8n

how to build an ai whatsapp agent in minute

5. Add the memoryĀ node

The Memory node allows an AI model to remember and reference past interactions with it, and no credentials are required since it is stored within n8n

how to build an ai whatsapp agent in minute

Extend the ā€˜Context Window Length’ to 10

how to build an ai whatsapp agent in minute

🤩 šŸ¤– Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

6. Connect your Wassenger Webhook toĀ n8n

Now, for n8n to receive all message notifications when a contact texts you, we need to set up a new webhook

  1. Go to the Webhooks page here
  2. Create a new Webhook

how to build an ai whatsapp agent in minute

Then

how to build an ai whatsapp agent in minute

  1. Name your webhook
  2. Add the webhook URL that you will find in the first node we created in n8n

how to build an ai whatsapp agent in minutehow to build an ai whatsapp agent in minute

3. Select the number you want to transfer messages from

4. Select the event message:in:new

5. Save your new Webhook in Wassenger

7. Test your firstĀ message

Now, we will click on ā€˜Test step’ on n8n to retrieve the given data from Wassenger and complete the whole process for the automatization:

how to build an ai whatsapp agent in minute

After that, you can try sending a message to your WhatsApp number from another available number.

how to build an ai whatsapp agent in minute

Then your n8n node will receive your message and contact information that we will use to configure the rest of the workflow

how to build an ai whatsapp agent in minute

🤩 šŸ¤– Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

8. Configure the AI Agent with the dynamic retrieved data

Open the AI Agent node we added previously

how to build an ai whatsapp agent in minute

Then

  1. Select the Source for Prompt (User Message) as Define Below
  2. Use the ā€˜body’ field to reference the incoming message within the Prompt so that n8n always references the correct data. (Drag the element onto the input.)

If you can’t see the data tree, click ā€˜Execute previous nodes’ and send a new message to your WhatsApp number.

how to build an ai whatsapp agent in minute

Now that we have completed our AI agent configuration, let’s see the Memory node

9. Add the Wassenger Message ResponseĀ Node

Now, we will add the node that will send the AI-created message to your end WhatsApp customers

how to build an ai whatsapp agent in minute

Select ā€˜Send a Text Message’

how to build an ai whatsapp agent in minute

And a window like this will show up

how to build an ai whatsapp agent in minute

Then, we can click on ā€˜Execute previous nodes’** to show the message information again and proceed as follows

  1. Select the number ID provided by Wassenger to determine the number used to send the AI response
  2. The target phone number we are sending the AI-generated response
  3. The output message generated by our OpenAI node, based on the question we received from the customer

how to build an ai whatsapp agent in minute

šŸŽ‰ You’re All Set to Launch Your AIĀ ChatBot!

Now that everything’s in place, you can see your chatbot in action. For example:

šŸ‘¤ Customer sends a message

how to build an ai whatsapp agent in minut

šŸ¤– n8n processes it and replies instantly using AI

how to build an ai whatsapp agent in minute

Check out more visual content of how the workflow should behave

how to build an ai whatsapp agent in minutehow to build an ai whatsapp agent in minute

From here, you can continue building smarter, more personalized automations. Whether it’s handling FAQs, guiding users, or providing 24/7 support, the possibilities are endless.

šŸš€ Ready to bring your WhatsApp communication to the next level? 🤩 šŸ¤– Wassenger is your complete API solution for WhatsApp. Ā šŸ‘‰ Start your 7-day free trial today and get up and running in minutes!

Ready to transform your WhatsApp communication?

Start automating your customer interactions today with Wassenger.

Browse more

Tutorials, guides and case studies on running WhatsApp at team scale.

Ready for the official WhatsApp Business API?See what Meta charges — and keep your current number.
WhatsApp API pricing