Who is this for?
Businesses and developers who want to automate WhatsApp customer support while continuing to use the same number in the WhatsApp Business mobile app.
This workflow uses WAIA Connect and WhatsApp Coexistence to combine AI replies with human support. When someone replies from the mobile app, the bot automatically pauses for that contact.
What this workflow does
-
Answers incoming text messages using AI and your business instructions.
-
Keeps conversation memory for each contact.
-
Hands conversations over to a person when the customer requests one or the AI cannot answer.
-
Pauses automated replies when you respond from the WhatsApp Business mobile app.
-
Applies business hours and sends an out-of-hours response.
-
Tracks incoming message IDs and uses idempotency keys to reduce duplicate replies.
-
Handles opt-out and opt-in requests.
-
Records sending errors and notifies the owner.
-
Optionally imports recent conversation context from Coexistence history.
The workflow handles non-text messages with a reply asking the customer to send text. It does not transcribe audio or interpret images.
Requirements
-
n8n version 2.3.0 or later.
-
A WAIA Connect account with a connected WhatsApp Business number. Mobile coexistence requires connecting the number in Coexistence mode.
-
A WAIA Connect API key and webhook token.
-
An OpenAI API credential, or an Anthropic credential if you switch to the alternative model.
-
SMTP credentials if you want email notifications.
-
A webhook signing secret to enable signature verification.
The template is free. WAIA Connect, the AI provider, n8n hosting, and applicable Meta messaging charges are separate costs.
How to set up
-
Import the workflow and run Run once: create tables to create the four Data Tables used for deduplication, contacts, errors, and history.
-
Configure the credentials:
-
Connect webhook authentication: Header Auth with
X-Connect-Token. -
Connect API authentication: Header Auth with
Authorizationand your Bearer API key. -
OpenAI or Anthropic.
-
SMTP for email notifications, if used.
-
-
Open the Config node and set your business instructions, opening hours, owner email, and signing secret. Review the conversation pause settings.
-
Activate the workflow and copy the production URL from Connect webhook.
-
Add that URL as a webhook endpoint in WAIA Connect. Subscribe to
message.received,message.echo, andmessage.status. If importing history, also subscribe tohistory.batch,history.completed, andhistory.dropped. -
Test the webhook, then send a message from another phone. Reply from the connected WhatsApp Business mobile app to check that the bot pauses for that conversation.
How it works
Incoming webhook events are authenticated and checked for duplicates. The workflow reads the contact’s state and decides whether to generate an AI reply, hand over to a person, apply business hours, or handle an opt-out.
Replies are sent through the WAIA Connect API. Mobile replies arrive as message.echo events and pause the bot for that contact. Failed delivery events are recorded and trigger a notification rather than a blind retry.
When optional history import is enabled, the workflow stores up to 30 recent messages per contact to provide context for future replies.
Customization
Update businessInstructions to describe your business, services, and preferred response style. Adjust openingHours, notification settings, and the pause duration after human intervention.
You can switch the AI model or replace the memory component with PostgreSQL or Redis for persistent conversation memory.
Important limitations
-
The included AI memory is not persistent across n8n restarts and is not suitable for queue mode.
-
The signing secret is stored in the Config node. Remove it before exporting or sharing a configured copy.
-
WhatsApp notifications to the owner require an approved message template. Email can be used instead.
-
Automatic greeting or away messages from the mobile app may also trigger the bot’s pause behavior; this interaction has not been measured.
-
WhatsApp messaging policies and the 24-hour service window still apply.
Documentation
The full setup guide and workflow download are available here: