Auto reply on FB/IG with a DM if someone comments your post with a certain keyword they add

Describe the problem/error/question

I’m running n8n locally, all is working perfect, I made a workflow that when somebody comments my post on FB or IG? I get a webhook payload. Those who comment can react with a keyword (in have a postgres DB with matching keywords and explanations text), when I find the right keyword then I want to send them a DM back with the requested explanation of that keyword. This is working perfectly, but only by sending it to myself with the https://graph.facebook.com/v24.0/me/messages link. ofcourse.. this is only for me. I want that this can work for everybody who leaves a direct comment on my posts, but this is not working. I have been searching for days at graph API explorer to test all kind of stuff, but it seems I’m not able to send it back to anybody else except me. when I try do post a messsage back in the graph API explorer, then I get errors. I have now made a new app in the developers facebook page, where I have tested the pages_messaging permission. I have to wait for an other 24h before I can get : advance access, what I think I need in order to send people the dm. Is there anybody who made this working without any paying API service like manychat etc?
Extra info, I’m using a post to the /me/messages, with query parameters access_token and my token, headers as : Content-Type, application/json, body with the messaging_type , recipient.id, message.text

this does work perfectly but now I want to roll this out so that everybody gets the DM back.

What is the error message (if any)?

Please share your workflow


Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.3.4
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: linux
1 Like

HI @Deech Welcome to the community!
I have never built something like that before but the service i recommend if this is going to get used by you only and would not go in production use Apify:

And same with facebook you would find a lot of things there as actors, and this would make things easier for you and they also provide 5$ worth of free credits so i guess that should be enough for learning.

the workflow will only be use by me and only for the FB and IG page I manage.
I know there are many payed solutions, but that’s the point I want to investigate and try to setup.
so that more people who wants to do this will also do this, for free, full managed by themself :wink:

1 Like

@Deech Like i would not say that free options does not exist but the quality of work i mean the service you are expecting for free is pretty much hard to get , like fetching comments from Instagram and Facebook using n8n which means you want API access , i would recommend going with APIfy as i also use that, good luck!

I know there are tons of paying services. meanwhile I have done it with meta api only :wink:
I took a serious amount of time, and a lot of settings inside meta.
Now I have to request an official approval to activate it to make it workable for all users. now it’s only with my account I can do it and test it. cross fingers they will approve it. they are very strickt in all, and this need quit some description and screencasts for them, but I did everything according their needs, so I think it will work. I keep everybody informed.

1 Like