Create a human-like Evolution API WhatsApp agent with Redis, PostgreSQL and Gemini
UnknownUnknown. This template uses community nodes we can't verify statically. Uses community nodes that can't be verified statically (unverified community packages are off by default in 3.0). Static check, last run 2026-10-19.
Community nodes
These come from third-party npm packages. In n8n 3.0 unverified community packages are off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).
n8n-nodes-evolution-api(Descargar Media, Read Messages, Open session, Writting..., Send Response)
Nodes used (22)
- Evolution Api
n8n-nodes-evolution-api.evolutionApi - Edit Fields (Set)
n8n-nodes-base.set - Switch
n8n-nodes-base.switch - Redis
n8n-nodes-base.redis - No Operation, do nothing
n8n-nodes-base.noOp - If
n8n-nodes-base.if - Wait
n8n-nodes-base.wait - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Webhook
n8n-nodes-base.webhook - Postgres
n8n-nodes-base.postgres - Aggregate
n8n-nodes-base.aggregate - Extract from File
n8n-nodes-base.extractFromFile - Google Gemini
@n8n/n8n-nodes-langchain.googleGemini - HTML
n8n-nodes-base.html - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - Convert to File
n8n-nodes-base.convertToFile - Manual Trigger
n8n-nodes-base.manualTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Execute Sub-workflow
n8n-nodes-base.executeWorkflow
What it does
🤖 Human-like Evolution API Agent with Redis & PostgreSQL This production-ready template builds a sophisticated AI Agent using Evolution API that mimics human interaction patterns. Unlike standard chatbots that reply instantly to every incoming message, this workflow uses a Smart Redis Buffering System. It waits for the user to finish typing their full thought (text, audio, or image albums) before processing, creating a natural, conversational flow. It features a Hybrid Memory Architecture: active conversations are cached in Redis for ultra-low latency, while the complete chat history is securely stored in PostgreSQL. To optimize token usage and maintain long-term coherence, a Context Refiner Agent summarizes the conversation history before the Main AI generates a response. ✨ Key Features - Human-like Buffering: The agent waits (configurable time) to group consecutive messages, voice notes, and media albums into a single context. This prevents fragmented replies and feels like talking to a real person. - Hybrid Memory: Combines Redis (Hot Cache) for speed and PostgreSQL (Cold Storage) for permanent history. - Context Refinement: A specialized AI step summarizes past interactions, allowing the Main Agent to understand long conversations without exceeding token limits or increasing costs. - Multi-Modal Support: Natively handles text, audio transcription, and image analysis via Evolution API. - Parallel Processing: Manages "typing..." status and session checks in parallel to reduce response latency. 📋 Requirements To use this workflow, you must configure the Evolution API correctly: 1. Evolution API Instance: You need a running instance of Evolution API. - Configuration Guide 2. N8n Community Node: Install the Evolution API node in your n8n instance. - n8n-nodes-evolution-api 3. Database: A PostgreSQL database for chat history and a Redis instance for the buffer/cache. 4. AI Models: API keys for your LLM (OpenAI, Anthropic, or Google Gemini). ⚙️ Setup Instructions 1. Install the Node: Go to Settings > Community Nodes in n8n and install n8n-nodes-evolution-api. 2. Credentials: Configure credentials for Redis, PostgreSQL, and your AI provider (e.g., OpenAI/Gemini). 3. Database Setup: Create a chathistory table in PostgreSQL (columns must match the Insert node). 4. Redis Connection: Configure your Redis credentials in the workflow nodes. 5. Global Variables: Set the following in the "Global Variables" node: - waitbuffer: Seconds to wait for the user to stop typing (e.g., 5s). - waitconversation: Seconds to keep the cache alive (e.g., 300s). - maxchathistory: Number of past messages to retrieve. 6. Webhook: Point your Evolution API instance to this workflow's Webhook URL. 🚀 How it Works 1. Ingestion: Receives data via Evolution API. Detects if it's text, audio, or an album. 2. Smart Buffering: Holds the execution to collect all parts of the user's message (simulating a human reading/listening). 3. Context Retrieval: Checks Redis for the active session. If empty, fetches from PostgreSQL. 4. Refinement: The Refiner Agent summarizes the history to extract key details. 5. Response: The Main Agent generates a reply based on the refined context and current buffer, then saves it to both Redis and Postgres. 💡 Need Assistance? If you’d like help customizing or extending this workflow, feel free to reach out: 📧 Email: johnsilva11031@gmail.com(mailto:johnsilva11031@gmail.com) 🔗 LinkedIn: John Alejandro Silva Rodríguez