Veni AI
Back to templates
WORKFLOW TEMPLATE

Whatsapp Trigger | Operations n8n Workflow Template with HTTP

Ready-to-import n8n workflow JSON for Whatsapp Trigger. 16 nodes. Integrations: HTTP. Copy and import into n8n.

16 nodesWhatsapp_Trigger-workflow.json
{
"meta": {
"instanceId": "73e3c0fd395bfd0d194601f37f29fe40e0317103ab5899d92df39eaef2eb4c87",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "ab7c3125-5bfd-4f3c-8abc-0ab47edaf85b",
"name": "WhatsApp Trigger",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
-656,
-48
],
"webhookId": "d3978cae-2aca-4553-8ac7-ab89068deabc",
"parameters": {
"options": {},
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"id": "7Mwcvp64huTkZ2uy",
"name": "Testing"
}
},
"typeVersion": 1
},
{
"id": "07fcf5e2-04ae-4f4a-a440-093f18a1e55e",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1536,
-48
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "=# WhatsApp Customer Support Agent - Sycorda AI Assistant\n\n#call Get a document in Google Docs to get details of Sycorda\n\n## Core Identity\nYou are a professional customer support representative for sycorda. You communicate through WhatsApp with customers ZZZzseeking information about our services and solutions.\n\n## Communication Context\n- **Current User**: {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}\n- **Timestamp**: {{ $now.toString() }}\n- **Platform**: WhatsApp Business API\n\n## Primary Directive\nYour sole purpose is to provide accurate information about Sycorda by retrieving relevant details from the Google Doc knowledge base. You must ONLY answer based on documented information - never fabricate or assume details.\n\n## Language Protocol\n\n### Language Detection & Response Rules\n1. **English Input** → Respond in English\n2. **Urdu Input** → Respond in Roman Urdu\n3. **Voice Notes**: Transcribe first, then apply language matching\n4. **Images**: Acknowledge receipt, extract text if present, respond accordingly\n\n### Roman Urdu Guidelines\n- Write naturally: \"Aap ka sawal ka jawab yeh hai\" NOT \"Āp kā sawāl kā jawāb yah hai\"\n- Use common spellings: \"kya\", \"kaise\", \"theek\", \"shukriya\"\n- Avoid diacritical marks and special characters\n- Match casual WhatsApp conversation style\n\n## Response Framework\n\n### Tone Requirements\n- **Laconic**: Maximum 2-3 sentences per response unless complex explanation needed\n- **Spartan**: Direct, no fluff, no unnecessary pleasantries\n- **Human**: Natural conversational flow, not robotic\n\n### Response Structure\n1. **Acknowledge** (if needed): Brief recognition of query\n2. **Answer**: Direct information from knowledge base\n3. **Clarify** (if needed): One follow-up question maximum\n\n## Tool Integration Protocol\n\n### Google Doc Access\nWhen user asks a question:\n1. Parse query for key terms\n2. Search Google Doc for relevant section\n3. Extract specific answer\n4. Reformulate in appropriate language/tone\n5. Deliver response\n\n### Information Retrieval Rules\n- ONLY use information present in Google Doc\n- If information not found: \"Is baare mein mujhe docs mein info nahi mili. Kya aap kuch aur puchna chahte hain?\" (Roman Urdu) or \"I couldn't find this information in our documentation. Would you like to know something else?\" (English)\n- Never guess or provide generic responses\n\n## Message Type Handlers\n\n### Text Messages\n\n\nDirect query → Search Doc → Concise Answer\n\n\n### Voice Notes\n\n\nTranscribe → Detect Language → Search Doc → Reply in same language\n\n\n### Images\n\n\nAcknowledge → Extract text/context → Process as text query\n\n\n## Example Interactions\n\n### English Example\n**User**: \"What services does sycorda offer?\"\n**Agent**: \"Sycorda provides [specific services from doc]. We specialize in [main specialty from doc].\"\n\n### Roman Urdu Example\n**User**: \"Sycordar ki fees kya hai?\"\n**Agent**: \"Hamari fees [doc se specific amount] hai. Payment monthly ya project basis pe ho sakti hai.\"\n\n### Mixed Context Example\n**User sends voice note in Urdu asking about contact**\n**Agent**: \"Aap humse [contact info from doc] pe rabta kar sakte hain. Office timings [timings from doc] hain.\"\n\n## Error Handling\n\n### Information Not Found\n- English: \"I don't have that specific information. Can I help with something else?\"\n- Roman Urdu: \"Yeh info mere paas nahi hai. Kuch aur puch sakte hain?\"\n\n### Unclear Query\n- English: \"Could you clarify what you need to know about [topic]?\"\n- Roman Urdu: \"[topic] ke baare mein kya janna chahte hain?\"\n\n## Constraints\n1. NEVER provide information not in the Google Doc\n2. NEVER use formal Urdu script or complex transliterations\n3. NEVER exceed 3 sentences unless absolutely necessary\n4. NEVER sound like an automated bot\n5. ALWAYS maintain consistent tone throughout conversation\n\n## Performance Metrics\n- Response accuracy: 100% from documented sources\n- Response brevity: <50 words average\n- Language matching: 100% accuracy\n- Human-like interaction: Natural flow maintained"
},
"promptType": "define"
},
"retryOnFail": true,
"typeVersion": 1.9
},
{
"id": "ff32e635-cabc-451a-8ec8-7d740996f3b5",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1600,
176
],
"parameters": {
"sessionKey": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}",
"sessionIdType": "customKey",
"contextWindowLength": 20
},
"typeVersion": 1.3
},
{
"id": "212f1042-a90e-4e91-9660-97dac9dcbc7b",
"name": "Check Input Type",
"type": "n8n-nodes-base.switch",
"position": [
-192,
-64
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Voice",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b7b64446-f1ea-4622-990c-22f3999a8269",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.messages[0].audio }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "Image",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "202af928-a324-411a-bf15-68a349e7bf9e",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.messages[0].image }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "Text",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "08fd0c80-307e-4f45-b1de-35192ee4ec5e",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.messages[0].text.body }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "4d6c41e6-4f24-49b4-a27c-78ee4f0dab70",
"name": "Get Image URL",
"type": "n8n-nodes-base.whatsApp",
"position": [
416,
80
],
"webhookId": "280bd5de-32d7-4d8f-93d2-e91e3b0bc161",
"parameters": {
"resource": "media",
"operation": "mediaUrlGet",
"mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].image.id }}"
},
"credentials": {
"whatsAppApi": {
"id": "Cn5rvhEVVyM1FmpR",
"name": "Testing"
}
},
"typeVersion": 1
},
{
"id": "9257518f-7e4d-4734-8afd-ea70982ea76c",
"name": "Download Image",
"type": "n8n-nodes-base.httpRequest",
"position": [
576,
80
],
"parameters": {
"url": "={{ $json.url }}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "D2UYEol2VnjX6ZVV",
"name": "Header Auth account"
}
},
"typeVersion": 4.2
},
{
"id": "a518322c-525a-47a8-a11a-37d50fdc5c88",
"name": "Analyze Image",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
736,
80
],
"parameters": {
"text": "=Describe the image in detail.",
"modelId": {
"__rl": true,
"mode": "list",
"value": "chatgpt-4o-latest",
"cachedResultName": "CHATGPT-4O-LATEST"
},
"options": {},
"resource": "image",
"inputType": "base64",
"operation": "analyze"
},
"credentials": {
"openAiApi": {
"id": "kcZxf0FA03D9xVdd",
"name": "Sycorda"
}
},
"typeVersion": 1.8
},
{
"id": "c96a91dc-1f91-49db-9278-2a3393f1a6ad",
"name": "Image + Text Prompt",
"type": "n8n-nodes-base.set",
"position": [
896,
80
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "67552183-de2e-494a-878e-c2948e8cb6bb",
"name": "text",
"type": "string",
"value": "=# The user provided the following image and text.\n\n## IMAGE CONTENT:\n{{ $json.content }}\n\n## USER MESSAGE:\n{{ $('WhatsApp Trigger').item.json.messages[0].image.caption || \"Describe the image\" }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c7c85070-4c64-469d-af59-4d71cb582386",
"name": "Text Only Prompt",
"type": "n8n-nodes-base.set",
"position": [
624,
368
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c05a7fbf-309a-407e-9fee-7e0b03f4a5c8",
"name": "text",
"type": "string",
"value": "={{ $('WhatsApp Trigger').item.json.messages[0].text.body }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "37afcfdc-29d9-49bb-a259-c714862345bc",
"name": "Get Audio URL",
"type": "n8n-nodes-base.whatsApp",
"position": [
416,
-192
],
"webhookId": "87caa300-7204-47b5-959a-94f4a8fbf8cf",
"parameters": {
"resource": "media",
"operation": "mediaUrlGet",
"mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].audio.id }}"
},
"credentials": {
"whatsAppApi": {
"id": "Cn5rvhEVVyM1FmpR",
"name": "Testing"
}
},
"typeVersion": 1
},
{
"id": "0bae0627-5109-4fc4-825b-4b49287cdd25",
"name": "Download Audio",
"type": "n8n-nodes-base.httpRequest",
"position": [
576,
-192
],
"parameters": {
"url": "={{ $json.url }}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "D2UYEol2VnjX6ZVV",
"name": "Header Auth account"
}
},
"typeVersion": 4.2
},
{
"id": "261d1bd3-76c4-436e-ae62-501d3c967cab",
"name": "Transcribe Audio",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
736,
-192
],
"parameters": {
"options": {},
"resource": "audio",
"operation": "transcribe"
},
"credentials": {
"openAiApi": {
"id": "kcZxf0FA03D9xVdd",
"name": "Sycorda"
}
},
"typeVersion": 1.8
},
{
"id": "6af95a0a-c27a-4b47-abe7-3e128d96284a",
"name": "Audio Prompt",
"type": "n8n-nodes-base.set",
"position": [
896,
-192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "219577d5-b028-48fc-90be-980f4171ab68",
"name": "text",
"type": "string",
"value": "={{ $json.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1d0c8c18-3bba-49fd-a929-cf9465ff23c1",
"name": "Respond with Text",
"type": "n8n-nodes-base.whatsApp",
"position": [
2160,
-48
],
"webhookId": "23834751-5066-48ba-8e19-549680df2b27",
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"phoneNumberId": "678239212037057",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"id": "Cn5rvhEVVyM1FmpR",
"name": "Testing"
}
},
"typeVersion": 1
},
{
"id": "174655ca-43ba-46cd-805c-a3f645b83e87",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
288,
-272
],
"parameters": {
"width": 800,
"height": 240,
"content": "## Audio"
},
"typeVersion": 1
},
{
"id": "8aa8cb04-10be-4e89-a8a3-ef7356c80d59",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
288,
0
],
"parameters": {
"color": 4,
"width": 800,
"height": 280,
"content": "## Image & Text"
},
"typeVersion": 1
},
{
"id": "e6b85721-39a8-4377-9347-7d17da22adaa",
"name": "Get a document in Google Docs",
"type": "n8n-nodes-base.googleDocsTool",
"position": [
1792,
176
],
"parameters": {
"operation": "get",
"documentURL": "1H9ZBePkINDHi2c-IfsxRaVjF5iiGkwimxgJLICyGZco"
},
"credentials": {
"googleDocsOAuth2Api": {
"id": "E0shoKK417yJ5FNV",
"name": "Working sycorda"
}
},
"typeVersion": 2
},
{
"id": "e0c0f236-b08f-44a0-9efa-89668d005040",
"name": "OpenRouter Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
1392,
144
],
"parameters": {
"model": "anthropic/claude-sonnet-4",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "quUHCZdxn2JgpCAH",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "ff3ec81a-242f-4c30-bc9d-a03f170890d1",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-832,
-336
],
"parameters": {
"width": 624,
"height": 208,
"content": "STEP 1: WhatsApp Message Reception & Input Classification\nReceives incoming WhatsApp messages and intelligently categorizes them by media type to route processing appropriately.\nKey Components:\n* WhatsApp Trigger - Listens for incoming messages via webhook\n* Check Input Type (Switch) - Routes messages based on content type (voice, image, text)\n* Message routing logic - Directs flow to appropriate processing pipeline"
},
"typeVersion": 1
},
{
"id": "97e920ae-71f8-4ece-8384-971c25745108",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
-480
],
"parameters": {
"width": 512,
"height": 176,
"content": "STEP 2: Multi-Modal Content Processing\nProcesses different types of media content (audio, images, text) and converts them into standardized text format for AI analysis.\nKey Components:\n* Get Audio/Image URL - Retrieves media file URLs from WhatsApp API\n* Download Audio/Image - Fetches actual media files using authenticated requests\n* Transcribe Audio (OpenAI) - Converts voice messages to text using Whisper\n* Analyze Image (GPT-4V) - Describes image content in detail\n* Content Prompt Formatters - Structures processed content for AI agent"
},
"typeVersion": 1
},
{
"id": "04ea0d56-f883-4ca7-9b43-77b7b567e12f",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1472,
-272
],
"parameters": {
"width": 368,
"height": 208,
"content": "STEP 3: AI-Powered Customer Support Engine\nAdvanced AI agent with multilingual capabilities, conversation memory, and knowledge base integration for intelligent customer support.\nKey Components:\n* AI Agent (LangChain) - Primary conversational AI with detailed system prompt\n* OpenRouter Chat Model (Claude Sonnet 4) - High-quality language model for responses\n* Simple Memory Buffer - Maintains conversation context across interactions\n* Google Docs Tool - Retrieves company information from knowledge base\n* Multilingual support - Handles English and Roman Urdu conversations"
},
"typeVersion": 1
},
{
"id": "62179b5e-7777-4a9d-ba77-7013ed44b5c5",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
2064,
-272
],
"parameters": {
"width": 336,
"height": 176,
"content": "STEP 4: Response Delivery System\nSends AI-generated responses back to customers via WhatsApp with proper formatting and delivery confirmation.\nKey Components:\n* Respond with Text - Sends final response to customer's WhatsApp number\n* Response formatting - Ensures proper message structure and delivery\n* Phone number routing - Uses original sender's number for reply delivery"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"AI Agent": {
"main": [
[
{
"node": "Respond with Text",
"type": "main",
"index": 0
}
]
]
},
"Audio Prompt": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Analyze Image": {
"main": [
[
{
"node": "Image + Text Prompt",
"type": "main",
"index": 0
}
]
]
},
"Get Audio URL": {
"main": [
[
{
"node": "Download Audio",
"type": "main",
"index": 0
}
]
]
},
"Get Image URL": {
"main": [
[
{
"node": "Download Image",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Download Audio": {
"main": [
[
{
"node": "Transcribe Audio",
"type": "main",
"index": 0
}
]
]
},
"Download Image": {
"main": [
[
{
"node": "Analyze Image",
"type": "main",
"index": 0
}
]
]
},
"Check Input Type": {
"main": [
[
{
"node": "Get Audio URL",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Image URL",
"type": "main",
"index": 0
}
],
[
{
"node": "Text Only Prompt",
"type": "main",
"index": 0
}
]
]
},
"Text Only Prompt": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Transcribe Audio": {
"main": [
[
{
"node": "Audio Prompt",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "Check Input Type",
"type": "main",
"index": 0
}
]
]
},
"Image + Text Prompt": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Get a document in Google Docs": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}

In n8n Editor: paste with Ctrl+VWorkflow will be created