πŸ“Š Send daily Instagram insights email reports with Meta Graph API and Gmail

⚑ 64 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 daily and pulls an Instagram Business account’s profile, posts, and per-post insights from the Meta Graph API, then compiles a mobile-friendly HTML summary and sends the report to a recipient via Gmail.

How it works

  1. Runs every day at 23:59 based on the schedule trigger.
  2. Sets the Instagram Page access token, Page/IG user ID, API version, timezone offset, and the target date derived from the trigger.
  3. Fetches the Instagram profile details and up to 100 recent media posts from the Meta Graph API.
  4. Filters posts to only those published within the configured local-day window and splits them into individual items (or generates a no-posts placeholder if none match).
  5. For each matching post, requests post insights (likes, comments, saves, reach, and additionally views/shares where available) from the Meta Graph API and merges them back into each post.
  6. Aggregates totals and breakdowns for photo vs video posts, identifies top-performing posts by key metrics, and generates an HTML email report.
  7. Sends the formatted report email through Gmail to the configured recipient.

Setup

  1. Create a Meta/Instagram Graph API access token with permissions to read your Instagram Business account, and set the access token, Instagram Business account (Page/IG user) ID, Graph API version, and timezone offset.
  2. Add a Gmail OAuth2 credential and select it in the Gmail email-sending step.
  3. Update the recipient email address in the report-building code so the report is delivered to the correct inbox.
  4. If needed, adjust the schedule time to match when you want the daily report to run.

Requirements

Customization

πŸ”— Nodes Used

HTTP Request, Gmail, Schedule Trigger

πŸ“₯ Import

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

πŸ“– Importing guide Β· πŸ”‘ Credential setup