Category: Automations › WhatsApp, SMS & Messaging · Best for: Any business that sells over WhatsApp · Platform: n8n · Steps: 11
What it does
An AI answers your customers on WhatsApp day and night, even while you sleep.
The technology that powers this AI Agent-continuously crawling, extracting, and generating answers-incurs real operating costs to stay online.
Works with: WhatsApp, OpenAI, Memory Postgres Chat, Tool HTTP Request, Agent
What you get
- The n8n workflow file (
workflow.json), ready to import - This setup guide
- The list of fields to change for your own accounts (see Install below)
- Email support if you get stuck
Before you start
-
An n8n account. Easiest: n8n Cloud (free trial). Self-host for free with Docker:
docker run -it --rm -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n, then open http://localhost:5678. -
Accounts and API keys for these services:
- OpenAI API key: how to connect (used by OpenAI Chat Model)
- WhatsApp Business Cloud API (Meta): how to connect (used by WhatsApp Trigger, Send Pre-approved Template Message to Reopen the Conversation, Send AI Agent's Answer)
- PostgreSQL database: how to connect (used by Postgres Users Memory)
Install
- In n8n, click Create workflow (top right).
- Click the ⋯ menu → Import from file and choose
workflow.json. Or open the file, copy everything and paste it onto the empty canvas with Ctrl/Cmd + V. - Open each node with a red warning triangle and pick or create the matching credential from the list above.
- Point these fields at your own sheets, chats and accounts:
- Send Pre-approved Template Message to Reopen the Conversation →
phoneNumberId: choose your own - Send Pre-approved Template Message to Reopen the Conversation →
recipientPhoneNumber: choose your own - Send AI Agent's Answer →
phoneNumberId: choose your own - Send AI Agent's Answer →
recipientPhoneNumber: choose your own
- Send Pre-approved Template Message to Reopen the Conversation →
- Click Save.
Test it
- Click Test workflow (or Execute workflow). WhatsApp Trigger starts it. Trigger it once with real sample data.
- Click each node to check its output. A green tick means the step worked.
- Fix any red node: it's almost always a credential or a field that still points at a sheet or chat that isn't yours.
Go live
Toggle Active (top right). From now on it runs on its own. Check Executions in the left sidebar to see every run.
How it works, step by step
- WhatsApp Trigger starts the workflow (WhatsApp).
- OpenAI Chat Model uses AI (OpenAI).
- Postgres Users Memory uses AI (Memory Postgres Chat).
- list_links uses AI (Tool HTTP Request).
- get_page uses AI (Tool HTTP Request).
- AI Agent uses AI (Agent).
- 24-hour window check reshapes the data for the next step.
- If checks a condition and routes items accordingly.
- cleanAnswer reshapes the data for the next step.
- Send Pre-approved Template Message to Reopen the Conversation uses WhatsApp.
- Send AI Agent's Answer uses WhatsApp to send.
India & US notes
India: use the official WhatsApp Business Cloud API from Meta (free to start, pay per conversation). Unofficial WhatsApp tools can get your number banned. US: the same API works; SMS via Twilio is a good fallback.
Extra setup notes
These notes are also on the canvas as yellow sticky notes:
Step by Step Setup Guide
The technology that powers this AI Agent-continuously crawling, extracting, and generating answers-incurs real operating costs to stay online.
That’s why the workflow requires an active membership, priced at only $29 per month. Comparable AI-support platforms charge $150 – $500 each month, so with this template you either save a large chunk of that expense for your own business or earn the same amount by reselling the chatbot to clients-while paying just $29 yourself. And because the bot pulls fresh information from the site in real time, you never have to “re-train” a model, saving you even more time and money.
Activate your membership here: https://lemolex.gumroad.com/l/ejsnx
Let's start setting this up step by step:
Total hands-on time: ≈ 15 minutes
- Activate the tools with the membership generated key:
- Go to the membership link to get your key.
- Copy the key (e.g 6F0E4C97-B72A4E69-A11BF6C4-AF123456) and paste it in the body parameters of list_links and get_page (tools): Name: auth-token Value: 6F0E4C97-B72A4E69-A11BF6C4-AF123456 (example)
- Customize for Your Company:
- Copy the Root URL of your company's website (Home Page).
- Open the AI Agent node and inside the
System Message, change the following values: [Company Name] with your company name (e.g [Company Name] -> Facebook) [https://www.your-company-url.com] with your company Root URL that you copied before. Check for these 2 values along the entire text. - Go back to the tools list_links and get_page and paste the Root URL inside the body parameters, specifically: Name: url *Value: https://www.your-company-url.com (e.g https://www.facebook.com)
- Connect your credentials:
- Go to the OpenAI Chat Model node and connect your OpenAI credentials.
- Go to the Postgres Users Memory node and connect your Supabase credentials. A tutorial for this: https://youtu.be/6w5f_jsPYSQ?si=MPdXYUjxv3fghQPj&t=105 (Minute 1:45 to 5:00)
- Go to the WhatsApp nodes "WhatsApp Trigger", "Send Pre-approved Template Message to Reopen the Conversation" and "Send AI Agent's Answer" to connect your credentials. A tutorial for this: https://youtu.be/ZrhTQle55LQ?si=MO_leooogO9KchCV
- Go to the "Send Pre-approved Template Message to Reopen the Conversation" and select the template message under the "Template" parameter. If you don't want to use this feature (not recommended) delete the nodes "24-hour window check", "If" and "Send Pre-approved Template Message to Reopen the Conversation". Then connect the AI Agent node to the "cleanAnswer" node.
You are ready
Troubleshooting
- "Credentials not found": open the node and select your credential again.
- Google "access blocked": in Google Cloud, add your email as a test user on the OAuth consent screen.
- Webhook not firing: copy the node's Production URL (not Test URL) into the other app, and make sure the workflow is Active.
- AI node errors: check your API key has billing enabled and the model name exists on your plan.
- Nothing happens on schedule: the workflow must be Active, and self-hosted n8n must stay running.
Need help?
Reply to your Morning Method order email and we'll help you get it running.
© Morning Method