{
  "name": "Competitor Audit",
  "nodes": [
    {
      "parameters": {},
      "id": "66dd0871-74aa-4533-bfe8-40dec39f6cc7",
      "name": "Monitor Every 6 Hours",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        -2000,
        160
      ]
    },
    {
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "urlList",
              "type": "arrayValue",
              "arrayValue": "="
            }
          ]
        },
        "options": {}
      },
      "id": "85c62e85-d3b9-42da-a3f2-6a8df816a3fa",
      "name": "Create URL List",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.2,
      "position": [
        -1472,
        160
      ]
    },
    {
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {}
      },
      "id": "d81416b8-23f5-4386-91a9-700b4cbc45a9",
      "name": "Fetch Current Page",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        -1200,
        160
      ]
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "list",
          "cachedResultName": "Your Sheet",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=0"
        },
        "options": {}
      },
      "id": "0339fc45-3660-4df2-a798-04852fd61338",
      "name": "Get Previous Version",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.2,
      "position": [
        -1024,
        160
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Your googleSheetsOAuth2Api credential"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "352b1632-5540-4802-9d04-efc6538b0de8",
      "name": "Parse Analysis Results",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.2,
      "position": [
        -800,
        160
      ]
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.score }}",
              "operation": "larger",
              "value2": 3
            }
          ]
        }
      },
      "id": "87c12e1f-3c67-47ef-9e2c-6d4e2385d33e",
      "name": "Significant Change Filter",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        -608,
        160
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "list",
          "cachedResultName": "Your Sheet",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "abbf949f-79c1-4d32-b31f-1e0664e6e02b",
      "name": "Save Significant Change",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.2,
      "position": [
        -400,
        80
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Your googleSheetsOAuth2Api credential"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.score }}",
              "operation": "largerEqual",
              "value2": 8
            }
          ]
        }
      },
      "id": "7937bae8-d566-4218-bf72-aac341471900",
      "name": "Critical Alert Filter",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        -208,
        80
      ]
    },
    {
      "parameters": {
        "sendTo": "your-email@example.com",
        "subject": "\ud83d\udea8 CRITICAL Competitor Alert - {{ $json.competitorName }}",
        "message": "URGENT: Significant competitor activity detected!\n\n\ud83c\udfe2 Competitor: {{ $json.competitorName }}\n\ud83d\udd17 URL: {{ $json.url }}\n\ud83d\udcca Impact Score: {{ $json.score }}/10\n\ud83d\udcdd Summary: {{ $json.summary }}\n\u23f0 Detected: {{ $json.timestamp }}\n\nThis requires immediate attention!\n\n---\nAutomated Competitor Monitoring System",
        "options": {}
      },
      "id": "3b1162f1-6245-49a3-92cc-c63e9b0d4f71",
      "name": "Send Critical Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        0,
        0
      ],
      "webhookId": "f6c99a4e-7789-462a-b171-1cb46ebebba6",
      "credentials": {
        "gmailOAuth2": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Your gmailOAuth2 credential"
        }
      }
    },
    {
      "parameters": {
        "resource": "message",
        "guildId": {
          "__rl": true,
          "value": "YOUR_DISCORD_ID",
          "mode": "list",
          "cachedResultName": "Your Server",
          "cachedResultUrl": "https://discord.com/channels/YOUR_DISCORD_ID"
        },
        "channelId": {
          "__rl": true,
          "value": "YOUR_DISCORD_ID",
          "mode": "list",
          "cachedResultName": "Your Server",
          "cachedResultUrl": "https://discord.com/channels/YOUR_DISCORD_ID"
        },
        "content": "Test Alert 1",
        "options": {}
      },
      "id": "4ed13793-149b-49af-ab2f-9289ed846779",
      "name": "Send Critical Discord",
      "type": "n8n-nodes-base.discord",
      "typeVersion": 2,
      "position": [
        0,
        160
      ],
      "webhookId": "beea90f7-e531-450d-8ba9-b2e3576c6d71",
      "retryOnFail": true,
      "executeOnce": false,
      "credentials": {
        "discordBotApi": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Your discordBotApi credential"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "your-email@example.com",
        "subject": "\ud83d\udcca Competitor Update - {{ $json.competitorName }}",
        "message": "Competitor activity detected:\n\n\ud83c\udfe2 Competitor: {{ $json.competitorName }}\n\ud83d\udd17 URL: {{ $json.url }}\n\ud83d\udcca Impact Score: {{ $json.score }}/10\n\ud83d\udcdd Summary: {{ $json.summary }}\n\u23f0 Detected: {{ $json.timestamp }}\n\n---\nAutomated Competitor Monitoring System",
        "options": {}
      },
      "id": "aa1a0df9-4a83-41da-959d-fe8d51306cd7",
      "name": "Send Routine Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        0,
        320
      ],
      "webhookId": "bc9126b4-2ffc-46a1-ada0-22890d24d3b6"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "url"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "timestamp": "={{ $json.timestamp }}",
            "competitor_id": "={{ $json.competitorId }}",
            "competitor_name": "={{ $json.competitorName }}",
            "url": "={{ $json.url }}",
            "score": "={{ $json.score }}",
            "summary": "No significant change detected",
            "change_type": "none",
            "content": "={{ $('Fetch Current Page').item.json.data }}"
          }
        },
        "options": {}
      },
      "id": "73aeb9d3-7bd8-469f-8252-479df8b31f5c",
      "name": "Save No Change",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.2,
      "position": [
        -400,
        240
      ]
    },
    {
      "parameters": {},
      "id": "b0b866f8-827c-4d02-8665-d1d8197a0c73",
      "name": "Weekly Report Trigger",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        -2000,
        464
      ]
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "url"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list"
        },
        "options": {}
      },
      "id": "57338d96-1f44-419e-9d09-89cc29bfaec7",
      "name": "Get Weekly Data",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.2,
      "position": [
        -1808,
        464
      ]
    },
    {
      "parameters": {},
      "id": "3f79ec25-10ae-4b86-b728-dc478d94da7c",
      "name": "Generate Weekly Report",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1.3,
      "position": [
        -1600,
        464
      ],
      "credentials": {}
    },
    {
      "parameters": {
        "sendTo": "your-email@example.com",
        "subject": "\ud83d\udcc8 Weekly Competitor Analysis Report - {{ new Date().toLocaleDateString() }}",
        "message": "={{ $json.message.content }}",
        "options": {}
      },
      "id": "ae731f43-588e-41a8-9902-4e8eec6c787f",
      "name": "Send Weekly Gmail",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        -1408,
        464
      ],
      "webhookId": "5ba2b520-2348-47ab-8630-c0aaa3a38914"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4",
          "mode": "list",
          "cachedResultName": "GPT-4"
        },
        "messages": {
          "values": [
            {
              "role": "=user"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        -848,
        160
      ],
      "id": "c8c5ef75-2dd0-46f6-9544-a16c99df8d22",
      "name": "Message a model",
      "credentials": {
        "openAiApi": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Your openAiApi credential"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_SHEET_ID",
          "mode": "list",
          "cachedResultName": "Your Sheet",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1792,
        160
      ],
      "id": "402482a9-5ca3-42dd-a674-82f9274df693",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Your googleSheetsOAuth2Api credential"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Monitor Every 6 Hours": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create URL List": {
      "main": [
        [
          {
            "node": "Fetch Current Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Current Page": {
      "main": [
        [
          {
            "node": "Get Previous Version",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Analysis Results": {
      "main": [
        [
          {
            "node": "Significant Change Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Significant Change Filter": {
      "main": [
        [
          {
            "node": "Save Significant Change",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save No Change",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Significant Change": {
      "main": [
        [
          {
            "node": "Critical Alert Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Critical Alert Filter": {
      "main": [
        [
          {
            "node": "Send Critical Gmail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Routine Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Critical Gmail": {
      "main": [
        [
          {
            "node": "Send Critical Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Report Trigger": {
      "main": [
        [
          {
            "node": "Get Weekly Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Previous Version": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Create URL List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "createdAt": "2025-09-09T17:19:57.889Z",
      "updatedAt": "2025-09-09T17:19:57.889Z",
      "id": "q8RjGNJRVkq1Nz9K",
      "name": "Monitoring Agent"
    }
  ]
}