Send daily Instagram insights email reports with Meta Graph API and Gmail
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (7)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Gmail
n8n-nodes-base.gmail - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Merge
n8n-nodes-base.merge
What it does
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 - INSTAGRAM / META CREDENTIALS - Instagram Page Access Token (Long-Lived or System User Token) - Must have these permissions: instagrambasic, instagrammanageinsights, pagesreadengagement, pagesshowlist - Get it from Meta Business Suite → Settings → Advanced → Page Access Tokens, or via Graph API Explorer. Use a System User Token if possible — it never expires. Do NOT paste the token with a leading space. - Instagram Business Account ID (Page ID) - A numeric ID like 170000000000000. Find it by calling: - graph.facebook.com/me?fields=id&accesstoken=YOURTOKEN - The account must be an Instagram Business or Creator account — personal accounts are not supported by Meta's Graph API. - EMAIL CREDENTIALS - Gmail OAuth2 Connection inside n8n - Go to n8n → Credentials → New → Gmail OAuth2 and connect the Gmail account you want to send reports from. - Also set the recipient email inside the 🎨 Build HTML Email Report node: - const recipientEmail = '[email protected]'; - TIMEZONE - Set timezoneOffsetHours in the 📝 Instagram Page Credentials node to your UTC offset. - Bangladesh = 6, India = 5.5, UAE = 4, UK = 0, USA EST = -5 - n8n INSTANCE - A running n8n instance (self-hosted or cloud). No extra plugins or packages needed — the workflow uses only built-in n8n nodes. Customization - INSTAGRAM PAGE - Swap in any Instagram Business or Creator account by updating the Access Token and Page ID in the 📝 Instagram Page Credentials node. No other node needs to be touched. - REPORT RECIPIENT EMAIL - Change who receives the daily report by updating the recipientEmail constant inside the 🎨 Build HTML Email Report node. Any valid email address works. - SCHEDULE TIME - By default the report runs every day at 23:59. You can change the trigger time inside the Schedule Trigger node — for example, run it at 08:00 for a morning summary instead. - TIMEZONE - Set your local UTC offset in the 📝 Instagram Page Credentials node (timezoneOffsetHours). This controls which posts are counted as "today's posts" based on your local midnight-to-midnight window. - API VERSION - The apiVersion field defaults to v19.0. If Meta releases a newer Graph API version, simply update this value in the 📝 Instagram Page Credentials node — no other changes required. - EMAIL SENDER ACCOUNT - Connect any Gmail account via OAuth2 in the 📧 Send Report Email node. The