What is your goal?
I have a working AI chatbot: ManyChat (Instagram) → Make → OpenAI GPT-4 → ManyChat. The chatbot answers customer questions 24/7. My goal is to ensure that every customer receives the correct and current AI-generated response — not an old cached answer from a previous message.
What is the problem & what have you tried?
When a user sends a message, Make runs two parallel executions simultaneously. Both executions call OpenAI and both update the ai_answer custom field in ManyChat via HTTP module (setCustomField). The second execution overwrites the correct answer with an old one. The user receives the wrong response in Instagram even though the Make History shows the correct GPT answer was generated.
What I have tried:
- Anti-duplicate filter using last_processed field in Data Store — reduces duplicates but does not prevent the race condition completely
- Sequential processing in scenario settings — conflicts with Webhook Response module, causes error: “Response can’t be processed when scenario is not executed immediately on data arrival”
- Webhook Response with {“reply”: “8.reply”} — works for delivering answers but does not prevent parallel executions
- is_processing flag concept — have not implemented yet, not sure if it solves the race condition
My current scenario structure:
Webhooks[1] → Data Store Search[2] → Anti-duplicate filter → OpenAI[7] → JSON[8] → HTTP (setCustomField ai_answer)[31] → Data Store Update[33] → Router → Webhook Response[22] (dialog branch)
The root problem: two parallel Make executions both update ai_answer — the second one overwrites the correct answer from the first. ManyChat then sends the stale value to the user.
Question: What is the correct way to prevent parallel webhook executions from overwriting each other’s data in Data Store / ManyChat custom fields? Is the is_processing boolean flag in Data Store a reliable solution, and if yes, how to implement it correctly to avoid race conditions?
