{
  "id": "eIAvSUEdxSNVBrdM",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "User Review Aggregation",
  "tags": [],
  "nodes": [
    {
      "id": "877584c6-ca5f-418e-bfa3-4dbf9eba9ea7",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -320,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "7bf5bbc7-65cd-445e-9075-457945ec5bfd",
      "name": "Decodo",
      "type": "@decodo/n8n-nodes-decodo.decodo",
      "position": [
        384,
        16
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "operation": "amazon"
      },
      "credentials": {
        "decodoApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "00a28249-c90d-4532-866c-0e1eaf23784f",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -80,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "list urls"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "decodo"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "9e5e3fdd-0e01-43ce-a576-9ad31f817355",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        720,
        272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "93845a3b-96ef-4f77-8456-1ef88d868fb8",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        592,
        16
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nconst reviews = $input.first().json.results[0].content.results.reviews.map(el => (\n `${el.review_from} - ${el.rating} - ${el.content}`\n))\n\nreturn {\n  reviews: reviews.join(\"\\n\\n\"),\n  url: $('Get row(s) in sheet').first().json.url\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "3ad0d98e-1e81-410c-a821-448bd4ecac45",
      "name": "Summarize Reviews",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        1168,
        80
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "07a0197d-94e2-4016-ab72-d51b9e15414f",
      "name": "Alert Group",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1504,
        96
      ],
      "parameters": {
        "text": "=\ud83d\udea8ALERT WARNING\ud83d\udea8\nDate: {{ DateTime.now().format('yyyy-MM-dd') }}\nSentiment: {{ $('Sentiment Analyzer').item.json.sentimentAnalysis.category }}\n\nUrl: {{ $('Code in JavaScript').item.json.url }}\n\nSummary: {{ $json.output.text }}\n\n",
        "chatId": "123456789",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f027e9fa-8bf9-4f4a-a702-abecf6f472f2",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        144,
        0
      ],
      "parameters": {
        "options": {},
        "batchSize": 5
      },
      "typeVersion": 3
    },
    {
      "id": "802c3000-3e37-40a5-b7a6-cffefaa4600c",
      "name": "Store to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1456,
        -272
      ],
      "parameters": {
        "columns": {
          "value": {
            "Url": "={{ $('Code in JavaScript').item.json.url }}",
            "Sentiment": "={{ $json.sentimentAnalysis.category }}",
            "List Review": "={{ $json.reviews }}"
          },
          "schema": [
            {
              "id": "Url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "List Review",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "List Review",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sentiment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Sentiment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1499922583,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uvnAqq36EoJqdTN01oHCsQs7eqP0zVP3BM_ZJ7avepQ/edit#gid=1499922583",
          "cachedResultName": "user review aggregations"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1uvnAqq36EoJqdTN01oHCsQs7eqP0zVP3BM_ZJ7avepQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1uvnAqq36EoJqdTN01oHCsQs7eqP0zVP3BM_ZJ7avepQ/edit?usp=drivesdk",
          "cachedResultName": "decodo"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "6a4a0040-617d-45e4-ad41-2152343eab93",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -640
      ],
      "parameters": {
        "width": 624,
        "height": 608,
        "content": "## Automated Review Monitoring with Decodo, Google Sheets, Gemini AI & Telegram Alerts\n\nGreat For:\n\u2022 E-commerce owners\n\u2022 Product managers\n\u2022 Reputation & CX teams\n\u2022 Amazon/Marketplace sellers\n\u2022 Anyone who wants hands-off, scheduled review monitoring + alerts\n\nWhat It Does:\n- Reads URLs from Google Sheets\n- Loops through each product URL\n- Scrapes reviews using Decodo\n- Converts scraped data into clean text\n- Detects sentiment (positive / neutral / negative)\n- Summarizes all reviews\n- Sends Telegram alerts when needed\n- Stores all results in a review log sheet\n\nWhy It\u2019s Useful:\n- Fully automated review monitoring\n- Daily digest + alerts for negative sentiment\n- Structured historical record of reviews\n- Works without coding\n- Upgradable (translation, classification, etc.)"
      },
      "typeVersion": 1
    },
    {
      "id": "1cf7d274-422d-4b0b-bfe3-7d8c7fda7361",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        208
      ],
      "parameters": {
        "content": "## Google Sheets\n\n\u2022 Keep one URL per row\n\u2022 Ensure Sheet permissions allow n8n access"
      },
      "typeVersion": 1
    },
    {
      "id": "3e2de6e1-0de2-4d49-a234-eb116671c452",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -400
      ],
      "parameters": {
        "width": 304,
        "height": 240,
        "content": "### Decodo \n\nWhat it does:\nScrapes Amazon product reviews based on the given URL.\n\nOutput:\nStructured JSON with reviewer name, rating, and review content."
      },
      "typeVersion": 1
    },
    {
      "id": "69ba32f1-844e-4dc2-ab59-4795df6d1219",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -400
      ],
      "parameters": {
        "width": 304,
        "height": 240,
        "content": "### Javascript\n\ntransforms Decodo\u2019s raw JSON into simple text blocks of:\n<author> \u2013 <rating> \u2013 <content>\n\nResult:\nA clean, multi-line text string ready for sentiment + summarization."
      },
      "typeVersion": 1
    },
    {
      "id": "5742938e-b6ad-4d65-8d4d-4bacfb144be7",
      "name": "Sentiment Analyzer",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        800,
        -16
      ],
      "parameters": {
        "options": {},
        "inputText": "={{ $json.reviews }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "323a388b-a7f8-40a5-b99a-d46690a6dd79",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        -544
      ],
      "parameters": {
        "width": 304,
        "height": 240,
        "content": "Saves a new record into the \u201cuser review aggregations\u201d sheet.\n\nStored fields:\n\u2022 Cleaned review text\n\u2022 Sentiment\n\u2022 Product URL\n\nPurpose:\nCreates a historical review database you can analyze anytime."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "38420079-8dcf-43e3-91dc-c92e5d6568b5",
  "connections": {
    "Decodo": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Alert Group": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store to Sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Decodo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Reviews": {
      "main": [
        [
          {
            "node": "Alert Group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Sentiment Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sentiment Analyzer": {
      "main": [
        [
          {
            "node": "Store to Sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Summarize Reviews",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Summarize Reviews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Sentiment Analyzer",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Summarize Reviews",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}