🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

WhatsApp + OpenAI: faster support replies with context

Lisa Granqvist Partner Workflow Automation Expert

Your WhatsApp support inbox moves fast. Too fast. By the time you’ve listened to a voice note, opened a blurry screenshot, and asked “Can you repeat that?”, the customer is already annoyed.

This WhatsApp OpenAI replies automation hits Support Leads first, but ops managers and agency teams handling client DMs feel it too. You get faster replies that stay on-brand, and the assistant actually remembers the conversation so customers don’t have to keep re-explaining.

Below you’ll see how the workflow handles text, voice, images, and PDFs, how it keeps context, and what you need to run it reliably.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: WhatsApp + OpenAI: faster support replies with context

The Problem: WhatsApp Support Gets Messy Fast

WhatsApp support sounds simple until you’re doing it all day. Messages come in as paragraphs, half-finished thoughts, voice notes, and screenshots with tiny text. One customer sends three follow-ups before you even reply to the first. Then your teammate jumps in, doesn’t see the earlier context, and asks the same question again. It’s not just slow. It feels chaotic, and the back-and-forth burns time you should be using to actually solve issues.

None of this is “hard” work. It’s just constant. And that’s why it drags.

  • Voice messages force someone to stop what they’re doing, put on headphones, and listen in real time.
  • Images and PDFs add friction because the customer expects you to “just know” what’s inside them.
  • Context disappears across shifts, which means customers repeat themselves and you look uncoordinated.
  • Manual replies drift off-brand over time, especially when different people are trying to be “helpful” in different ways.

The Solution: Context-Aware WhatsApp Replies, Automatically

This workflow turns incoming WhatsApp messages into clean, consistent replies using OpenAI, while keeping conversation history so responses don’t reset every time. A customer message hits your n8n webhook through the Evolution API node. The workflow marks the message as read, figures out what type of content it is (text, audio, image, or document), then extracts the useful information: audio gets transcribed with Whisper, images get described with a vision-capable model, and PDFs/documents get parsed into text. That normalized input is queued briefly in Redis so multiple back-to-back messages get handled together, not as a messy trickle. Finally, an AI Agent generates the response using memory, formats the reply into one or more sendable blocks, and sends it back through WhatsApp with short pauses between messages so delivery looks natural.

The workflow starts with an incoming WhatsApp webhook and a quick validation step. It then converts whatever the customer sent into plain text, merges recent messages, and generates a contextual reply. Last, it dispatches text (and images if needed), then clears the queue so the next thread starts clean.

What You Get: Automation vs. Results

Example: What This Looks Like

Say your inbox gets about 40 support messages a day, and around 15 of them are voice notes, screenshots, or PDFs. Manually, it’s easy to spend 5 minutes per “weird format” message between listening, opening files, and typing a careful reply, which is about 75 minutes daily. With this workflow, the customer still messages normally, but the assistant handles transcription, extraction, and drafting automatically. You typically spend a minute skimming and approving, so you get roughly an hour back on an average day.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Evolution API to receive/send WhatsApp messages
  • OpenAI for GPT responses, Whisper, and vision
  • Redis connection (get it from your Redis host dashboard)

Skill level: Intermediate. You’ll be comfortable self-hosting n8n and pasting API credentials into the right places.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A WhatsApp message triggers the workflow. Evolution API sends the incoming event to your n8n webhook, then the workflow maps the payload and checks the sender against an allowed list.

The message gets converted into usable text. A switch routes the content type: text is captured directly, audio is converted into a file and transcribed, images are analyzed into a description, and documents are extracted into readable text.

Context is built before the assistant replies. The normalized message is queued in Redis, the workflow waits briefly for more input (because people send “one thought” as three messages), then pulls the queued items and keeps only the latest batch for the response.

OpenAI generates and formats the reply. An AI Agent uses a chat model plus memory to draft a helpful response, then a formatting step splits it into sendable blocks and chooses text vs. image dispatch when needed.

You can easily modify the system prompt to match your brand voice and adjust how long the workflow waits and remembers context based on your support style. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Webhook Trigger

Start by setting up the incoming WhatsApp webhook that receives all messages for the assistant.

  1. Add the Incoming WhatsApp Hook node as the workflow trigger.
  2. Set Path to whatsapp-multimodal.
  3. Set HTTP Method to POST.
  4. Copy the production webhook URL and configure it in your WhatsApp provider.

If you are testing locally, use n8n’s test webhook URL and send a sample payload from your provider.

Step 2: Map and Validate Incoming Messages

Normalize the inbound payload and restrict which senders can access the assistant.

  1. In Map Incoming Payload, keep the assignments that map key fields such as event, instance, remoteJid, messageId, pushName, messageText, and messageType using expressions like {{ $json.body.data.messageType }}.
  2. In Validate Sender List, replace the placeholder [YOUR_EMAIL] with the approved sender ID you want to allow.
  3. In Initial Short Delay, set Amount to 2 seconds to prevent immediate read confirmation.
  4. Configure Flag Message Read to use messageId as {{ $('Map Incoming Payload').item.json.messageId }}, remoteJid as {{ $('Validate Sender List').item.json.remoteJid }}, and instanceName as {{ $('Map Incoming Payload').item.json.instance }}.

⚠️ Common Pitfall: If Validate Sender List doesn’t match your sender ID, the workflow will stop before any AI processing.

Credential Required: Connect your Evolution API credentials for Flag Message Read.

Step 3: Route and Capture Multimodal Inputs

Route messages by type and capture text, audio, image, and document payloads for downstream processing.

  1. In Route by Content Type, keep the rules that map conversation, audioMessage, imageMessage, and documentMessage based on {{ $('Map Incoming Payload').item.json.messageType }}.
  2. In Capture Text Input, set input to {{ $('Map Incoming Payload').item.json.messageText }}.
  3. In Capture Audio Base64, Capture Image Base64, and Capture Document Base64, set data to {{ $('Incoming WhatsApp Hook').item.json.body.data.message.base64 }}.
  4. In Notify Unsupported Type, keep messageText as Sorry, I cannot process this type of message yet. and route to Stop Unsupported Flow.

Credential Required: Connect your Evolution API credentials for Notify Unsupported Type.

Step 4: Convert Media and Extract Text

Convert base64 media to files and extract usable text for the AI assistant.

  1. In Convert Audio File, set Operation to toBinary and Source Property to data.
  2. In Audio Transcription, set Resource to audio and Operation to transcribe, then output to Wrap Audio Text with <audio> tags.
  3. In Convert Image File, set Operation to toBinary and Source Property to data, then pass to Image Description with Text set to Describe this image received via WhatsApp. Be as detailed as possible and transcribe any visible text..
  4. In Convert Document File, set fileName to {{ $('Incoming WhatsApp Hook').item.json.body.data.message.documentMessage.fileName }} and mimeType to {{ $('Incoming WhatsApp Hook').item.json.body.data.message.documentMessage.mimetype }}, then pass to Document Extraction.
  5. In Wrap Image Text and Wrap Document Text, keep the XML-style tags like <image> and <document> wrapping the extracted text.

Credential Required: Connect your OpenAI credentials for Audio Transcription, Image Description, and Document Extraction.

Step 5: Queue Messages and Merge Context

Consolidate multiple rapid messages into a single prompt before sending to the assistant.

  1. In Normalize Input Field, keep input mapped to {{ $json.input }} for all inbound types.
  2. In Enqueue Message, set List to {{ $('Map Incoming Payload').item.json.remoteJid }} and Message Data to {{ $json.input }}.
  3. In Delay for More Input, set Amount to 10 seconds to capture multiple messages.
  4. In Fetch Queued Items, set Key to {{ $('Map Incoming Payload').item.json.remoteJid }} and keep Operation as get.
  5. In Check Latest Message, keep the comparison {{ $json.propertyName.last() }} equals {{ $('Normalize Input Field').item.json.input }} to determine the final message.
  6. In Merge Message List, set finalInput to {{ $json.propertyName.join('\n') }}.

Credential Required: Connect your Redis credentials for Enqueue Message, Fetch Queued Items, and Purge Message Queue.

Step 6: Configure the AI Assistant and Memory

Set up the AI agent, attach the language model, and connect memory for conversational context.

  1. In Assistant Agent, set Text to User message: {{ $json.finalInput }} Current date: {{ $now }} and keep the system message for a friendly assistant.
  2. Open Primary Chat Model and select the model gpt-4o-mini, then ensure it is connected as the language model for Assistant Agent.
  3. In Postgres Memory Store, set tableName to whatsapp_chat_memory, sessionKey to {{ $('Map Incoming Payload').item.json.remoteJid }}, and contextWindowLength to 20.

Credential Required: Connect your OpenAI credentials for Primary Chat Model.

Postgres Memory Store is connected as memory for Assistant Agent—ensure credentials are added to Assistant Agent, not the Postgres Memory Store sub-node.

Step 7: Format and Dispatch WhatsApp Replies

Split the AI response into WhatsApp-friendly chunks and send text or images accordingly.

  1. In Format Reply Blocks, keep Text set to Process the following message: {{ $json.output }} and enable hasOutputParser.
  2. Ensure Secondary Chat Model is connected as the language model for Format Reply Blocks and uses gpt-4o-mini.
  3. Verify Structured JSON Parser has autoFix set to true and jsonSchemaExample to { "respuesta": [] }.
  4. In Split Reply Items, set Field To Split Out to output.respuesta.
  5. In Detect Image Link, keep the three conditions that check {{ $json['output.respuesta'] }} ends with .png, .jpg, or .jpeg.
  6. In Dispatch Text, set messageText to {{ $json['output.respuesta'] }} and keep the delay expression {{ $json['output.respuesta'].length * 60 }}.
  7. In Dispatch Image, set media to {{ $('Iterate Reply Batch').item.json['output.respuesta'] }}.
  8. In Pause Between Sends, set Amount to 2 seconds before looping back to Iterate Reply Batch.

Structured JSON Parser is connected as the output parser for Format Reply Blocks—ensure any required credentials are added to Format Reply Blocks, not the parser sub-node.

Credential Required: Connect your Evolution API credentials for Dispatch Text and Dispatch Image.

Step 8: Test and Activate Your Workflow

Validate the end-to-end flow and then enable it for production use.

  1. Click Test workflow and send a WhatsApp text, audio, image, and document message to the webhook.
  2. Confirm that Normalize Input Field passes content into Enqueue Message and that Merge Message List builds finalInput.
  3. Check that Assistant Agent produces an output and Format Reply Blocks returns a JSON array of respuesta items.
  4. Verify that messages are sent via Dispatch Text or Dispatch Image and that Purge Message Queue clears the Redis list.
  5. When satisfied, toggle the workflow to Active so the webhook runs continuously.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Evolution API credentials can expire or your instance permissions can be off. If things break, check your Evolution API instance status and API key on the server first.
  • If you’re using Wait nodes or external processing, timing varies. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this WhatsApp OpenAI replies automation?

About 60–90 minutes once Evolution API and Redis are running.

Do I need coding skills to automate WhatsApp replies with context?

No. You’ll connect accounts, paste API keys, and edit a few prompts.

Is n8n free to use for this WhatsApp OpenAI replies workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage (many teams spend a few dollars a week at moderate support volume).

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this WhatsApp OpenAI replies workflow for my brand voice and business rules?

Yes, and you should. Update the system prompt in the Assistant Agent to match your tone, disclaimers, and what the bot should never do. You can also adjust the “Delay for More Input” wait time so the assistant responds faster or gathers more context first. If you want the bot to recognize VIP customers, add a lookup step (for example, Google Sheets or Monday.com) before the agent runs. Finally, change the memory retention settings (TTL in Redis and the chat memory node) to match how long your support conversations usually last.

Why is my Evolution API connection failing in this workflow?

Usually it’s an incorrect instance name or an expired API key in your Evolution API credentials. Check that your Evolution API server is reachable from your n8n host, then confirm the webhook URL configured in Evolution API matches your n8n webhook exactly. If it fails only during busy periods, you may be hitting rate limits or your server is underpowered. Also confirm your sender validation rules aren’t accidentally blocking real customers.

How many messages can this WhatsApp OpenAI replies automation handle?

A typical self-hosted setup can handle hundreds of messages per day comfortably, and more if your server is sized well.

Is this WhatsApp OpenAI replies automation better than using Zapier or Make?

Often, yes, because this flow needs branching, short waits, message batching, and memory across messages. Zapier/Make can do parts of it, but keeping context and handling multimodal inputs tends to get clunky and expensive fast. n8n also lets you self-host, which matters here because the Evolution API community node requires it. If your goal is just a simple “auto-reply to one type of message,” Zapier or Make may be fine. If you want a support-grade assistant, n8n is the safer bet, and Talk to an automation expert if you want help choosing.

Support on WhatsApp doesn’t have to mean living in WhatsApp. Set this up once, and the repetitive interpreting, summarizing, and drafting fades into the background.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal