Anyone help me for ready buffer system with facebook messenger Chat bot

Describe the problem/error/question

Hi everyone,
I’m trying to build a buffer system for my AI chatbot in n8n, but I’ve been struggling with it for quite some time. No matter what approach I try, I can’t reliably prevent multiple executions when a user sends several messages in a short period of time.
What I want is to buffer incoming messages for a few seconds, combine them, and then process them as a single request. Right now, the workflow often executes multiple times for the same conversation, which causes duplicate AI responses.
This is very important for my business use case, so I’m looking for a reliable solution. Has anyone successfully implemented a message buffering/debouncing system in n8n for chatbots (Facebook Messenger, WhatsApp, etc.)?
I’d really appreciate any guidance, workflow examples, or suggestions.
Thanks in advance!

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Abidul_Haque_Shohel

The reason your current system is failing is that n8n starts a completely new “job” for every single message a user sends. If a user sends three messages in a row, three separate jobs start running at the same time. Because they are all trying to read and clear the same buffer in Redis simultaneously, they “trip” over each other, leading to those duplicate AI responses.

The most reliable way to fix this is to split your process into two separate workflows. The first workflow acts as a “Collector”—it simply catches the message, drops it into a Redis bucket, and ends immediately. The second workflow acts as a “Processor”—it runs on a fixed timer (like every 10 seconds), checks which buckets are ready, and processes all gathered messages as one single request.

If you prefer to keep everything in one workflow, you need a “lock” system. When a message arrives, the workflow tries to grab a digital key. The first message to arrive gets the key and becomes the “Leader,” who is the only one allowed to wait and eventually trigger the AI. Any subsequent messages are “Followers”; they simply add their text to the buffer and stop immediately, leaving the Leader to handle the final response.

Alternatively, you can use a “Community Node” (a custom plugin) specifically designed for debouncing. These tools replace your complex web of Redis and Wait nodes with a single block that handles the timing automatically. It waits for the user to stop typing for a few seconds and then outputs all the fragmented messages as one cohesive paragraph for your AI to answer.

You may try this(lock approach):

Note: You will need to replace the AI Agent placeholder node with your actual AI node and ensure your Redis credentials are selected.

Two Workflow Approach:

Workflow A: The Collector

Workflow B: The Processor

Dear @kjooleng I Using Community node with https://www.npmjs.com/package/n8n-nodes-message-debounce package but still flow execute multiple flow.

{
  "nodes": [
    {
      "parameters": {
        "respondWith": "text",
        "responseBody": "={{ $json.query.hub_challenge }}",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.5,
      "position": [
        -2800,
        -1472
      ],
      "id": "826cf533-4453-4a56-a01c-f58e836e2bbc",
      "name": "Respond to Webhook"
    },
    {
      "parameters": {
        "multipleMethods": true,
        "path": "test",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -3440,
        -1456
      ],
      "id": "0d5ac87f-a1a6-4ad3-b3b1-c14005cc452d",
      "name": "Webhook",
      "webhookId": "6d21526a-5b47-42d8-b2ea-54d7de20ee5e"
    },
    {
      "parameters": {
        "sessionId": "={{ $json.chat_id }}",
        "message": "={{ $json.message_text }}",
        "options": {
          "maxMessages": 10,
          "maxWaitTime": 10,
          "onDuplicateMessage": "ignore"
        }
      },
      "type": "n8n-nodes-message-debounce.messageDebounce",
      "typeVersion": 1,
      "position": [
        -3120,
        -1328
      ],
      "id": "1b6d8a83-ecf9-4a49-b887-6dacf6e350eb",
      "name": "Message Debounce",
      "credentials": {
        "redisApi": {
          "id": "BHmb76bfdRGIvuul",
          "name": "Redis account 2"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "chat_id",
              "name": "chat_id",
              "value": "={{ $json.body.entry[0].messaging[0].sender.id }}",
              "type": "string"
            },
            {
              "id": "message_text",
              "name": "message_text",
              "value": "={{ $json.body.entry[0].messaging[0].message.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -3264,
        -1344
      ],
      "id": "3f18cbc8-fd4b-4b63-bc05-6a6f9b139422",
      "name": "Extract Params1"
    }
  ],
  "connections": {
    "Respond to Webhook": {
      "main": [
        []
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Params1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Params1": {
      "main": [
        [
          {
            "node": "Message Debounce",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "instanceId": "5be55aa66559c174ffa9ba53dacbc5a6f5bcdc550cd6f36ecaa04d238be7b78f"
  }
}```





Hi @Abidul_Haque_Shohel

The problem is that your node is currently acting as a “delay” rather than a “buffer.” Looking at your logs, the node is simply waiting for the maximum time allowed and then letting the message through without ever checking if other messages arrived. This is why your messageCount is always 1—the node is completely ignoring the other messages you sent, treating every single one as a brand-new conversation.

The technical reason for this is likely your credentials. You are using the redisApi setting, but the newest versions of this community node have moved to “native” n8n Redis credentials. Because of this mismatch, the node cannot properly “talk” to your Redis database to remember previous messages. It’s like the node is trying to write in a notebook, but it’s using a pen that doesn’t work, so it forgets everything the moment the execution ends.

To fix this, first update the community node to the latest version and switch your credentials to the standard n8n Redis credential (the one that asks for Host and Port). Then, make sure you set a “Debounce Window” (e.g., 5 seconds) and increase the “Max Wait Time” to something higher (e.g., 30 seconds). This ensures the “silence timer” has enough room to work before the safety valve forces the message through.

Try this workflow

After importing this JSON, you MUST:

1)Open the Message Debounce node.
2)Click the Credentials dropdown.
3)Create a NEW credential using the native n8n Redis type (Host, Port, Password), NOT the redisApi type.

@kjooleng i faceing still same problem

Hi @Abidul_Haque_Shohel

Your workflow is still failing because you are using the wrong type of “key” to connect to your database. You are currently using a credential called redisApi, but the node requires the standard, native Redis credential to remember your messages. Because you’re using the wrong one, the node is unable to “save” the first message before the second one arrives, which is why it treats every single message as a brand-new conversation instead of grouping them together.

To fix this, you must manually change the credential in n8n. Go to your Credentials menu and create a brand new Redis credential—make sure you pick the official n8n one that asks for a Host and Port, and NOT one that mentions “API.” Once that is created, open your Message Debounce node and select this new credential from the dropdown list. Only then will the buffering logic actually start working.

Did you update the community node to the latest version?

@kjooleng n8n-nodes-message-debounce 0.1.31 this is latest version.

image

Will this help you?

Strange, the latest version I can find is 0.1.30

There seems to be a bug which is unresolved until now