{
  "name": "Detect content decay from Google Search Console and alert via Slack and email",
  "nodes": [
    {
      "id": "1fd97044-715a-4542-a99e-140e1d73ce73",
      "name": "Weekly Monday 8AM Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        320,
        320
      ]
    },
    {
      "id": "34069535-dd52-4536-bbc8-f9abc5d7b9cc",
      "name": "Calculate Date Ranges",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        320
      ]
    },
    {
      "id": "fdecf37e-0b0a-4542-9b18-6af9c37e894b",
      "name": "Fetch GSC Recent 7 Days",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        768,
        224
      ]
    },
    {
      "id": "7a9e78b0-dd0c-4fec-b8f2-6fffd93e56de",
      "name": "Fetch GSC Previous 28 Days",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        768,
        416
      ]
    },
    {
      "id": "81576c4a-ae86-4edf-b2d6-fe218c9023e8",
      "name": "Compare Periods and Detect Decay",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        320
      ]
    },
    {
      "id": "7a51c471-9f95-470c-b668-b5ea0aa46648",
      "name": "Log All Results to Decay Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1280,
        416
      ]
    },
    {
      "id": "15898af0-2461-4f42-9804-6b02650ab69d",
      "name": "Filter Only Decaying Pages",
      "type": "n8n-nodes-base.filter",
      "position": [
        1280,
        224
      ]
    },
    {
      "id": "51aa6fc9-3b2f-46d1-832a-aba1ef343635",
      "name": "Build Weekly Decay Report",
      "type": "n8n-nodes-base.code",
      "position": [
        1520,
        224
      ]
    },
    {
      "id": "48e028a0-fce2-4585-a9b4-ddef05f29639",
      "name": "Post Report to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1760,
        112
      ]
    },
    {
      "id": "aff9be9e-2e4f-4df1-ad5f-e32c1669476f",
      "name": "Email Weekly Report",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1760,
        320
      ]
    },
    {
      "id": "4cf96f14-e1e9-4164-aee7-1002121f0d90",
      "name": "Check If Any Critical Pages",
      "type": "n8n-nodes-base.filter",
      "position": [
        1760,
        512
      ]
    },
    {
      "id": "52ef07b8-caa3-43a0-9898-efc5ff320bc1",
      "name": "Generate Fix Tasks for Critical Pages",
      "type": "n8n-nodes-base.code",
      "position": [
        1968,
        512
      ]
    },
    {
      "id": "76f2b5b6-32c3-4261-8f6b-9183c61e38e1",
      "name": "Log Fix Tasks to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2192,
        512
      ]
    },
    {
      "id": "dd580d9b-91f2-4e75-b5d3-5467860eb2e7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        -224
      ],
      "parameters": {
        "width": 660,
        "height": 976,
        "content": "## Detect content decay and alert via Slack and email\n\nThis workflow automatically detects declining content performance by comparing your recent Google Search Console data against a historical baseli"
      }
    },
    {
      "id": "4ef309df-5f0e-44da-9136-6275543ae50e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        48
      ],
      "parameters": {
        "width": 328,
        "height": 164,
        "content": "## 1. Fetch GSC Data\nCalculates date ranges (recent 7 days vs. previous 28-day baseline) and fetches page-level performance from Google Search Console in parallel."
      }
    },
    {
      "id": "6881902b-441f-45b6-84d2-030540de839f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        0
      ],
      "parameters": {
        "width": 332,
        "height": 164,
        "content": "## 2. Detect Decay\nCompares recent vs. baseline metrics per page. Classifies each page as CRITICAL_DECAY, DECAYING, EARLY_DECAY, STABLE, or GROWING based on click and position changes."
      }
    },
    {
      "id": "89fa3787-df97-47dd-8dda-505d1c1d1416",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -96
      ],
      "parameters": {
        "width": 276,
        "height": 180,
        "content": "## 3. Report and Alert\nBuilds a comprehensive weekly report with decay breakdown. Sends to Slack and email simultaneously. Pages with no decay are logged but not alerted."
      }
    },
    {
      "id": "02088b0f-83f2-4b51-afa7-ac7345e04529",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        752
      ],
      "parameters": {
        "width": 332,
        "height": 180,
        "content": "## 4. Auto-Generate Fix Tasks\nFor critical pages, generates specific remediation tasks (backlink audit, content refresh, CTR optimization) and logs them to a separate Google Sheet tab."
      }
    },
    {
      "id": "d1e6cb92-3abe-4f97-a433-4c80070e718b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        512
      ],
      "parameters": {
        "width": 480,
        "height": 140,
        "content": "⚠️ **Set environment variables** before activating:\n- `GSC_SITE_URL` → your verified site URL (e.g., `https://yoursite.com`)\n- `DECAY_SHEET_URL` → your Google Sheet URL for logging\n\nSee [n8n docs on e"
      }
    },
    {
      "id": "8ab794a9-6860-45d1-80ff-bf6fba6ee2d0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1984,
        304
      ],
      "parameters": {
        "width": 360,
        "height": 80,
        "content": "⚠️ **Update the email address** in this node to your own recipient address before activating."
      }
    }
  ],
  "connections": {
    "Calculate Date Ranges": {
      "main": [
        [
          {
            "node": "Fetch GSC Recent 7 Days",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch GSC Previous 28 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch GSC Recent 7 Days": {
      "main": [
        [
          {
            "node": "Compare Periods and Detect Decay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Weekly Decay Report": {
      "main": [
        [
          {
            "node": "Check If Any Critical Pages",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post Report to Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Email Weekly Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Monday 8AM Trigger": {
      "main": [
        [
          {
            "node": "Calculate Date Ranges",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch GSC Previous 28 Days": {
      "main": [
        [
          {
            "node": "Compare Periods and Detect Decay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Only Decaying Pages": {
      "main": [
        [
          {
            "node": "Build Weekly Decay Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Any Critical Pages": {
      "main": [
        [
          {
            "node": "Generate Fix Tasks for Critical Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compare Periods and Detect Decay": {
      "main": [
        [
          {
            "node": "Filter Only Decaying Pages",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log All Results to Decay Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Fix Tasks for Critical Pages": {
      "main": [
        [
          {
            "node": "Log Fix Tasks to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}