n8n

How to Automate Facebook Comment Collection?

Pull the latest Facebook Page posts and comments into clean records so your team can review feedback faster. Great for social media and community teams that need quick visibility on what people are saying under recent posts.

The flow runs on demand. You set the Page ID and the number of posts to fetch. It calls the Facebook Graph API to get the page feed, splits the posts, and then gets comments for each post in reverse chronological order. A code step reverses one branch so the merge stays aligned by position. It filters out empty results, splits comments into single rows, and maps clear fields like post id and created time. The end result is a tidy stream of post and comment data that is ready for reporting or export to your tools.

You need page access and Facebook Graph API credentials with the right permissions. Add your Page ID and choose how many posts to review. Expect faster moderation, simpler reporting, and fewer copy and paste tasks. Use it for daily engagement checks, pulling comment sentiment samples, or tracking comment volume on new campaigns.

What are the key features?

  • On demand run using a manual trigger for quick checks
  • Simple parameters to set Page ID and how many posts to fetch
  • Uses Facebook Graph API v20 to read the page feed with a limit
  • Splits the feed so each post is processed on its own
  • Gets comments for each post with fields id from message created time and comment count
  • Orders comments in reverse chronological for the most recent first
  • Reverses one branch so the merge lines up by position
  • Filters out null comments and splits them into single items
  • Maps clear result fields like post id and created time for easy export

What are the benefits?

  • Reduce manual review from 60 minutes to 5 minutes for the latest 10 posts
  • Automate 90 percent of copy and paste when collecting comments
  • Improve data accuracy by removing manual entry errors
  • Handle up to 50 posts per run by changing one number
  • Unify post and comment data in one structured stream

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Facebook Graph API. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create a Facebook Graph API credential. If unsure, double click any Facebook Graph API node, choose Credential to connect with, click Create new credential, and follow the on screen steps to sign in and grant page permissions.
  4. Confirm your Facebook user has access to the target Page and the right scopes to read page feed and comments.
  5. Open the node named Set PageID & Number of Latest Posts and enter your Page ID and the number of posts you want to pull.
  6. Open the Facebook Graph API node that reads the feed and confirm the endpoint uses {{$json.FB_Page_Id}}/feed and that the limit parameter points to Number_of_Latest_Posts.
  7. Save the workflow and click Execute to run a test. Check the Split Out Posts node to confirm you see one item per post.
  8. Open the Facebook Get Each Post Comments node and verify you see recent comments with id from message created time and comment count fields.
  9. Inspect the Merge Post & Comments output. You should see post data aligned with the related comments. If not, confirm the Reverse Item to Match another Branch node is connected to the second input of the Merge node.
  10. Review the Filter Out Null Comments and Split Out Comments results. You should see only real comments. Adjust the number of latest posts if you need more or fewer records.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Facebook Graph API

Sign up

Free: $0 (no direct API charges; usage subject to rate limits)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.