{
  "name": "Generate automated social media reports with GPT-4o, Twitter, Facebook & Notion",
  "nodes": [
    {
      "id": "6a10854f-9ef6-459e-a92d-bcb1c3dfde67",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1072,
        32
      ]
    },
    {
      "id": "01b1816a-7c00-4421-919d-0c39ac9bd25e",
      "name": "Configure GPT-4o Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        816,
        240
      ]
    },
    {
      "id": "2471b861-b399-43a2-b8ef-920c987d6ea1",
      "name": "Fetch Twitter Metrics (X API)1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -752,
        -96
      ]
    },
    {
      "id": "86e9c424-0bee-4541-8947-832312ae4124",
      "name": "Fetch Facebook Page Metrics (Graph API)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -752,
        192
      ]
    },
    {
      "id": "5ee82890-20a4-4bd0-b314-263004de1c34",
      "name": "Merge Platform Responses",
      "type": "n8n-nodes-base.merge",
      "position": [
        -368,
        16
      ]
    },
    {
      "id": "920654bc-4ccc-40ee-89a4-97a08712a5a4",
      "name": " Validate API Response Integrity",
      "type": "n8n-nodes-base.if",
      "position": [
        -80,
        16
      ]
    },
    {
      "id": "270dc82a-628c-4e42-bd54-a13f0f5c62e5",
      "name": "Log Errors in Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        608
      ]
    },
    {
      "id": "576f825c-3490-47a1-9fa2-f542ca5c7a33",
      "name": " Normalize & Format Social Data (JavaScript)",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        0
      ]
    },
    {
      "id": "264c81c4-cc25-4396-9117-1cb4a2d1a374",
      "name": "Generate HTML Social Performance Report (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        816,
        0
      ]
    },
    {
      "id": "92c1e648-f2c8-44e4-af2d-d0cbed1dc182",
      "name": "Save Report to Notion Database",
      "type": "n8n-nodes-base.notion",
      "position": [
        528,
        -592
      ]
    },
    {
      "id": "070f471b-f231-488a-ae64-2584a58655b6",
      "name": " Send Email Summary to Marketing Team",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1520,
        352
      ]
    },
    {
      "id": "ee3396ce-91eb-4d57-8459-fc91dc48807b",
      "name": "Announce Summary in Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1504,
        -368
      ]
    },
    {
      "id": "5bd4dedd-90eb-4c1e-a0a2-1b3a3b0ee544",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        -736
      ],
      "parameters": {
        "width": 624,
        "height": 496,
        "content": "## Cross-Platform Growth Tracker 🚀  \nThis workflow automatically tracks and reports weekly follower and engagement growth across Twitter (X) and Facebook.\n\nIt aggregates key metrics, generates a style"
      }
    },
    {
      "id": "48f3dd13-9d84-4f49-bb91-015af6510f18",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -416
      ],
      "parameters": {
        "width": null,
        "height": 896,
        "content": "## Data Fetching Layer  \nFetches live analytics data from Twitter (X) and Facebook Graph API.  \nCaptures follower count, likes, tweets/posts, and media uploads for both platforms.  \nProvides the raw i"
      }
    },
    {
      "id": "c1ea7ae8-8da6-45b8-852d-1d512ddfc046",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -160
      ],
      "parameters": {
        "width": 272,
        "height": 368,
        "content": "## Dataset Merging  \nMerges Twitter and Facebook API responses into a unified dataset.  \nMaintains key engagement fields and creates a standardized structure ready for validation.\n"
      }
    },
    {
      "id": "996b1f09-7a63-4281-838b-bdfcd713364f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -208
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "## Data Validation Layer  \nEnsures both API responses contain valid data.  \nIf missing or invalid, logs the issue to Google Sheets and prevents incomplete processing.\n"
      }
    },
    {
      "id": "cdb1e0dc-adac-4b12-83a9-8f9bbe8fb968",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -240
      ],
      "parameters": {
        "width": null,
        "height": 464,
        "content": "## Normalization & Formatting  \nCleans, renames, and structures merged data into JSON objects under `twitter` and `facebook` keys.  \nEnsures consistent field naming and metric availability for AI summ"
      }
    },
    {
      "id": "8c0c7a1c-bef7-47eb-b0f9-e0f531b2be6e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -304
      ],
      "parameters": {
        "width": 352,
        "height": 704,
        "content": "## AI Report Generation (GPT-4o)  \nGPT-4o transforms normalized data into a visually styled HTML email summary.  \nIncludes:\n- Total reach overview  \n- Platform comparison tables  \n- Emoji-based insigh"
      }
    },
    {
      "id": "09a9fef7-458e-4d49-8572-15c300fdccbb",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -848
      ],
      "parameters": {
        "width": null,
        "height": 480,
        "content": "## Data Storage in Notion  \nSaves structured Twitter and Facebook metrics in the “Growth Chart” Notion database.  \nCreates historical records for growth visualization and long-term trend tracking.\n"
      }
    },
    {
      "id": "b8065c12-da97-4f59-9ebc-6f7f7d34415f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        -656
      ],
      "parameters": {
        "width": null,
        "height": 512,
        "content": "## Slack Announcement  \nPosts a summary message to the Slack user/channel with weekly metrics and platform comparison.  \nIncludes emoji-based insights such as “🚀 Twitter shows stronger engagement” or "
      }
    },
    {
      "id": "4795aadb-4ca8-40c2-a7f7-0fab9ef6773c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        32
      ],
      "parameters": {
        "width": null,
        "height": 576,
        "content": "## Email Dispatch  \nSends the HTML performance report to the marketing team via Gmail.  \nSubject: “📊 Weekly Social Media Performance Report — Twitter & Facebook Overview.”  \nEnsures consistent deliver"
      }
    },
    {
      "id": "df7f5541-09cd-4cad-b05f-62076ae80104",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        336
      ],
      "parameters": {
        "width": null,
        "height": 544,
        "content": "## Error Logging  \nCaptures workflow or API errors and logs them into Google Sheets.  \nAllows ongoing monitoring of API response reliability and workflow health.\n"
      }
    }
  ],
  "connections": {
    "Configure GPT-4o Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate HTML Social Performance Report (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Merge Platform Responses": {
      "main": [
        [
          {
            "node": " Validate API Response Integrity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Announce Summary in Slack": {
      "main": [
        []
      ]
    },
    "Fetch Twitter Metrics (X API)1": {
      "main": [
        [
          {
            "node": "Merge Platform Responses",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    " Validate API Response Integrity": {
      "main": [
        [
          {
            "node": " Normalize & Format Social Data (JavaScript)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Errors in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch Twitter Metrics (X API)1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Facebook Page Metrics (Graph API)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Facebook Page Metrics (Graph API)": {
      "main": [
        [
          {
            "node": "Merge Platform Responses",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    " Normalize & Format Social Data (JavaScript)": {
      "main": [
        [
          {
            "node": "Generate HTML Social Performance Report (AI)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save Report to Notion Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML Social Performance Report (AI)": {
      "main": [
        [
          {
            "node": " Send Email Summary to Marketing Team",
            "type": "main",
            "index": 0
          },
          {
            "node": "Announce Summary in Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}