ManyChat + Make + OpenAI chatbot sends old answer to Instagram despite correct GPT response

:bullseye: What is your goal?

I have a working AI chatbot: ManyChat (Instagram; WhatsApp) β†’ 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.

:thinking: What is the problem & what have you tried?

Hi everyone. I have a complex issue with ManyChat + Make + OpenAI chatbot
for Instagram. I need help solving two critical problems.

═══════════════════════════════
SYSTEM ARCHITECTURE
═══════════════════════════════

Platform: ManyChat (Instagram) + Make + OpenAI GPT-4o-mini

Make scenario flow:
Webhooks[1] (Custom webhook, instant trigger)
β†’ Data Store[2] Search records (search by user_id = sender_id)
β†’ Anti-duplicate filter:
Condition 1: sender_id + β€œ" + message != last_processed
Condition 2: sender_id + "
” + message != last_msg
β†’ OpenAI[7] (GPT-4o-mini, JSON mode, generates reply)
β†’ JSON[8] (Parse JSON, extracts β€œreply” field as 8.reply)
β†’ Data Store[33] Update record (saves history, last_processed,
last_msg = sender_id+β€œ_”+message, name, phone, language)
β†’ Router[11]
Branch 1 β€œbooking”: Data Store β†’ Google Sheets β†’ Telegram Bot
β†’ Webhooks[25] Webhook Response
Branch 2 β€œdialog”: Webhooks[22] Webhook Response
body = {β€œreply”: β€œ{{8.reply}}”}

Data Store structure:
user_id (Text), history (Text), name (Text), phone (Text),
detected_language (Text), last_update (Date),
last_processed (Text), last_msg (Text), is_processing (Boolean)

ManyChat Flow structure:
Trigger: Default Reply + Another flow (language selection flow)
β†’ Condition: chosen_language has any value
β†’ YES branch: External Request (POST to Make webhook,
body: sender_id, message, language)
β†’ Send Message {{ai_answer}}
β†’ NO branch: Start Automation β€œLanguage Selection Flow”

ManyChat Response Mapping:
JSONPath: β€œreply” β†’ Custom Field: ai_answer

═══════════════════════════════
PROBLEM 1 β€” RACE CONDITION (Main Problem)
═══════════════════════════════

What happens:
User sends a message. ManyChat triggers two parallel executions
in Make simultaneously (or within milliseconds of each other).

Both executions:

  1. Read Data Store at the same time
  2. Both see last_processed = old value (not yet updated)
  3. Both PASS the anti-duplicate filter
  4. Both call OpenAI
  5. Both send Webhook Response to ManyChat
  6. ManyChat receives two responses

Result: User receives the WRONG answer β€” the response from the
OLDER parallel execution (which contains a stale/previous answer),
not the current correct one.

Example from real test:

  • User asks β€œWhat services do you have?”
  • Make History shows OpenAI gave correct answer about services
  • User receives in Instagram: β€œNice to meet you, Roma! How can I help?”
    (this was the answer from a PREVIOUS message)

What I already tried:

  1. Anti-duplicate filter with last_processed β€” both executions read
    the same old value simultaneously, both pass the filter
  2. Added second filter field last_msg β€” same problem, race condition
    still occurs
  3. Sequential Processing in Make settings β€” conflicts with
    Webhook Response module, causes error:
    β€œResponse can’t be processed when scenario is not executed
    immediately on data arrival”
  4. Removed HTTP setCustomField module (was updating ai_answer
    via ManyChat API) β€” problem persists
  5. Added is_processing Boolean field to Data Store β€”
    not fully implemented yet

Previous expert advice I received:
β€œCreate unique message_id. Before OpenAI, create Data Store record
with status=processing and that message_id. If message_id already
exists β€” stop the duplicate execution. Map answer from current
execution, not from shared ManyChat field.”

I understand the concept but need help with exact Make implementation:

  • Which modules to use and in what exact order?
  • How to check if message_id exists AND stop the execution if it does?
  • Data Store β€œAdd a record” or β€œUpdate a record” for the flag?
  • How to handle the case where is_processing gets stuck as true
    if execution fails?

═══════════════════════════════
PROBLEM 2 β€” NO RESPONSE AFTER LANGUAGE SELECTION
═══════════════════════════════

What happens:
User sends first message (e.g. β€œHello”)
β†’ ManyChat shows language selection buttons (Russian/Kazakh/English)
β†’ User clicks β€œRussian”
β†’ Make scenario triggers and runs (all modules show green in History)
β†’ OpenAI generates correct response (visible in Make History)
β†’ Data Store saves correct history
β†’ BUT user receives NO message in Instagram at all
β†’ User waits 3+ minutes, nothing arrives

This happens approximately 30-40% of the time on first language selection.

When user clicks β€œRussian” a second time β€” response arrives correctly.

My analysis: ManyChat sends the webhook request and waits for
Webhook Response. The scenario runs but something in the timing
causes ManyChat to not receive or not process the Webhook Response
correctly on the first attempt.

Possible cause: When user clicks language button, ManyChat may
send the webhook before the Flow is fully ready to process
the response, or there’s a timing issue between the language
selection trigger and the External Request execution.

═══════════════════════════════
WHAT I NEED
═══════════════════════════════

  1. Exact step-by-step implementation of message_id /
    is_processing mutex lock in Make to prevent race condition

  2. Which Make modules to use:
    Data Store β€œSearch” β†’ filter β†’ β€œAdd record” with processing flag?
    Or different approach?

  3. How to solve the β€œno response on first language selection” issue

  4. Should I keep or remove the Webhook Response module?
    If remove β€” how to send response back to ManyChat correctly
    for Instagram (aware of Message Tag limitations)?

Thank you very much for any help.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)