N8N + WhatsApp GRÁTIS: Crie seu Agente de IA sem gastar NADA! (Tutorial fácil para iniciantes 2025)

N8N + WhatsApp GRÁTIS: Crie seu Agente de IA sem gastar NADA! (Tutorial fácil para iniciantes 2025)

How to Create a Free WhatsApp Integration Agent

Introduction to the Project

  • The video aims to teach viewers how to create an integrated WhatsApp agent using N8N, WAHA API, and Redis database for free.
  • It emphasizes that no payment is required for any of the solutions presented, making it accessible for beginners in automation.

Setting Up Docker

  • Viewers are instructed to download and install Docker Desktop from its official website, with options available for MacOS, Windows, and Linux.
  • After installing Docker, users need to download a specific file called dockercompose and place it in a newly created folder named "N8N waha local."
  • A terminal command (Docker-compose up -d) is provided to automatically set up N8N, WAHA, and Redis within Docker. This command initiates the necessary services.

Configuring WAHA

  • Users are guided on how to access the WAHA dashboard through a link in Docker and connect their WhatsApp by scanning a QR code with their mobile device.
  • Once connected successfully, users can proceed with configuring N8N for further automation tasks.

Setting Up N8N

  • Instructions include entering personal details (email, name) when prompted by N8N after accessing it via Docker. Users should select options indicating they are not using it for work purposes.
  • A free activation key is obtained via email which unlocks additional features in N8N; this key must be entered into the settings under "integration key."

Creating Workflows in N8N

  • Users learn how to initiate a new workflow titled "WhatsApp" and add a webhook trigger configured as POST with a specified URL matching previous configurations.
  • The process involves setting up event handling by deselecting unnecessary events while ensuring message events remain active for processing incoming messages from WhatsApp.

Data Handling in Workflows

  • A new node labeled "set" is added to filter relevant data from incoming webhooks; specific fields such as session ID and message body are selected for processing.

Messenger Event Configuration

Setting Up the Messenger Event

  • The discussion begins with different routes for various event types, focusing on the Messenger event for now. If the event equals "message," it confirms that the setup is correct.
  • The configuration of an AI agent is introduced, where a prompt is defined to guide the agent's responses based on incoming messages.

Creating and Configuring the AI Agent

  • A simple prompt example is provided: "You are a tour guide who knows everything about Foz do Iguaçu and helps travelers create personalized itineraries." This sets up the context for the AI agent.
  • Instructions are given on obtaining a free API key from Google Gemini by logging into Google AI Studio and creating a new key.

Connecting to Google Gemini

  • After copying the API key, it’s pasted into N8N to establish a successful connection. The model used will be Gemini 2.0 Flash, which offers improved performance over version 1.0 Pro.

Adjusting Model Parameters

  • An optional parameter called sampling temperature can be adjusted to control how creative or "crazy" the AI's responses may be; default is set at 0.4.

Memory Configuration in N8N

Adding Chat Memory

  • A Redis chat memory node is added using pre-configured settings from Docker Compose, requiring specific credentials like password and host adjustments.

Session ID Setup

  • The session ID configuration involves setting it to define below and linking it with chat ID data while specifying session duration (3600 seconds).

Finalizing Workflow for WhatsApp Integration

Sending Messages via WhatsApp

  • A new node is added to send messages through WhatsApp after clearing existing data fields and selecting appropriate credentials.

Testing Message Delivery

  • The workflow tests message delivery by linking session IDs and message IDs correctly; successful visual confirmation appears in WhatsApp.

Demonstrating Memory Functionality

Interaction Example with Memory Feature

  • An interaction showcases memory functionality where user input ("My name is Guilherme") leads to accurate recall when queried about their name.

Limitations of Local N8N Installation

Constraints on Automation Capabilities

WhatsApp Automation and New Course Announcement

Overview of WhatsApp Automation Installation

  • The installation discussed is specifically for automating WhatsApp using the Ah tool, with no additional features included.

Introduction to New Course

  • A new course has been launched that teaches how to create AI agents using N8N, Ah, or Evolution both locally and on a VPS.
  • The course covers essential fundamentals of N8N along with various bonuses that will be added over time.

Additional Learning Opportunities

  • Future content will include topics such as website and app creation, API integrations, API development, database management, and more.

Promotional Offer

  • The course is currently available at a promotional launch price during May.

VPS Subscription Recommendation

Video description

Aprenda a criar um Chatbot no Whatsapp sem gastar NADA, utilizando o N8N e uma API de Whatsapp gratuita (WAHA)! 🟦 Meu Curso N8N Fácil: https://guilhermelaz.com.br/curso 🟪 VPS Hostinger: https://guilhermelaz.com.br/hostingerVps 👆🏻 Use o cupom de desconto GUILHERMELAZ para 10% de desconto EXTRA! 👆🏻 💡 Ofertas e recomendações: 🟦 Meu Curso N8N Agentes de IA Chatbots Inteligentes: https://guilhermelaz.com.br/curso 🟪 Planos na Hostinger: https://guilhermelaz.com.br/hostingerVps Links do vídeo: 🐳 Download do arquivo docker-compose.yml: https://guilhermelaz.com.br/n8n-waha-local 🔑 Chave de API do Google Gemini: https://aistudio.google.com/app/apikey =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Passo a Passo do Vídeo: 1️⃣ Instalar o Docker no seu computador: Baixe o aplicativo Docker Desktop de acordo com o seu sistema operacional (Windows, MacOS ou Linux): https://docker.com Obs: No Linux existe um passo extra. Após baixar o Docker Desktop, você precisará abrir um terminal (CMD) e executar o comando: sudo apt install docker-compose 2️⃣ Baixe o arquivo docker-compose.yml do Github: Faça download do arquivo docker-compose.yml no Github: https://guilhermelaz.com.br/n8n-waha-local 3️⃣ Crie uma pasta com o arquivo dentro, e execute o comando no terminal: Nos seus downloads, crie uma nova pasta com nome "N8N WAHA Local" ou parecido, e coloque o arquivo docker-compose.yml dentro dela. Depois abra essa pasta com o arquivo dentro, abra um terminal nela clicando com o botão direito e "abrir no terminal" e execute o comando: docker-compose up -d Aguarde o docker baixar e subir os containers dos aplicativos. 4️⃣ Conectar seu Whatsapp no WAHA: Após baixar tudo, abra o aplicativo Docker Desktop e você verá uma nova stack de containers com os aplicativos N8N e WAHA, e os bancos de dados Redis e Postgres. Para acessá-los basta clicar na porta do container através da tabela de exibição (formato xxxx:xxxx). Acesse o WAHA através do navegador clicando na porta 3000:3000 pelo aplicativo Docker Desktop, depois clique em "Dashboard" logo em cima. No dashboard, inicie a sessão default já existente e leia o QR Code que aparece clicando em "Login". 5️⃣ Configurar o N8N: Após entrar no WAHA com seu Whatsapp, volte ao aplicativo do Docker Desktop e acesse o N8N, clicando na porta 5678:5678 e faça as configurações da sua conta. Após criar a conta, informe um e-mail para receber uma chave de ativação gratuita do N8N. Isso irá te ajudar liberando algumas funções extras. Copie a chave que chega em seu e-mail, e no painel do N8N, vá nos três pontinhos do canto inferior esquerdo, clique em settings, e depois "Enter Activation Key" na tela que aparece, e informe a chave que recebeu. Após ativar o N8N, vá para o painel "Community Nodes" (do lado esquerdo da tela, ainda em settings), clique em "Install a community node" e digite: n8n-nodes-waha Clique em "Install" e aguarde. Pronto! A configuração do N8N está feita e agora podemos montar o Workflow. 6️⃣ Montar o Workflow: Crie um novo workflow, adicione um Trigger de "Webhook" e o configure da seguinte forma: HTTP Method: POST Path: webhook Depois copie a URL de teste que aparece logo acima, vá no Dashboard do Waha, configurações da sua sessão, "+ Webhook", cole a URL, em events deixe apenas o "message" e clique em "Update". Após isso volte ao N8N, clique para esperar um evento de teste e envie uma mensagem para o seu número conectado no WAHA através de OUTRO NÚMERO (um segundo número, de algum familiar, amigo, etc. Não funciona com o próprio número da sessão). Após receber os dados, adicione um node "Set" em frente ao Webhook e salve crie os seguintes campos: session = session event = event chatId = from pushName = pushName (O outro que está lá em baixo, dentro de _data) payload_id = id message = body fromMe = fromMe Teste e depois adicione um novo node, dessa vez um "Switch" em frente ao SET. Neste switch apenas faça a comparação, se o "event" for igual a "message" e siga o fluxo normal. Adicione o node do AI Agent e faça as configurações de prompt, system prompt, chat model e memory. Pegue a chave de API gratuita do Google Gemini aqui: https://aistudio.google.com/app/apikey A configuração do node do Redis Chat Memory é a seguinte: Password: default Host: host.docker.internal Depois adicione um Node do WAHA para visualizar a mensagem, passando as configurações de Sessão, Chat ID e Payload ID. E por fim, adicione um Node do WAHA para responder a mensagem, passando as configurações de Sessão, Chat ID e TEXT, onde TEXT é o Output gerado pelo node do Agente de IA. Pronto! Agora você tem o seu próprio fluxo de Agente de IA integrado ao Whatsapp feito de forma 100% gratuita, sem gastar nada! =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 📸 Me siga no Instagram: @oguilhermelazarotto Entre nos grupos da comunidade Tecnologia & Automação: 📱 https://guilhermelaz.com.br/grupoWhatsapp 📞 https://guilhermelaz.com.br/discordAutomacao