{
  "name": "Kundrik Apps: Shopify Price Drop & Restock Alerts (Slack/Discord)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        220,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/simon_kundrik~shopify-price-restock-monitor/run-sync-get-dataset-items?token={{ $env.APIFY_TOKEN }}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"stores\": [\n    \"https://allbirds.co.uk\"\n  ],\n  \"watchEvents\": [\n    \"price_drop\",\n    \"back_in_stock\",\n    \"sale_started\"\n  ],\n  \"deltaMode\": true,\n  \"stateStoreName\": \"n8n-shopify-alerts\",\n  \"firstRunMode\": \"seed_only\",\n  \"minPriceChangePercent\": 10,\n  \"onlyAvailable\": true\n}",
        "options": {
          "timeout": 120000
        }
      },
      "id": "run-apify-actor",
      "name": "Run Kundrik Apify Monitor",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "leftValue": "={{ $json.url || $json.filingUrl || $json.applyUrl || '' }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty"
              }
            }
          ]
        }
      },
      "id": "filter-non-empty",
      "name": "Only If New Delta Found",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2,
      "position": [
        740,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.ALERT_WEBHOOK_URL }}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"text\": \"={{ '[' + $json.changeType + '] ' + $json.title + ' (' + ($json.variantTitle || 'Default') + ') -> ' + $json.currency + ' ' + $json.price + ' (' + ($json.priceChangePercent || 0) + '%) ' + $json.url }}\",\n  \"content\": \"={{ '[' + $json.changeType + '] ' + $json.title + ' (' + ($json.variantTitle || 'Default') + ') -> ' + $json.currency + ' ' + $json.price + ' (' + ($json.priceChangePercent || 0) + '%) ' + $json.url }}\"\n}"
      },
      "id": "send-webhook",
      "name": "Send Slack / Discord Alert",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1000,
        300
      ]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Run Kundrik Apify Monitor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Kundrik Apify Monitor": {
      "main": [
        [
          {
            "node": "Only If New Delta Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only If New Delta Found": {
      "main": [
        [
          {
            "node": "Send Slack / Discord Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false,
    "source": "https://kundrikapps.co.uk/templates/"
  }
}
