{
  "name": "Track Your Facebook Rating and Alert Email on Every Change",
  "nodes": [
    {
      "name": "Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "notes": "Every few hours.",
      "position": [
        260,
        300
      ]
    },
    {
      "name": "Fetch Facebook Rating",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "parameters": {
        "method": "POST",
        "url": "https://api.example.com/replace-with-real-endpoint",
        "sendBody": true,
        "options": {}
      },
      "notes": "Read your current Facebook average rating and review count.",
      "position": [
        500,
        300
      ]
    },
    {
      "name": "Changed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "leftValue": "={{ $json.rating }}",
              "rightValue": "={{ $json.last_rating }}",
              "operator": {
                "type": "number",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "notes": "Only alert on a real change.",
      "position": [
        740,
        300
      ]
    },
    {
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "parameters": {
        "subject": "={{ $json.source }} rating: {{ $json.last_rating }} → {{ $js",
        "text": "={{ $json.summary }}"
      },
      "notes": "Add SMTP credentials (or swap for the Gmail node).",
      "position": [
        980,
        300
      ]
    },
    {
      "name": "Respond / Finish",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "parameters": {},
      "notes": "End of flow — extend with extra steps as needed.",
      "position": [
        1220,
        300
      ]
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          {
            "node": "Fetch Facebook Rating",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Facebook Rating": {
      "main": [
        [
          {
            "node": "Changed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Changed?": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Send Email": {
      "main": [
        [
          {
            "node": "Respond / Finish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
