π± Reply to Instagram and Facebook comments via Meta webhooks and DMs
β‘ 932 views Β· π± Social Media & Email Marketing
π‘ Pro Tip β Heads up β if this workflowβs Instagram scraping breaks (it happens whenever Meta updates their frontend), ScraperNode is a community node that handles profiles, posts, reels, and comments without any HTML parsing.
Description
Quick Overview
This workflow receives Meta webhooks for Instagram and Facebook Page comments, verifies the webhook subscription handshake, and then posts an optional public reply and/or sends a private DM to the commenter via the Meta Graph API.
How it works
- Receives an incoming webhook request from Meta for either verification (hub.challenge) or comment events.
- Validates Metaβs subscription request by checking hub.mode and hub.verify_token, and returns the hub.challenge when verification is requested.
- Acknowledges comment event deliveries with a 200 OK response so Meta considers the webhook successfully received.
- Parses the webhook payload to extract new Instagram comments or Facebook Page feed comments, skipping self-comments and optionally filtering by a configured keyword.
- Builds Meta Graph API requests for a public comment reply and a private reply DM based on your configured messages.
- Sends the public reply and/or DM using HTTP requests to the Instagram Graph API or Facebook Graph API with your access token.
Setup
- Create a Meta app, enable Webhooks, and ensure you have the required permissions for Instagram (instagram_business_basic, instagram_business_manage_comments, instagram_business_manage_messages) and/or Facebook Pages (pages_manage_engagement, pages_read_engagement, pages_messaging).
- In the Configuration (EDIT ME) step, set your access_token, choose a verify_token, and optionally set keyword, comment_reply, dm_message, and the Graph api_version.
- Copy the Production webhook URL from the Webhook (Meta) trigger into the Meta Webhooks configuration, set the same verify_token, and subscribe to Instagram comments and/or Facebook Page feed comment events.
π Nodes Used
HTTP Request, Webhook
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File