workflows.fit
Back to n8n workflows
n8n templateFreeBy Edisson Garcia

Message buffer system with Redis for efficient processing

🚀 Message-Batching Buffer Workflow (n8n) This workflow implements a lightweight message-batching buffer using Redis for temporary storage and a JavaScript consolidation function to merge messages. It collects incomin...

DevelopmentData & StorageCore NodesLangchainManual TriggerNo OpCodeRedis
Loading interactive preview...

Template notes

🚀 Message-Batching Buffer Workflow (n8n)

This workflow implements a lightweight message-batching buffer using Redis for temporary storage and a JavaScript consolidation function to merge messages. It collects incoming user messages per session, waits for a configurable inactivity window or batch size threshold, consolidates buffered messages via custom code, then clears the buffer and returns the combined response—all without external LLM calls.

---

🔑 Key Features

Redis-backed buffer queues incoming messages per contextid. Centralized Config Parameters node to adjust thresholds and timeouts in one place. Dynamic wait time based on message length (configurable minWords, waitLong, waitShort). Batch trigger fires on inactivity timeout or when buffercount ≥ batchThreshold. Zero-cost consolidation via built-in JavaScript Function (consolidate buffer)—no GPT-4 or external API required.

---

⚙️ Setup Instructions

1. Extract Session & Message