Skip to main content

Generate weekly Twitter & Facebook performance reports with GPT-4o analysis

Workflow preview

Workflow preview
100%
Generate weekly Twitter & Facebook performance reports with GPT-4o analysis preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Description Automate your weekly cross platform social media analytics workflow with AI powered insights. This system retrieves real time Twitter (X) and Facebook data, validates and merges th...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.lmchatazureopenai, n8n-nodes-base.gmail, n8n-nodes-base.httprequest, n8n-nodes-base.facebookgraphapi, n8n-nodes-base.code, n8n-nodes-base.merge, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate weekly Twitter & Facebook performance reports with GPT-4o analysis
Workflow name
Generate weekly Twitter & Facebook performance reports with GPT-4o analysis

Description

Automate your weekly cross-platform social media analytics workflow with AI-powered insights. 📊🤖 This system retrieves real-time Twitter (X) and Facebook data, validates and merges the metrics, formats them via custom JavaScript, generates a visual HTML summary with GPT-4o, stores structured analytics in Notion, and broadcasts key results through Gmail and Slack — all in one seamless flow. Perfect for marketing, social media, and growth teams tracking weekly engagement trends. 🚀💬

What This Template Does

1️⃣ Starts on manual execution to fetch the latest performance data. 🕹️ 2️⃣ Collects live metrics from both Twitter (X API) and Facebook Graph API. 🐦📘 3️⃣ Merges API responses into one unified dataset for analysis. 🧩 4️⃣ Validates data completeness before processing; logs missing or invalid data to Google Sheets. 🔍 5️⃣ Uses JavaScript to normalize data into clean JSON structures for AI analysis. 💻 6️⃣ Leverages Azure OpenAI GPT-4o to generate a professional HTML analytics report. 🧠📈 7️⃣ Updates Notion’s “Growth Chart” database with historical metrics for record-keeping. 🗂️ 8️⃣ Sends the HTML report via Gmail to the marketing or analytics team. 📧 9️⃣ Posts a summarized Slack message highlighting key insights and platform comparisons. 💬

Key Benefits

✅ Eliminates manual social media reporting with full automation. ✅ Ensures clean, validated data before report generation. ✅ Delivers visually engaging HTML performance summaries. ✅ Centralizes analytics storage in Notion for trend tracking. ✅ Keeps teams aligned with instant Slack and Gmail updates.

Features

  • Dual-platform analytics integration (Twitter X + Facebook Graph).
  • Custom JavaScript node for data normalization and mapping.
  • GPT-4o model integration for HTML report generation.
  • Real-time error logging to Google Sheets for transparency.
  • Notion database update for structured performance tracking.
  • Slack notifications with emoji-rich summaries and insights.
  • Gmail automation for formatted weekly performance emails.
  • Fully modular — easy to scale to other social platforms.

Requirements

  • Twitter OAuth2 API credentials for fetching X metrics.
  • Facebook Graph API credentials for retrieving page data.
  • Azure OpenAI credentials for GPT-4o AI report generation.
  • Notion API credentials with write access to “Growth Chart.”
  • Slack Bot Token with chat:write permission for updates.
  • Google Sheets OAuth2 credentials for error logs.
  • Gmail OAuth2 credentials to send HTML reports.

Environment Variables

  • TWITTER_API_KEY
  • FACEBOOK_GRAPH_TOKEN
  • AZURE_OPENAI_KEY
  • NOTION_GROWTH_DB_ID
  • SLACK_ALERT_CHANNEL_ID
  • GOOGLE_SHEET_ERROR_LOG_ID
  • GMAIL_MARKETING_RECIPIENTS

Target Audience

📈 Marketing and growth teams analyzing engagement trends. 💡 Social media managers tracking cross-channel performance. 🧠 Data and insights teams needing AI-based summaries. 💬 Brand strategists and content teams monitoring audience health. 🧾 Agencies and operations teams automating weekly reporting.

Step-by-Step Setup Instructions

1️⃣ Connect all required API credentials (Twitter, Facebook, Azure OpenAI, Notion, Gmail, Slack, Sheets). 2️⃣ Replace the username and page IDs in the HTTP Request nodes for your brand handles. 3️⃣ Verify the JavaScript node output structure for correct field mapping. 4️⃣ Configure the Azure GPT-4o prompt with your preferred tone and formatting. 5️⃣ Link your Notion database and confirm property names match (followers, likes, username). 6️⃣ Add recipient email(s) in the Gmail node. 7️⃣ Specify your Slack channel ID for automated alerts. 8️⃣ Test run the workflow manually to validate end-to-end execution. 9️⃣ Activate or schedule the workflow for regular weekly reporting. ✅

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 - When clicking ‘Execute workflow’

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

Block 2 - Configure GPT-4o Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatAzureOpenAi - lmChatAzureOpenAi
Config choices
Version 1

Block 3 - Send Email Summary to Marketing Team

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

Block 4 - Fetch Recent Tweets

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

Block 5 - Fetch Recent Facebook Posts

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

Block 6 - Format Facebook Post Data

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

Block 7 - Format Twitter Post Data

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

Block 8 - Merge Platform Datasets

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

Block 9 - Validate API Response Integrity

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 10 - Log Errors in Google Sheets

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

Block 11 - Consolidate Social Data Summary

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

Block 12 - Generate HTML Social Performance Report

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 13 - Sticky Note

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

Block 14 - Sticky Note1

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

Block 15 - Sticky Note2

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

Block 16 - Sticky Note3

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

Block 17 - Sticky Note4

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

Block 18 - Sticky Note5

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

Block 19 - Sticky Note6

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

Block 20 - Sticky Note7

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

Block 21 - Sticky Note8

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

Block 22 - Sticky Note9

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

3. Summary Table

Workflow Generate weekly Twitter & Facebook performance reports with GPT-4o analysis
Complexity advanced
Nodes 22
Categories Market Research, AI Summarization
Author Rahul Joshi
Published 06 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10556/10556.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 Generate weekly Twitter & Facebook performance reports with GPT-4o analysis do?

Description Automate your weekly cross platform social media analytics workflow with AI powered insights. This system retrieves real time Twitter (X) and Facebook data, validates and merges th...

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.