{"slug": "openwa-simple-integration-n8n-workflow", "title": "OpenWA Simple Integration N8N Workflow", "summary": "A developer created an n8n workflow integrating OpenWA with WhatsApp to build an AI bot with three varieties: personal contact, group message, and group message with @agent mention. The workflow uses an Ollama chat model (llama3.2:3b) with memory and sends responses via OpenWA API.", "body_md": "| { | |\n| \"name\": \"WhatsApp AI Bot — 3 Varieties\", | |\n| \"nodes\": [ | |\n| { | |\n| \"parameters\": { | |\n| \"httpMethod\": \"POST\", | |\n| \"path\": \"wa-webhook\", | |\n| \"options\": {} | |\n| }, | |\n| \"id\": \"321adc8a-c16f-4b60-baa3-3c51d7f748d6\", | |\n| \"name\": \"WA Webhook\", | |\n| \"type\": \"n8n-nodes-base.webhook\", | |\n| \"typeVersion\": 2.1, | |\n| \"position\": [112, 544], | |\n| \"webhookId\": \"49cae27c-b557-4d0c-a7ab-101a3d83c8ac\" | |\n| }, | |\n| { | |\n| \"parameters\": { | |\n| \"method\": \"POST\", | |\n| \"url\": \"=http://openwa-api:2785/api/sessions/{{ $('WA Webhook').item.json.body.sessionId }}/messages/send-text\", | |\n| \"authentication\": \"genericCredentialType\", | |\n| \"genericAuthType\": \"httpHeaderAuth\", | |\n| \"sendHeaders\": true, | |\n| \"headerParameters\": { | |\n| \"parameters\": [{ \"name\": \"Content-Type\", \"value\": \"=application/json\" }] | |\n| }, | |\n| \"sendBody\": true, | |\n| \"bodyParameters\": { | |\n| \"parameters\": [ | |\n| { \"name\": \"chatId\", \"value\": \"={{ $json.chatId }}\" }, | |\n| { \"name\": \"text\", \"value\": \"={{ $json.output }}\" } | |\n| ] | |\n| }, | |\n| \"options\": {} | |\n| }, | |\n| \"id\": \"52d1f993-69fb-461b-abf6-e683c288e505\", | |\n| \"name\": \"Send WhatsApp Message\", | |\n| \"type\": \"n8n-nodes-base.httpRequest\", | |\n| \"typeVersion\": 4.4, | |\n| \"position\": [1632, 544], | |\n| \"credentials\": { \"httpHeaderAuth\": { \"id\": \"REPLACE_ME\", \"name\": \"OpenWA API Key\" } } | |\n| }, | |\n| { | |\n| \"parameters\": { \"model\": \"llama3.2:3b\", \"options\": {} }, | |\n| \"type\": \"@n8n/n8n-nodes-langchain.lmChatOllama\", | |\n| \"typeVersion\": 1, | |\n| \"position\": [1008, 784], | |\n| \"id\": \"f731fc8d-6965-45a3-82bc-0ffe634a1173\", | |\n| \"name\": \"Ollama Chat Model\", | |\n| \"credentials\": { \"ollamaApi\": { \"id\": \"REPLACE_ME\", \"name\": \"Ollama account\" } } | |\n| }, | |\n| { | |\n| \"parameters\": { | |\n| \"sessionIdType\": \"customKey\", | |\n| \"sessionKey\": \"={{ $json.body.data.chatId }}\", | |\n| \"contextWindowLength\": 30 | |\n| }, | |\n| \"type\": \"@n8n/n8n-nodes-langchain.memoryBufferWindow\", | |\n| \"typeVersion\": 1.4, | |\n| \"position\": [1184, 816], | |\n| \"id\": \"d29aeafc-0398-477c-9757-e0cb25799ac4\", | |\n| \"name\": \"Simple Memory\" | |\n| }, | |\n| { | |\n| \"parameters\": { | |\n| \"conditions\": { | |\n| \"options\": { \"caseSensitive\": true, \"leftValue\": \"\", \"typeValidation\": \"strict\", \"version\": 3 }, | |\n| \"conditions\": [{ | |\n| \"id\": \"6c1bd14c-82d9-4e84-9710-f7cff64ff5e7\", | |\n| \"leftValue\": \"={{ $json.body.data.contact.pushName }}\", | |\n| \"rightValue\": \"YourContactName\", | |\n| \"operator\": { \"type\": \"string\", \"operation\": \"equals\" } | |\n| }], | |\n| \"combinator\": \"and\" | |\n| }, | |\n| \"options\": {} | |\n| }, | |\n| \"type\": \"n8n-nodes-base.if\", | |\n| \"typeVersion\": 2.3, | |\n| \"position\": [544, 288], | |\n| \"id\": \"5d673758-ca77-4362-88b8-4f1c7c657332\", | |\n| \"name\": \"Variety 1: Personal Contact\" | |\n| }, | |\n| { | |\n| \"parameters\": { | |\n| \"conditions\": { | |\n| \"options\": { \"caseSensitive\": true, \"leftValue\": \"\", \"typeValidation\": \"strict\", \"version\": 3 }, | |\n| \"conditions\": [{ | |\n| \"id\": \"447c3290-2b09-4bd5-9a20-87373df3dc3d\", | |\n| \"leftValue\": \"={{ $json.body.data.isGroup }}\", | |\n| \"rightValue\": true, | |\n| \"operator\": { \"type\": \"boolean\", \"operation\": \"equals\" } | |\n| }], | |\n| \"combinator\": \"and\" | |\n| }, | |\n| \"options\": {} | |\n| }, | |\n| \"type\": \"n8n-nodes-base.if\", | |\n| \"typeVersion\": 2.3, | |\n| \"position\": [560, 512], | |\n| \"id\": \"360ee92f-467a-4feb-85c5-7688834a3b1b\", | |\n| \"name\": \"Variety 2: Group Message\" | |\n| }, | |\n| { | |\n| \"parameters\": { | |\n| \"conditions\": { | |\n| \"options\": { \"caseSensitive\": true, \"leftValue\": \"\", \"typeValidation\": \"strict\", \"version\": 3 }, | |\n| \"conditions\": [ | |\n| { | |\n| \"id\": \"424bfcff-ef4a-4911-bdea-44eb2c4cc52e\", | |\n| \"leftValue\": \"={{ $json.body.data.isGroup }}\", | |\n| \"rightValue\": true, | |\n| \"operator\": { \"type\": \"boolean\", \"operation\": \"equals\" } | |\n| }, | |\n| { | |\n| \"id\": \"f60b4be0-1c7b-4ecd-bf65-2b3124897963\", | |\n| \"leftValue\": \"={{ $json.body.data.body }}\", | |\n| \"rightValue\": \"@agent\", | |\n| \"operator\": { \"type\": \"string\", \"operation\": \"contains\" } | |\n| } | |\n| ], | |\n| \"combinator\": \"and\" | |\n| }, | |\n| \"options\": {} | |\n| }, | |\n| \"type\": \"n8n-nodes-base.if\", | |\n| \"typeVersion\": 2.3, | |\n| \"position\": [560, 736], | |\n| \"id\": \"b9545930-1ec0-435b-8d9a-3c757ac35f17\", | |\n| \"name\": \"Variety 3: @agent Mention\" | |\n| }, | |\n| { | |\n| \"parameters\": { | |\n| \"assignments\": { | |\n| \"assignments\": [ | |\n| { \"id\": \"be20df00-04bc-46aa-8f26-462af1db0dcb\", \"name\": \"output\", \"value\": \"={{ $json.output }}\", \"type\": \"string\" }, | |\n| { \"id\": \"c58843cc-e1ec-4803-97c0-b3dc97557d32\", \"name\": \"chatId\", \"value\": \"={{ $('WA Webhook').item.json.body.data.chatId }}\", \"type\": \"string\" } | |\n| ] | |\n| }, | |\n| \"options\": {} | |\n| }, | |\n| \"type\": \"n8n-nodes-base.set\", | |\n| \"typeVersion\": 3.4, | |\n| \"position\": [1424, 544], | |\n| \"id\": \"f021c824-6573-4ecb-a2ee-cc6c4c8cdd01\", | |\n| \"name\": \"Set Message and ID\" | |\n| }, | |\n| { | |\n| \"parameters\": { | |\n| \"promptType\": \"define\", | |\n| \"text\": \"={{ $json.body.data.body }}\", | |\n| \"options\": { \"systemMessage\": \"You are a helpful assistant.\" } | |\n| }, | |\n| \"type\": \"@n8n/n8n-nodes-langchain.agent\", | |\n| \"typeVersion\": 3.1, | |\n| \"position\": [1072, 512], | |\n| \"id\": \"19742472-9a7b-4e65-8cff-a43a37065a4b\", | |\n| \"name\": \"Simple Agent\" | |\n| } | |\n| ], | |\n| \"pinData\": {}, | |\n| \"connections\": { | |\n| \"WA Webhook\": { | |\n| \"main\": [[ | |\n| { \"node\": \"Variety 1: Personal Contact\", \"type\": \"main\", \"index\": 0 }, | |\n| { \"node\": \"Variety 2: Group Message\", \"type\": \"main\", \"index\": 0 }, | |\n| { \"node\": \"Variety 3: @agent Mention\", \"type\": \"main\", \"index\": 0 } | |\n| ]] | |\n| }, | |\n| \"Ollama Chat Model\": { \"ai_languageModel\": [[{ \"node\": \"Simple Agent\", \"type\": \"ai_languageModel\", \"index\": 0 }]] }, | |\n| \"Simple Memory\": { \"ai_memory\": [[{ \"node\": \"Simple Agent\", \"type\": \"ai_memory\", \"index\": 0 }]] }, | |\n| \"Variety 3: @agent Mention\": { \"main\": [[{ \"node\": \"Simple Agent\", \"type\": \"main\", \"index\": 0 }]] }, | |\n| \"Set Message and ID\": { \"main\": [[{ \"node\": \"Send WhatsApp Message\", \"type\": \"main\", \"index\": 0 }]] }, | |\n| \"Simple Agent\": { \"main\": [[{ \"node\": \"Set Message and ID\", \"type\": \"main\", \"index\": 0 }]] } | |\n| }, | |\n| \"active\": false, | |\n| \"settings\": { \"executionOrder\": \"v1\" } | |\n| } |", "url": "https://wpnews.pro/news/openwa-simple-integration-n8n-workflow", "canonical_source": "https://gist.github.com/Abhishekrajpurohit/11a398651ceb107eeb0615915fa34268", "published_at": "2026-06-24 11:57:00+00:00", "updated_at": "2026-06-25 13:14:00.591427+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models", "ai-agents"], "entities": ["OpenWA", "n8n", "WhatsApp", "Ollama", "llama3.2"], "alternates": {"html": "https://wpnews.pro/news/openwa-simple-integration-n8n-workflow", "markdown": "https://wpnews.pro/news/openwa-simple-integration-n8n-workflow.md", "text": "https://wpnews.pro/news/openwa-simple-integration-n8n-workflow.txt", "jsonld": "https://wpnews.pro/news/openwa-simple-integration-n8n-workflow.jsonld"}}