AutomationFlowsAI & RAG › WhatsApp AI Chatbot with Gemini

WhatsApp AI Chatbot with Gemini

Original n8n title: Whats

whats. Uses agent, lmChatGoogleGemini, memoryRedisChat, n8n-nodes-waha. Webhook trigger; 8 nodes.

Webhook trigger★★★★☆ complexityAI-powered8 nodesAgentGoogle Gemini ChatMemory Redis ChatN8N Nodes Waha
AI & RAG Trigger: Webhook Nodes: 8 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → Google Gemini Chat recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "whats",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "webhook",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "id": "241e8880-f8b3-457c-9197-e3fd1ddb9c8c",
      "name": "Webhook"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b1d05353-cc22-4725-aef3-4c9274ffd909",
              "name": "session",
              "value": "={{ $json.body.session }}",
              "type": "string"
            },
            {
              "id": "3d90735c-c445-4451-aa8a-7b6824a6e13b",
              "name": "chatId",
              "value": "={{ $json.body.payload.from }}",
              "type": "string"
            },
            {
              "id": "9ef030a8-241a-49a2-bc38-63cd9193ae4e",
              "name": "pushName",
              "value": "={{ $json.body.payload._data.Info.PushName }}",
              "type": "string"
            },
            {
              "id": "5491c39e-d931-4f58-860a-5103429c7f1a",
              "name": "paylod_id",
              "value": "={{ $json.body.payload.id }}",
              "type": "string"
            },
            {
              "id": "4dfac49f-6655-4bb3-abdf-e59d9102f88a",
              "name": "event",
              "value": "={{ $json.body.event }}",
              "type": "string"
            },
            {
              "id": "55e8f807-34f5-4ae2-9807-feed9e5299f5",
              "name": "message",
              "value": "={{ $json.body }}",
              "type": "string"
            },
            {
              "id": "c2f4b3d2-e0a4-4938-9eb3-7c616f0c8907",
              "name": "fromMe",
              "value": "={{ $json.body.payload.fromMe }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "id": "cb7edc85-c493-4233-ab09-f823e139f623",
      "name": "FiltrarDados"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.event }}",
                    "rightValue": "message",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "d9d3d991-974f-4c0e-a86b-d6ea42869a07"
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        440,
        0
      ],
      "id": "37432a48-5d04-4684-ab45-c247323318d5",
      "name": "Switch"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "Voce \u00e9 um arquiteto de software com muita experi\u00eancia, e trabalha como consultor de TI, respondendo d\u00favidas sobre conceitos importantes de programa\u00e7\u00e3o, arquitetura de software, clould e devops. "
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        620,
        0
      ],
      "id": "79b3de6c-4688-41fe-868f-77ba7bb98db3",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.0-flash",
        "options": {
          "temperature": 0.4
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        560,
        320
      ],
      "id": "cf2af3c3-5907-4b3f-97e5-3155cd697d7d",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('FiltrarDados').item.json.chatId }}",
        "sessionTTL": 3600,
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        720,
        320
      ],
      "id": "46a4d691-518f-4101-b00c-f631b50c46db",
      "name": "Redis Chat Memory",
      "credentials": {
        "redis": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "Chatting",
        "operation": "Send Seen",
        "session": "={{ $('FiltrarDados').item.json.session }}",
        "chatId": "={{ $('FiltrarDados').item.json.chatId }}",
        "messageId": "={{ $('FiltrarDados').item.json.paylod_id }}",
        "requestOptions": {}
      },
      "type": "n8n-nodes-waha.WAHA",
      "typeVersion": 202411,
      "position": [
        980,
        0
      ],
      "id": "3027c127-2caa-4f99-b430-9290576941f7",
      "name": "WAHA",
      "credentials": {
        "wahaApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "Chatting",
        "operation": "Send Text",
        "session": "={{ $('FiltrarDados').item.json.session }}",
        "chatId": "={{ $('FiltrarDados').item.json.chatId }}",
        "text": "={{ $('AI Agent').item.json.output }}",
        "requestOptions": {}
      },
      "type": "n8n-nodes-waha.WAHA",
      "typeVersion": 202411,
      "position": [
        1200,
        0
      ],
      "id": "48a5ed56-6d57-486a-ac38-0d636a4516a1",
      "name": "WAHA1",
      "credentials": {
        "wahaApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "FiltrarDados",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FiltrarDados": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "WAHA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WAHA": {
      "main": [
        [
          {
            "node": "WAHA1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8fa8eccb-eada-4703-9f9c-9f38c10d8365",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "nGlIlquhqusIaxEJ",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

whats. Uses agent, lmChatGoogleGemini, memoryRedisChat, n8n-nodes-waha. Webhook trigger; 8 nodes.

Source: https://github.com/velkanknight/n8n-whats/blob/70003f4db6a42fd822432fea078495891197ea5d/workflows/whats.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

ÁncorA v5 — WhatsApp Completo (Texto + Voz + Foto + Disparo). Uses agent, lmChatGoogleGemini, memoryRedisChat, httpRequest. Webhook trigger; 35 nodes.

Agent, Google Gemini Chat, Memory Redis Chat +2
AI & RAG

Whatsapp v1.1. Uses lmChatGoogleGemini, n8n-nodes-waha, agent, memoryRedisChat. Webhook trigger; 15 nodes.

Google Gemini Chat, N8N Nodes Waha, Agent +2
AI & RAG

WhatsApp. Uses agent, lmChatGoogleGemini, memoryRedisChat, n8n-nodes-waha. Webhook trigger; 8 nodes.

Agent, Google Gemini Chat, Memory Redis Chat +1
AI & RAG

Chatbot-Pizzaria-Gemini. Uses agent, lmChatGoogleGemini, memoryRedisChat, n8n-nodes-waha. Webhook trigger; 8 nodes.

Agent, Google Gemini Chat, Memory Redis Chat +1
AI & RAG

Agent: IPTV (instance_e2165d22_1762376395079). Uses openAi, redis, supabase, httpRequest. Webhook trigger; 56 nodes.

OpenAI, Redis, Supabase +7