{
  "name": "Extract and analyze 🔬 ALL Facebook post comments with sentiment AI using Gemini",
  "nodes": [
    {
      "id": "edd58237-a0f1-462c-b1c6-414d216a8f33",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1488,
        160
      ]
    },
    {
      "id": "d42dac6b-6de8-4e69-9a46-2a1ff588f8a1",
      "name": "Call 'Facebook'",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -256,
        -128
      ]
    },
    {
      "id": "9def7b4f-d741-43de-a080-205fe5d1303d",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -1488,
        624
      ]
    },
    {
      "id": "edf74742-4a6c-422b-a403-a91a4803e1fd",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -176,
        624
      ]
    },
    {
      "id": "682d7853-7623-4e6c-b84c-9c1a2f21a374",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -752,
        752
      ]
    },
    {
      "id": "29f5c270-146f-4d9d-ad9f-38784bd9b364",
      "name": "Sentiment Analysis",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        -816,
        496
      ]
    },
    {
      "id": "6edda9f7-6f4c-4bd4-867a-228b8f9dbafc",
      "name": "Set Fb post ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -1264,
        160
      ]
    },
    {
      "id": "64b9d159-ebdd-4e37-94cc-8033b905a305",
      "name": "Get Fb Post",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -1040,
        160
      ]
    },
    {
      "id": "0dd54510-fc0f-443e-9b89-124ff562af6d",
      "name": "Get Fb comments",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -816,
        160
      ]
    },
    {
      "id": "046776ad-1b93-4785-9abd-7999e0917975",
      "name": "Next page?",
      "type": "n8n-nodes-base.if",
      "position": [
        -592,
        160
      ]
    },
    {
      "id": "9be30fb1-20b7-4716-b6d7-9e0f2274cfc6",
      "name": "Get next comments page",
      "type": "n8n-nodes-base.set",
      "position": [
        -256,
        144
      ]
    },
    {
      "id": "32b8cc8d-f166-4883-a88b-0046bbe5e539",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -1264,
        624
      ]
    },
    {
      "id": "50744f4c-8ee6-42f1-a4fb-c5daeebb3b83",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1040,
        624
      ]
    },
    {
      "id": "480fda4b-b4f6-4018-b5ad-3d5623ece78e",
      "name": "Add comment",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -464,
        496
      ]
    },
    {
      "id": "740413cf-3dbb-4359-99f5-af9638ae770b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        -752
      ],
      "parameters": {
        "width": 784,
        "height": 768,
        "content": "## Extract & Analyze All Facebook Post Comments with Sentiment AI\n\nThis workflow automates the process of collecting, analyzing, and storing **Facebook post comments** with AI-powered **sentiment anal"
      }
    },
    {
      "id": "2df36b5f-e1fe-468f-a465-08765174eff7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        368
      ],
      "parameters": {
        "width": 592,
        "height": 272,
        "content": "## STEP 4 -  Calculate sentiment\nClone [this Google Sheet](https://docs.google.com/spreadsheets/d/1xMLAtBgSdxh7Cc--J6fExGb2ul48QTvN-KgGitEGgZw/edit?usp=sharing) and set the POST ID as in the \"Set Fb p"
      }
    },
    {
      "id": "c636086e-4ef8-4097-a50a-5afc4321e8c5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        48
      ],
      "parameters": {
        "width": 464,
        "height": 272,
        "content": "## STEP 1 - Set Facebook Post\nSet your Facebook post ID  to analyze and add your Facebook Graph API credentials to both \"Get Fb Post\" and \"Get Fb comments\" nodes."
      }
    },
    {
      "id": "5f570824-6097-47e7-a873-e213426ba411",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        48
      ],
      "parameters": {
        "width": 784,
        "height": 272,
        "content": "## STEP 2 - Pagination\nIt's very IMPORTANT to get ALL comments"
      }
    },
    {
      "id": "bc904013-1b1d-417d-bf87-90148096d809",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        512
      ],
      "parameters": {
        "width": 416,
        "height": 256,
        "content": "## STEP 3 -  Get single comment\nProcess each comment batch"
      }
    },
    {
      "id": "6c4ca593-ee60-471b-a86c-31323042e284",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        -720
      ],
      "parameters": {
        "width": 736,
        "height": 736,
        "content": "## MY NEW YOUTUBE CHANNEL\n👉 [Subscribe to my new **YouTube channel**](https://youtube.com/@n3witalia). Here I’ll share videos and Shorts with practical tutorials and **FREE templates for n8n**.\n\n[![im"
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Next page?": {
      "main": [
        [
          {
            "node": "Get next comments page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add comment": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Fb Post": {
      "main": [
        [
          {
            "node": "Get Fb comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Fb post ID": {
      "main": [
        [
          {
            "node": "Get Fb Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Fb comments": {
      "main": [
        [
          {
            "node": "Call 'Facebook'",
            "type": "main",
            "index": 0
          },
          {
            "node": "Next page?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Sentiment Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sentiment Analysis": {
      "main": [
        [
          {
            "node": "Add comment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add comment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get next comments page": {
      "main": [
        [
          {
            "node": "Get Fb comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Sentiment Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set Fb post ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}