๐Ÿ“Š Track positive Instagram comment sentiment with OpenAI, Google Sheets, and Gmail

โšก 14 views ยท ๐Ÿ“Š Market Research & Insights

๐Ÿ’ก 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.

View All Scrapers

Description

Quick overview

This workflow runs twice daily to fetch recent Instagram post comments via the Instagram Graph API, uses OpenAI to classify sentiment, saves new positive comments to Google Sheets, and emails an HTML digest of the dayโ€™s positive comments to your team using Gmail.

How it works

  1. Runs every day at 9 AM to fetch the most recent Instagram media posts from the Instagram Graph API.
  2. Pulls up to a set number of comments per post and enriches each comment with post context like the permalink.
  3. Sends each comment to OpenAI Chat Completions to classify it as POSITIVE, NEUTRAL, or NEGATIVE with a score.
  4. Filters to keep only non-empty comments classified as POSITIVE.
  5. Checks Google Sheets for an existing row with the same Instagram comment ID to prevent duplicates.
  6. Appends new positive comments to a Google Sheets tab for later reporting.
  7. Runs every day at 8 PM to read the saved rows from Google Sheets, build a formatted HTML summary for today, and send the digest email via Gmail.

Setup

  1. Create a Facebook app with Instagram Graph API access and provide a long-lived access token plus your Instagram Business Account ID in the workflowโ€™s configuration step.
  2. Add an OpenAI API credential for the Chat Completions request.
  3. Create a Google Sheet with a โ€œPositive Commentsโ€ tab and columns matching the workflow fields, then add Google Sheets OAuth and replace the placeholder spreadsheet ID.
  4. Add a Gmail OAuth connection and set the recipient email address used for the daily digest.

๐Ÿ”— Nodes Used

Google Sheets, HTTP Request, Gmail, Schedule Trigger

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup