{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ee795e8e-16a9-4df6-8b86-95cf51c031d0",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1184,
        272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d94afee5-9940-46fd-8f2e-61bc7f1fe56c",
      "name": "Auto-fixing Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        1440,
        272
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "9dd364d6-9745-49fe-ba37-1d6696f6e8d7",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1328,
        480
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "90aa8498-a254-431e-931c-55743b71fc5b",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1584,
        480
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"comment\": \"My 14 pro feels a bit laggy after the update.\",\n  \"sentiment\": \"negative\",\n  \"reason\": \"The user expressed dissatisfaction with the phone\u2019s performance after the update, using the word 'laggy', which is a negative experience.\"\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "54500d82-6d1b-4f65-945e-210a36208bda",
      "name": "Trigger: Manual Start",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -160,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f241718c-7a61-4a3b-adb9-da0e621f7cbc",
      "name": "Set Reddit Post URL",
      "type": "n8n-nodes-base.set",
      "position": [
        32,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c602fcde-572b-43c9-b9e3-bb1ae11d3b22",
              "name": "post URL",
              "type": "string",
              "value": "https://www.reddit.com/r/iphone/comments/1kl0tb5/new_ios_185_update/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a1593058-3d9b-4b3b-8b06-9e7ab53b561e",
      "name": "Bright Data: Get comments",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        336,
        0
      ],
      "parameters": {
        "urls": "=[{\"url\":\"{{ $json[\"post URL\"] }}\"}]",
        "resource": "webScrapper",
        "dataset_id": {
          "__rl": true,
          "mode": "list",
          "value": "gd_lvzdpsdlw09j6t702",
          "cachedResultName": "Reddit - Comments"
        },
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c2069b85-63a9-4e81-914f-bca4016f128d",
      "name": "Wait for Snapshot Processing (5 min)",
      "type": "n8n-nodes-base.wait",
      "position": [
        512,
        0
      ],
      "parameters": {
        "unit": "minutes"
      },
      "typeVersion": 1.1
    },
    {
      "id": "1be77fde-720e-4283-970b-5228e7d0ccb3",
      "name": "Bright Data: Download Comments Snapshot",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        768,
        0
      ],
      "parameters": {
        "resource": "webScrapper",
        "operation": "downloadSnapshot",
        "snapshot_id": "={{ $json.snapshot_id }}",
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "403fe1e9-aaab-49c6-a531-601641b08119",
      "name": "Limit to 5 Comments",
      "type": "n8n-nodes-base.limit",
      "position": [
        960,
        0
      ],
      "parameters": {
        "maxItems": 5
      },
      "typeVersion": 1
    },
    {
      "id": "3c6c116e-b384-42ff-af10-cad357fdf44f",
      "name": "AI Sentiment Classifier",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1264,
        0
      ],
      "parameters": {
        "text": "=Based on the Reddit post's comment below, decide whether the sentiment is positive, negative or neutral.\n\ncomment: {{ $json.comment }}\nNumber of upvotes: {{ $json.num_upvotes }}",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.1
    },
    {
      "id": "05188346-66f3-453c-8f57-dab11b11899c",
      "name": "Save Sentiment to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1616,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Reason": "={{ $json.output.reason }}",
            "Comment": "={{ $json.output.comment }}",
            "Sentiment": "={{ $json.output.sentiment }}"
          },
          "schema": [
            {
              "id": "Comment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Comment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reason",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WPOfGgyqbcu8RFdA_LyMvCRxqrwr-nUL5JT656ASwOA/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1WPOfGgyqbcu8RFdA_LyMvCRxqrwr-nUL5JT656ASwOA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WPOfGgyqbcu8RFdA_LyMvCRxqrwr-nUL5JT656ASwOA/edit?usp=drivesdk",
          "cachedResultName": "Reddit post's comment sentiment analysis"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9fac1e20-5b36-47c7-9fa3-74fbdeb49520",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -608
      ],
      "parameters": {
        "color": 6,
        "width": 352,
        "height": 784,
        "content": "### \ud83d\udd39 **Section 1: Trigger & Input Setup**\n\n\ud83d\udccc *(\"Trigger: Manual Start\" + \"Set Reddit Post URL\")*\n\n#### \ud83d\udd18 `Trigger: Manual Start`\n\n\u25b6\ufe0f **Icon:** \ud83d\uddb1\ufe0f\nThis is a **manual trigger node**. You start the workflow by clicking a button in the n8n editor.\n\n> \ud83d\udca1 *Perfect for testing and running when you want full control.*\n\n#### \ud83d\udcdd `Set Reddit Post URL`\n\n\u25b6\ufe0f **Icon:** \ud83d\udd17\nThis **Set node** lets you **manually enter the Reddit post URL** that you want to analyze.\n\n> \ud83e\udde0 *You can later automate this with an API or Google Sheets feed, but for now, it\u2019s easy to paste a URL manually.*\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "23c69791-3aef-453e-91b7-c32c75066f96",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -688
      ],
      "parameters": {
        "color": 4,
        "width": 352,
        "height": 880,
        "content": "### \ud83d\udd39 **Section 2: Snapshot Creation & Waiting**\n\n\ud83d\udccc *(\"Bright Data: Extract Snapshot ID\" + \"Wait for Snapshot Processing\")*\n\n#### \ud83d\udd0d `Bright Data: Extract Snapshot ID`\n\n\u25b6\ufe0f **Icon:** \ud83e\udde0\ud83d\udd04\nThis node uses **Bright Data\u2019s Web Scraper API** to create a new **snapshot job** for the provided Reddit URL. That job will start capturing all the structured data, including comments.\n\n> \u2699\ufe0f *It sends the request to start the scrape and gives us a snapshot ID to check later.*\n\n#### \u23f3 `Wait for Snapshot Processing`\n\n\u25b6\ufe0f **Icon:** \u23f1\ufe0f\nThe workflow **pauses for 5 minutes** to give Bright Data time to collect all the data.\n\n> \ud83d\uded1 *Waiting ensures we don\u2019t request results before the scraping job is complete.*\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1fe96203-40e6-446d-b6d5-d36d98cafd0d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -672
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 864,
        "content": "### \ud83d\udd39 **Section 3: Download & Limit Data**\n\n\ud83d\udccc *(\"Bright Data: Download Comments Snapshot\" + \"Limit to 5 Comments\")*\n\n#### \ud83d\udcbe `Bright Data: Download Comments Snapshot`\n\n\u25b6\ufe0f **Icon:** \ud83d\udce5\nThis node downloads the **scraped data using the snapshot ID**. It includes all comments under the Reddit post.\n\n> \ud83d\udcd8 *Each comment is structured data, ready to be processed.*\n\n#### \ud83d\udd22 `Limit to 5 Comments`\n\n\u25b6\ufe0f **Icon:** \ud83d\udea6\nThis **limits the number of comments** passed to the next step to just **5** for testing or to avoid long processing times.\n\n> \u26a1 *You can increase this number later as needed.*\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9cffe2f5-f99c-495f-96f0-4b08a7dcab33",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1232,
        -1120
      ],
      "parameters": {
        "color": 3,
        "width": 512,
        "height": 1312,
        "content": "### \ud83d\udd39 **Section 4: Sentiment Analysis & Storage**\n\n\ud83d\udccc *(\"AI Sentiment Classifier\" + Output Parsers + Gemini + Google Sheets)*\n\nCopy this spreadsheet:\nhttps://docs.google.com/spreadsheets/d/1ycEjFdFK9MXQif2O_jh0Fhjlw5R9zwFUZ4qZdx8Duss/edit?usp=sharing\n\n#### \ud83e\udd16 `AI Sentiment Classifier`\n\n\u25b6\ufe0f **Icon:** \ud83e\udde0\ud83d\udcac\nThis is the **AI Agent node** that takes each comment and asks the AI:\n\n> *\u201cIs this comment Positive, Negative, or Neutral?\u201d*\n\n#### \ud83c\udf08 `Google Gemini Chat Model`\n\n\u25b6\ufe0f **Icon:** \ud83d\udd35\ud83d\udfe5\ud83d\udfe1\nThe primary **AI model (Gemini)** that understands the text and returns a **sentiment label** with context.\n\n#### \ud83d\udee0\ufe0f `Auto-Correct Output Parser`\n\n\u25b6\ufe0f **Icon:** \ud83d\udd27\u2728\nThis node **fixes any response issues** (like malformed data) to ensure it can be processed correctly downstream.\n\n#### \ud83d\udccb `Sentiment Output Formatter`\n\n\u25b6\ufe0f **Icon:** \ud83e\uddfe\ud83d\udca1\nThis node converts the AI\u2019s response into a **structured format** (like JSON), with fields like:\n\n```json\n{\n  \"sentiment\": \"positive\",\n  \"comment\": \"I love this post! So insightful.\"\n}\n```\n\n#### \ud83d\udcca `Save Sentiment to Google Sheets`\n\n\u25b6\ufe0f **Icon:** \ud83d\udcc8\ud83d\udcdd\nFinally, the structured results are **saved to a Google Sheet**, making it easy to:\n\n* Track sentiment trends\n* Analyze user feedback\n* Export for reports or dashboards\n\n> \ud83d\udcc1 *Each row contains the original comment and the AI's sentiment analysis.*\n\n---\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3af53eb1-98d7-441a-bf70-8db0d468c891",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1824,
        -1120
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 240,
        "content": "## I\u2019ll receive a tiny commission if you join Bright Data through this link\u2014thanks for fueling more free content!\n\n### https://get.brightdata.com/1tndi4600b25"
      },
      "typeVersion": 1
    },
    {
      "id": "5e9cc429-7b58-476c-9e85-9881f9d93285",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        -608
      ],
      "parameters": {
        "color": 4,
        "width": 1300,
        "height": 320,
        "content": "=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n=======================================\n"
      },
      "typeVersion": 1
    },
    {
      "id": "82f3a17c-4317-4132-92e4-f5a3e00c38bb",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        -272
      ],
      "parameters": {
        "color": 4,
        "width": 1289,
        "height": 3106,
        "content": "## \ud83c\udf10\u2728 Reddit Sentiment Analyzer \u2013 Workflow Breakdown\n\nThis n8n workflow helps **automatically analyze the sentiment of Reddit post comments** and **save the results to Google Sheets**. It\u2019s divided into 4 easy-to-understand sections:\n\n---\n\n### \ud83d\udd39 **Section 1: Trigger & Input Setup**\n\n\ud83d\udccc *(\"Trigger: Manual Start\" + \"Set Reddit Post URL\")*\n\n#### \ud83d\udd18 `Trigger: Manual Start`\n\n\u25b6\ufe0f **Icon:** \ud83d\uddb1\ufe0f\nThis is a **manual trigger node**. You start the workflow by clicking a button in the n8n editor.\n\n> \ud83d\udca1 *Perfect for testing and running when you want full control.*\n\n#### \ud83d\udcdd `Set Reddit Post URL`\n\n\u25b6\ufe0f **Icon:** \ud83d\udd17\nThis **Set node** lets you **manually enter the Reddit post URL** that you want to analyze.\n\n> \ud83e\udde0 *You can later automate this with an API or Google Sheets feed, but for now, it\u2019s easy to paste a URL manually.*\n\n---\n\n### \ud83d\udd39 **Section 2: Snapshot Creation & Waiting**\n\n\ud83d\udccc *(\"Bright Data: Extract Snapshot ID\" + \"Wait for Snapshot Processing\")*\n\n#### \ud83d\udd0d `Bright Data: Extract Snapshot ID`\n\n\u25b6\ufe0f **Icon:** \ud83e\udde0\ud83d\udd04\nThis node uses **Bright Data\u2019s Web Scraper API** to create a new **snapshot job** for the provided Reddit URL. That job will start capturing all the structured data, including comments.\n\n> \u2699\ufe0f *It sends the request to start the scrape and gives us a snapshot ID to check later.*\n\n#### \u23f3 `Wait for Snapshot Processing`\n\n\u25b6\ufe0f **Icon:** \u23f1\ufe0f\nThe workflow **pauses for 5 minutes** to give Bright Data time to collect all the data.\n\n> \ud83d\uded1 *Waiting ensures we don\u2019t request results before the scraping job is complete.*\n\n---\n\n### \ud83d\udd39 **Section 3: Download & Limit Data**\n\n\ud83d\udccc *(\"Bright Data: Download Comments Snapshot\" + \"Limit to 5 Comments\")*\n\n#### \ud83d\udcbe `Bright Data: Download Comments Snapshot`\n\n\u25b6\ufe0f **Icon:** \ud83d\udce5\nThis node downloads the **scraped data using the snapshot ID**. It includes all comments under the Reddit post.\n\n> \ud83d\udcd8 *Each comment is structured data, ready to be processed.*\n\n#### \ud83d\udd22 `Limit to 5 Comments`\n\n\u25b6\ufe0f **Icon:** \ud83d\udea6\nThis **limits the number of comments** passed to the next step to just **5** for testing or to avoid long processing times.\n\n> \u26a1 *You can increase this number later as needed.*\n\n---\n\n### \ud83d\udd39 **Section 4: Sentiment Analysis & Storage**\n\n\ud83d\udccc *(\"AI Sentiment Classifier\" + Output Parsers + Gemini + Google Sheets)*\n\n#### \ud83e\udd16 `AI Sentiment Classifier`\n\n\u25b6\ufe0f **Icon:** \ud83e\udde0\ud83d\udcac\nThis is the **AI Agent node** that takes each comment and asks the AI:\n\n> *\u201cIs this comment Positive, Negative, or Neutral?\u201d*\n\n#### \ud83c\udf08 `Google Gemini Chat Model`\n\n\u25b6\ufe0f **Icon:** \ud83d\udd35\ud83d\udfe5\ud83d\udfe1\nThe primary **AI model (Gemini)** that understands the text and returns a **sentiment label** with context.\n\n#### \ud83d\udee0\ufe0f `Auto-Correct Output Parser`\n\n\u25b6\ufe0f **Icon:** \ud83d\udd27\u2728\nThis node **fixes any response issues** (like malformed data) to ensure it can be processed correctly downstream.\n\n#### \ud83d\udccb `Sentiment Output Formatter`\n\n\u25b6\ufe0f **Icon:** \ud83e\uddfe\ud83d\udca1\nThis node converts the AI\u2019s response into a **structured format** (like JSON), with fields like:\n\n```json\n{\n  \"sentiment\": \"positive\",\n  \"comment\": \"I love this post! So insightful.\"\n}\n```\n\n#### \ud83d\udcca `Save Sentiment to Google Sheets`\n\n\u25b6\ufe0f **Icon:** \ud83d\udcc8\ud83d\udcdd\nFinally, the structured results are **saved to a Google Sheet**, making it easy to:\n\n* Track sentiment trends\n* Analyze user feedback\n* Export for reports or dashboards\n\n> \ud83d\udcc1 *Each row contains the original comment and the AI's sentiment analysis.*\n\n---\n\n## \ud83c\udfaf Why This Workflow Is Powerful (Especially for Beginners)\n\n\u2705 **No coding needed** \u2014 It's all visual automation\n\u2705 **Plug-and-play** \u2014 Just change the Reddit URL and you're good to go\n\u2705 **Real AI power** \u2014 Understand public sentiment using Google Gemini\n\u2705 **Structured output** \u2014 Clean data goes straight into a spreadsheet\n\u2705 **Expandable** \u2014 Add more analysis, automate triggering, or integrate with Slack, Notion, or CRMs\n\n---\n\n## \ud83d\udee0\ufe0f Ready to Scale?\n\nYou can add enhancements like:\n\n* \ud83d\udd04 Scheduled runs (to process trending Reddit posts automatically)\n* \ud83e\uddf5 Looping through more than 5 comments\n* \ud83d\udd14 Slack notifications for negative sentiment\n* \ud83d\udcec Email reports weekly with summary charts\n\n---\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Limit to 5 Comments": {
      "main": [
        [
          {
            "node": "AI Sentiment Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Reddit Post URL": {
      "main": [
        [
          {
            "node": "Bright Data: Get comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger: Manual Start": {
      "main": [
        [
          {
            "node": "Set Reddit Post URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Sentiment Classifier": {
      "main": [
        [
          {
            "node": "Save Sentiment to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Sentiment Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fixing Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Sentiment Classifier",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Bright Data: Get comments": {
      "main": [
        [
          {
            "node": "Wait for Snapshot Processing (5 min)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Snapshot Processing (5 min)": {
      "main": [
        [
          {
            "node": "Bright Data: Download Comments Snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bright Data: Download Comments Snapshot": {
      "main": [
        [
          {
            "node": "Limit to 5 Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}