Manychat + n8n for IG Direct: an old reply is sent before the webhook finishes
Hello everyone!
I’m building an Instagram Direct agent: ManyChat (Instagram Direct Messages) → External Request → n8n → reply to the user.
What’s happening (the issue)
A user messages us in IG DM.
ManyChat triggers an External Request (webhook to n8n) and immediately sends a message to the user, but it’s an old value (looks like it’s pulled from a custom field from a previous run).
A few seconds later, n8n finishes processing and produces a new reply (I can see the correct text in the output of the last n8n node).
But the user doesn’t receive anything else — they only get the early “old” message that was sent before the webhook completed.
How can I force ManyChat to wait for the webhook response (External Request) so the Send Message uses the updated value? Is there a reliable way to make the flow pause “synchronously” between External Request and the following blocks?
Page 1 / 1
Hi, @lvshts!
Just set a Smart Delay step between your External Request and the answer/message with the custom field that receives the response.
That should do the trick. 😉
It is also important to remember that Manychat has a 10sec timeout for external requests. So keep an eye on your n8n automation processing time to stay under that time. If it takes more than 10sec to respond, you have to use Manychat's API to set the custom field value asynchronously and set the smart delay to more time.
Hi, @Fabio Gaulke !
Thank you for your suggestion. I done what you suggested, but it still works wrong. The same problem. N8N complete in 30-50 seconds. What is my mistake? I attached my automation.
Hi, @Fabio Gaulke !
Thank you for your suggestion. I done what you suggested, but it still works wrong. The same problem. N8N complete in 30-50 seconds. What is my mistake? I attached my automation.
If n8n takes more than 10sec, the only way is to do it in an asynchronous way… in other words, the automation end once it sends the request, n8n processes it and after 30-50 seconds, it uses Manychat API to set the response in a custom field and starts an automation just to deliver the answer.
In this example I'm using a message trigger and a Data Collection block, but you're using the Default Reply trigger, this means you just need the trigger and the Action + External Request
In the request, you can simply insert the Full Contact Data and send it to n8n or build yout JSON with just the fields you wish: PS: you must also send the subscriber ID to be able to set the response field and start the second automation.
NOTHING will be set in response mapping.
Now, the second automation can be as simple as this:
No trigger, just a message step with the custom user field you use to store the LLM Response.
In n8n:
This is my test automation.
Web hook receives the information from Manychat
Edit Fields (var) isolates the subscriber_id and last_input_text
LLM Chain does a test prompt (mine is to translate the incoming text to gerrman 😅)
Wait node to be sure it will take more than 10sec to process