WhatsApp AI Debounce & Buffer Workflow with Redis + Gemini
WhatsApp AI Debounce & Buffer Workflow with Redis + Gemini
Regular price
£37.99
Regular price
£37.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
WhatsApp AI Debounce & Buffer Workflow with Redis + Gemini
Regular price
£37.99
Regular price
£37.99
Sale price
Unit price
/
per
Debounce, buffer, and reply once—using WhatsApp + Redis + Google Gemini
Stop getting spammy, one-message-at-a-time replies. This n8n workflow debounces incoming WhatsApp messages, buffers multiple quick texts per sender in Redis, and then generates a single consolidated response using an AI Agent powered by the Google Gemini Chat Model—with deduplication and a Redis lock to prevent parallel replies.
What this workflow does
- Triggers on new WhatsApp messages and extracts sender, message ID, type, text, and a timestamp.
- If the incoming message is not text, it sends a WhatsApp reply asking the user to type their message instead.
- For text messages, it checks Redis for a deduplication key using the WhatsApp message ID and stops processing if it was already handled.
- Appends the text to a per-sender Redis buffer and stores a last message timestamp in Redis.
- Debounces for 3 seconds: it waits, then re-reads the per-sender “last message” timestamp to abort if a newer message arrived during the debounce window.
- If it’s still the latest message, it sets a short-lived per-sender Redis lock, combines the buffered messages into one text block, and clears the buffer.
- Passes the combined text to an n8n AI Agent using the Google Gemini Chat Model with a structured output parser, sends the generated reply via WhatsApp, and then releases the Redis lock.
Use cases
- WhatsApp customer support where users send multiple short messages in a burst.
- Reducing duplicate AI responses from repeated WhatsApp message delivery.
- AI-assisted conversational flows that must avoid parallel replies per sender.
Technical details
- Nodes include: if, set, no op, wait, Redis, and WhatsApp (Trigger + Send).
- Uses Redis for message deduplication, per-sender buffering, and a per-sender lock.
- Uses Google Gemini via an AI Agent to generate the WhatsApp response.
Setup note: configure WhatsApp Cloud API/OAuth credentials for the WhatsApp Trigger and WhatsApp Send steps, and connect your Redis instance.
