Issue with a workflow

I have setup an automation to do Automated Instagram commenting using webhook as the trigger
And before the auto reply I have setup a filter to filter out if the DM is from the account owner itself. The automated DM should only reply if the DM is from a user. It is working perfectly fine when we test it in Instagram web. But when we test it in Instagram mobile app, the first reply for the user is done correctly but after the automated DM the flows runs again and detects that the DM was from the account owner using the filter check but now the flows starts running again and gives us an automated reply non stop like a loop, it looks like a bug to me , I am not sure how to solve it.

Can anyone help me??

1 Like

Hey @anishani

This is odd, you mentioned it working in web, but in the mobile app you’re seeing issues, how are you connecting using the API or appium / browerless?

If you like you can share the workflow, and I can take a further into into it.

n8n attach workflow

Best regards,

Samuel

Hi Samuel, thank you for helping me out

I am using the Meta official API
Also if you see the filter node, that is the node used to filter out DM based on the sender

1 Like

Thanks, and if you check execution history how different are the payloads / responses, my thoughts atm are

Add a second condition to ignore messages containing your automated text (easy if generic, but am guessing it’s more ai agent reply from RAG)

It might be worth trying to add some sleeps / delays in, maybe it’s calling to quick?

I would start with checking the responses and why it’s different, this would help further into finding why the filter is failing, it that all look good I wouldn’t say it a glitch / bug, because it’s filtering okay on insta web

But if you’re replying using the same webhook flow, consider adding a short delay + flag check like writing a short status to a Airtable or memory variable to avoid loops within 10–30s of last message.

Without looking at your whole flow, this is my guess.

Hope that helps.

Hey Samuel, I can also share the whole flow. Heres the thing, after checking the executions, the filter check to identify the sender is working perfectly fine even for the mobile app and its stops right there but I don’t know what happens after that the webhook triggers again but this time without any input message and then the entire flows executes and this time the filter node is also executing and keeping it instead of discarding even though the automated message was sent from the owner side. The worst part is keeps running again and again and it never stops until we deactivate the flow itself.

1 Like

Okay thanks,

I’d have to review the workflow, maybe try breaking it down, so you only share the problem part.

Am not sure atm, hoping others may chime in too.

Best Samuel

This is my entire flow and if you could see the comment agent is working fine, we are facing the problem with the DM Agent.

To my surprise, even the filter node previous to the agent step is working fine and it is in fact discarding the item if the account ID and sender ID is the same, but right after that the flows triggers again but this time without any message and the flows continues and gets into loop and never stops unless we hit the Inactive button.

I think maybe just filter also no message, this will clear it running hopefully it stops that loop.
@anishani can you try that let me know how it responds if it keeps making multiple executions after please.

we can look further into it, but maybe that is the workaround for now.

Best regards,

Samuel

@anishani Thanks for the pm, so to confirm you have tried this, I still don’t have access to the workflow, please can you try share it, you can export that workflow, and share via drive if large file or here. I’ll take a further look into it, just ping me one ready.

Best regards,

Samuel