Templates / Enhance customer chat by buffering messages with Twilio and Redis

Enhance customer chat by buffering messages with Twilio and Redis

Needs changes

by Jimleuk ✓ · 10,877 views · created 2024-07-15 · Support Chatbot, AI Chatbot

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 13 nodes and runs on Twilio events (com.twilio.messaging.inbound message.received). Along the way it connects OpenAI Chat Model, Redis and Twilio.

How it runs

Trigger: On Twilio events (com.twilio.messaging.inbound message.received).

  1. Add to Messages Stack (Redis): push
  2. Wait: pauses before continuing
  3. Get Latest Message Stack (Redis): get
  4. Should Continue? (If): checks a condition and branches into true / false
  5. Get Chat History (Chat Memory Manager): uses Chat Memory Manager, with memory: Window Buffer Memory
  6. Get Messages Buffer (Edit Fields (Set)): sets 1 field: messages
  7. AI Agent: runs an AI agent, with model: OpenAI Chat Model; memory: Window Buffer Memory
  8. Send Reply (Twilio): uses Twilio

Services it uses

OpenAI Chat ModelRedisTwilio

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in AI Agent (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Removed in 3.0Replace with
AI Agent v1 (old agent modes)
AI Agent (v1.6)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (11)

From the author

This n8n workflow demonstrates a simple approach to improve chat UX by staggering an AI Agent's reply for users who send in a sequence of partial messages and in short bursts. How it works Twilio webhook receives user's messages which are recorded in a…

Excerpt from Jimleuk's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.