I’m building a Facebook Messenger chatbot using n8n with a webhook. The issue I’m facing is that the webhook keeps retriggering, which causes my bot to repeatedly send the same message (spamming in production).
Here is what’s happening:
The webhook verification with GET works correctly.
When I receive a POST event from Facebook, my workflow processes it, but the same event gets triggered again and again.
As a result, the bot keeps sending the same message multiple times in an infinite loop.
I suspect something is wrong with how my POST webhook response or filtering is set up, but I’m not sure where the issue is.
I debugged your workflow very carefully and try to identify the issue but because of less details and also i don’t have the execution logs so that i can debug the flow very deeply,so i can give you few reasons that may solve your issue :-
1.Ensure Webhook Acknowledgment :- The Webhook Node must return a proper HTTP response (200 OK) with an acknowledgment after processing the event.
2.Avoid Circular Processing :- Ensure that the AI Agent Node or HTTP Request Node does not trigger the Webhook Node again inadvertently. Implement checks to avoid reprocessing the same data.
3.Use Unique Identifiers :- If the same event is processed multiple times, use a unique identifier (e.g., message ID) to check and prevent duplicates.
I simply put a ‘response to webhook’ node after the ‘webhook’ node, so it gets back an instant 200 OK response. I have tried put it after the ‘HTTP Request’ node aswell, but it did not worked that way.
شكراً جزيلاً جزيلاً يا صديقي!!!..لا أستطيع التعبير عن مدى إحباطي قبل أن أجد هذا…لقد بنيت النظام بأكمله لعميلي لكنني علقت في هذه المشكلة لمدة 3-4 أيام.لقد حاولت بطرق كثيرة لكنني فشلت…أخيراً حصلت على حلك وحاولت…هل تخمن ماذا???..نجح…لا أستطيع التعبير عن مدى امتناني لك الآن..شكراً يا صديقي شكراً…