how to build a WhatsApp AI agent with n8n and OpenAI

By Catalina Jaramillo · AI Commerce & Revenue Operations Consultant · 2026-11-20

You can launch a self‑servicing WhatsApp AI agent by wiring the WhatsApp Business API, n8n automation, and OpenAI's language model. The workflow captures leads, replies instantly, and pushes data to any CRM without losing prospects.

What accounts and tools do I need?

The core components are a WhatsApp Business API provider, an n8n instance (cloud or self‑hosted), an OpenAI API key, and a CRM that accepts inbound webhooks.

How do I design the n8n workflow?

The workflow is a linear chain that receives a WhatsApp message, sends it to OpenAI, returns the AI answer, and records the interaction in the CRM.

Tell Carolina about your case

Carolina, Catalina's AI agent, reviews your business, shows which system solves it and what it would cost. If there is a fit, she books a call with Catalina.

Tell Carolina about your case →

How do I connect WhatsApp Business API to n8n?

WhatsApp providers push inbound messages to a webhook URL you define. n8n must expose a public HTTPS endpoint that matches the provider’s expectations.

How does OpenAI generate the reply?

OpenAI receives the user message, optional context, and a system prompt that defines the agent’s tone and scope.

How do I push leads to a CRM without losing them?

After the AI reply, the workflow records the interaction as a lead record. The CRM receives a unique identifier, the phone number, the original question, and the AI answer.

Common pitfalls and how to avoid them

Many projects stall because of missing error handling, ambiguous prompts, or compliance gaps.

How Catalina would approach the project

Catalina starts with a strategic diagnosis to map the exact sales funnel, then designs a lightweight n8n prototype that can be measured against baseline metrics.

FAQ

Do I need a developer to set up n8n and OpenAI?

No. n8n’s visual editor lets a technically‑savvy marketer configure the nodes, and the OpenAI request is a simple HTTP call. However, a basic understanding of webhooks and JSON is helpful.

How much does the WhatsApp Business API cost?

Providers charge per message (typically $0.005 – $0.015) and a small monthly fee for the phone number. The exact amount depends on the provider you choose.

Can the AI agent handle multiple languages?

Yes. Include the desired language in the system prompt or detect the language in the Parse node and route the request to the appropriate OpenAI model.

What if the AI gives a wrong answer?

Add a fallback node that detects low confidence (e.g., short or irrelevant replies) and forwards the conversation to a human agent via the CRM task queue.

Is there demand for this solution?

9 of 120 public requests that Carolina analyzed in the last 30 days specifically ask for a WhatsApp AI agent built with n8n and OpenAI.

Tell Carolina about your case

Carolina, Catalina's AI agent, reviews your business, shows which system solves it and what it would cost. If there is a fit, she books a call with Catalina.

Tell Carolina about your case →

More guides