Create an AI chatbot for WhatsApp with Whapi.Cloud and OpenAI GPT-3.5
Ready for 3.0What this workflow does
This AI workflow has 28 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI. It also calls gate.whapi.cloud over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- 2️⃣ Get Message Info (Edit Fields (Set)): sets 5 fields: message, chatId, textBody…
- 3️⃣ Ignore Bot's Own Messages (If): checks a condition and branches into true / false
- ✔✔ Mark message as read (HTTP Request): calls an HTTP API (PUT)
- 4️⃣ What Type of Command? (Switch): routes items into 2 branches
- Extract AI Question (Edit Fields (Set)): sets 1 field: aiPrompt
- 5️⃣ Which Number Command? (1-9) (Switch): routes items into 9 branches
- Show Help Menu (Edit Fields (Set)): sets 2 fields: to, body
- Message a model (OpenAI): uses OpenAI
- Prepare: Simple Text (Edit Fields (Set)): sets 2 fields: to, body
- Prepare: Image (Command 2) (Edit Fields (Set)): sets 3 fields: to, caption, mediaPath
…plus 17 more steps. See the full node list below.
Services it uses
HTTP calls to: gate.whapi.cloud
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Switch
n8n-nodes-base.switch - HTTP Request
n8n-nodes-base.httpRequest - OpenAI
@n8n/n8n-nodes-langchain.openAi
From the author
How it works: • Receives WhatsApp messages via webhook from Whapi.Cloud • Routes commands: AI chat (/ai), numeric commands (1-9), or help menu • Sends responses: text, images, documents, videos, contacts, product info • Manages WhatsApp groups: create, send…