{
  "id": "HsxXMUjX8ds5GXrV",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Competitor Review Analyzer with Dumpling AI + GPT-4o + Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "73954fe0-97bd-4556-9ea2-8d42bd5c7b3d",
      "name": "Google Sheets Trigger \u2013 New Business Added",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -1320,
        -700
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bRDFEMkwJ7BaAC6tO7xGrNFCB2MZKz9pWZAUja-Sels/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bRDFEMkwJ7BaAC6tO7xGrNFCB2MZKz9pWZAUja-Sels/edit?usp=drivesdk",
          "cachedResultName": "Google review"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "94d2b22c-522e-4a38-afd0-3dcd51f4418c",
      "name": "Fetch Google Reviews from Dumpling AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1060,
        -700
      ],
      "parameters": {
        "url": "=https://app.dumplingai.com/api/v1/get-google-reviews",
        "method": "=POST",
        "options": {},
        "jsonBody": "={\n  \"keyword\": \"{{ $json['Business name'] }}\",\n  \"reviews\": \"20\",\n  \"sortBy\": \"newest\",\n  \"language\": \"en\",\n  \"location\": \"United States\"\n}\n ",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "26f0110a-0c92-48d9-a2a9-4e20f0e5699d",
      "name": "Split Out Reviews List",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -840,
        -700
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "e5c5c53b-42e2-4ad1-aeb4-9dd680747a1f",
      "name": "Aggregate Review Text",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -620,
        -700
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "review_text"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "01bbc579-a368-45cd-b2c5-2204a562a4c7",
      "name": "GPT-4o: Extract Insights from Reviews",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -420,
        -700
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a review analysis assistant"
            },
            {
              "content": "=You are a review analysis assistant. Your task is to read a list of customer reviews about a business and extract two main insights:\n\n1. **Challenges or complaints** people are consistently mentioning  \n2. **Things customers love** or speak highly about\n\nPlease analyze the tone, keywords, and patterns in the reviews. Do not just summarize each review. Instead, group similar feedback together and present the top recurring themes.\n\nRespond in this format:\n\n**Top Complaints or Challenges:**\n- [Summarize the most common issues customers have. Include examples if needed.]\n\n**What People Love About This Business:**\n- [Summarize the most common compliments or positive feedback. Include examples if needed.]\n\nHere are the reviews:\n{{ $json.review_text }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "e32aff5b-6ef0-4c2d-9c62-1aa0988a1ecd",
      "name": "Save Summary to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -60,
        -700
      ],
      "parameters": {
        "columns": {
          "value": {
            "Review  text": "={{ $json.message.content }}",
            "Business name": "={{ $('Fetch Google Reviews from Dumpling AI').item.json.keyword }}"
          },
          "schema": [
            {
              "id": "Business name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Business name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Review  text",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Review  text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Business name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bRDFEMkwJ7BaAC6tO7xGrNFCB2MZKz9pWZAUja-Sels/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bRDFEMkwJ7BaAC6tO7xGrNFCB2MZKz9pWZAUja-Sels",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bRDFEMkwJ7BaAC6tO7xGrNFCB2MZKz9pWZAUja-Sels/edit?usp=drivesdk",
          "cachedResultName": "Google review"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "b505cba7-6c9f-4b61-814d-3a0bb7d1219e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -1020
      ],
      "parameters": {
        "width": 600,
        "height": 360,
        "content": "### \ud83d\udd0d AI Analysis & Sheet Output\n\nThis section handles summarizing reviews and saving insights:\n\n4. **Aggregate Review Text**  \n   Joins all individual review texts into a single prompt for AI processing.\n\n5. **GPT-4o \u2013 Summarize Sentiment**  \n   Uses GPT-4o to analyze the reviews and extract common complaints and positive feedback. Returns a structured summary.\n\n6. **Append Summary to Google Sheet**  \n   Adds the summarized competitor insight back into the original Google Sheet, aligned with the input row.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7b35868d-1d2d-4c4b-a987-610d8868bed8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1340,
        -1020
      ],
      "parameters": {
        "color": 3,
        "width": 580,
        "height": 360,
        "content": "### \ud83d\udce5 Business Input & Review Collection\n\nThis section of the workflow starts the competitor analysis process:\n\n1. **Google Sheets Trigger**  \n   Watches for new rows added to the competitor sheet. Each row contains a business name and location.\n\n2. **Dumpling AI \u2013 Get Google Reviews**  \n   Sends a prompt to Dumpling AI with the business details to fetch 20 recent customer reviews. Requires an active agent with review scraping capability.\n\n3. **Split Reviews into Individual Items**  \n   Breaks the returned review list into individual entries so each one can be processed separately later in the flow.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6b5a71b6-4eda-4848-9bcb-2f8f8d857cbf",
  "connections": {
    "Aggregate Review Text": {
      "main": [
        [
          {
            "node": "GPT-4o: Extract Insights from Reviews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Reviews List": {
      "main": [
        [
          {
            "node": "Aggregate Review Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Google Reviews from Dumpling AI": {
      "main": [
        [
          {
            "node": "Split Out Reviews List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4o: Extract Insights from Reviews": {
      "main": [
        [
          {
            "node": "Save Summary to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger \u2013 New Business Added": {
      "main": [
        [
          {
            "node": "Fetch Google Reviews from Dumpling AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}