Skip to main content

Send weekly social analytics reports with LinkedIn, X, Instagram, Google Sheets and GPT-4o

Workflow preview

Workflow preview
100%
Send weekly social analytics reports with LinkedIn, X, Instagram, Google Sheets and GPT-4o preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow runs every Monday, pulls the last 7 days of posts from LinkedIn, X (Twitter), and Instagram, normalizes engagement metrics, logs raw post data to Google Sheets, calcula...

Best for

  • Market Research automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.twitter, @mookielianhd/n8n-nodes-instagram.instagram, n8n-nodes-base.merge, n8n-nodes-base.code, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mychel Garzon.

Original n8n.io source

1.1 Workflow description

Title
Send weekly social analytics reports with LinkedIn, X, Instagram, Google Sheets and GPT-4o
Workflow name
Send weekly social analytics reports with LinkedIn, X, Instagram, Google Sheets and GPT-4o

Quick overview

This workflow runs every Monday, pulls the last 7 days of posts from LinkedIn, X (Twitter), and Instagram, normalizes engagement metrics, logs raw post data to Google Sheets, calculates a weighted engagement rate, generates strategy recommendations with OpenAI (GPT-4o), and emails an HTML report.

How it works

  1. A schedule trigger fires every Monday at 9 AM and passes execution to the WES Config node, which defines the engagement weights used across the entire pipeline: likes (1), comments (3), shares (5), saves (4).Runs every Monday at 9:00 AM and sets the engagement weights used for scoring (likes, comments, shares, saves).
  2. LinkedIn posts, X tweets, and Instagram media from the last 7 days are fetched in parallel. LinkedIn and X results are merged first, then combined with Instagram into a single unified stream.Fetches up to 100 recent items in parallel from LinkedIn UGC posts, X (Twitter) search results, and Instagram user media.
  3. Each post is normalized into a shared schema: platform, date, likes, comments, shares, saves, impressions, text, and URL. Posts older than 7 days and empty items are filtered out before anything is calculated.Merges the three streams, normalizes each item into a unified schema, and filters out empty items and posts older than 7 days.
  4. The Weighted Engagement Score is calculated for each post and aggregated into platform rankings, best and worst performers, total impressions, and an overall average engagement rate for the week.Logs each normalized post to Google Sheets in batches, capturing any sheet write errors without stopping the run.
  5. GPT-4o receives the aggregated stats and generates 3 actionable strategy recommendations in clean HTML format, ready to be embedded directly into the email report.Calculates weekly analytics using a Weighted Engagement Score (WES), including total posts, impressions coverage, platform rankings, and best/worst posts by engagement rate.
  6. Normalized posts are written to Google Sheets in batches of 50 with date, platform, content preview, impressions, total engagement, and URL. Sheet write errors are captured per batch without crashing the loop.Sends the weekly performance summary to OpenAI (GPT-4o) to generate three actionable strategy recommendations in HTML.
  7. Once both the Sheets logging and AI insights branches complete, all data is merged into a single payload and sent as a formatted HTML email report with key metrics, platform rankings, and AI recommendations.Combines the analytics, any Google Sheets logging errors, and the AI output, then emails a formatted weekly HTML report.

Setup

  1. Set three environment variables in your n8n instance: LINKEDIN_OWNER_URN (your LinkedIn person or organization URN), TWITTER_SEARCH_QUERY (the search query or handle to monitor, e.g. from:yourusername), and ANALYTICS_SPREADSHEET_ID (the Google Sheets document ID where raw posts should be logged).
  2. Connect your LinkedIn OAuth2 credential to the Get LinkedIn Posts node, your X (Twitter) OAuth2 credential to the Search Tweets node, and your Instagram credential to the Get media node.
  3. Connect your OpenAI credential to the AI Strategy Insights node and your Google Sheets credential to the Log Raw Posts to Sheets node.
  4. Open the Email Weekly Report node and update the fromEmail and toEmail fields to match your sender and recipient addresses. Connect your SMTP or email credentials to the node.
  5. Open the WES Config node and adjust the four weight values to reflect your team's engagement priorities. The defaults are likes 1, comments 3, shares 5, and saves 4.

Requirements

  • LinkedIn OAuth2 account with access to your organization or personal post feed
  • X (Twitter) OAuth2 account with search access
  • Instagram account connected via the Instagram community node
  • OpenAI API key with access to GPT-4o
  • Google Sheets document with a Sheet1 tab ready to receive raw post data
  • SMTP or email credential configured for report delivery

Customization

  • Adjust the four weight values in the WES Config node to prioritize the engagement signals that matter most to your team, increasing the share weight, for example, emphasizes content virality over conversation.
  • Modify the GPT-4o prompt in the AI Strategy Insights node to request different output formats, focus on specific platforms, or ask for more or fewer recommendations.
  • Change the schedule in the Every Monday 9 AM node to run on a different day or frequency, daily, biweekly, or monthly, reporting all work with the same pipeline.
  • Extend the Google Sheets columns in the Log Raw Posts to Sheets node to capture additional normalized fields, such as raw WES score per post or stock count per platform.
  • Add a Slack or Teams notification node after the Email Weekly Report node to ping a channel when the report has been sent successfully.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Every Monday 9 AM

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.1

Block 2 - WES Config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Get LinkedIn Posts

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Search Tweets

Type / Role
n8n-nodes-base.twitter - twitter
Config choices
Version 2

Block 5 - Get media

Type / Role
@mookielianhd/n8n-nodes-instagram.instagram - instagram
Config choices
Version 1

Block 6 - Merge LI & TW

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 2.1

Block 7 - Merge All Streams

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 2.1

Block 8 - Normalize & Validate Posts

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Loop Over Batches

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 10 - Log Raw Posts to Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.4

Block 11 - Capture Sheet Errors

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Calculate Analytics (WES)

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - AI Strategy Insights

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.1

Block 14 - Wait for All Branches

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 2.1

Block 15 - Combine Data & AI Output

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Email Weekly Report

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 17 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Send weekly social analytics reports with LinkedIn, X, Instagram, Google Sheets and GPT-4o
Complexity advanced
Nodes 23
Categories Market Research, AI Summarization
Author Mychel Garzon
Published 21 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15897/15897.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send weekly social analytics reports with LinkedIn, X, Instagram, Google Sheets and GPT-4o do?

Quick overview This workflow runs every Monday, pulls the last 7 days of posts from LinkedIn, X (Twitter), and Instagram, normalizes engagement metrics, logs raw post data to Google Sheets, calcula...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research, AI Summarization use case.