{
  "name": "04 Weekly Shopify competitor catalog -> Google Sheet",
  "nodes": [
    {
      "parameters": {
        "content": "## Competitor catalog snapshot\nEvery Monday saves a competitor's full Shopify catalog (prices, discounts, stock) to Google Sheets so you can track changes over time.\n\n1. Open **Config** and paste your Apify API token (free account: console.apify.com -> Settings -> API & Integrations).\n2. Paste a Discord/Slack webhook URL and/or a Telegram bot token + chat ID (delete the node you don't use).\n3. Click **Test workflow**, then switch it to **Active**.",
        "height": 340,
        "width": 420
      },
      "name": "How to use",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -400
      ],
      "id": "40841a7e-3639-436d-ba76-f46b2d695794"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 7 * * 1"
            }
          ]
        }
      },
      "name": "Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "id": "bf49ed35-d1b4-425b-922f-ea934aa50652"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "cb238bd1-8a90-4a3d-977c-66c93958e280",
              "name": "apifyToken",
              "value": "YOUR_APIFY_TOKEN",
              "type": "string"
            },
            {
              "id": "15c30471-2131-4ba3-a7fe-99b69a3bbf13",
              "name": "webhookUrl",
              "value": "https://discord.com/api/webhooks/...",
              "type": "string"
            },
            {
              "id": "753b064e-1e8f-4c79-81ff-11c43b12196f",
              "name": "telegramBotToken",
              "value": "",
              "type": "string"
            },
            {
              "id": "403b8e51-ab29-4554-9ea3-d968fdfe1044",
              "name": "telegramChatId",
              "value": "",
              "type": "string"
            },
            {
              "id": "b0334234-c32c-49f2-9ae9-66d660cdda08",
              "name": "storeUrl",
              "value": "https://www.allbirds.com",
              "type": "string"
            },
            {
              "id": "d12c645a-5d0a-4a2a-b6f8-487fd8f25199",
              "name": "googleSheetUrl",
              "value": "https://docs.google.com/spreadsheets/d/...",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "id": "7dd02014-c125-4da7-a04b-5c3cb699962f"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.apify.com/v2/acts/martin10291~shopify-store-products/run-sync-get-dataset-items",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "token",
              "value": "={{ $('Config').item.json.apifyToken }}"
            },
            {
              "name": "timeout",
              "value": "280"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({storeUrls: [$('Config').item.json.storeUrl], maxProductsPerStore: 500, includeDescription: false}) }}",
        "options": {
          "timeout": 300000
        }
      },
      "name": "Run Apify scraper",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "id": "8723553b-0da1-403c-bf26-c1b8e3e91ed4"
    },
    {
      "parameters": {
        "jsCode": "const rows = $input.all();\nreturn rows.map(i => ({ json: { date: new Date().toISOString().slice(0,10), title: i.json.title, price: i.json.price, compareAtPrice: i.json.compareAtPrice, discountPercent: i.json.discountPercent, available: i.json.available, vendor: i.json.vendor, url: i.json.url } }));"
      },
      "name": "Pick columns",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        0
      ],
      "id": "4b4aaa85-2d29-405e-8390-4cdb4d1dd108"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Config').item.json.googleSheetUrl }}"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {}
        },
        "options": {}
      },
      "name": "Append to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        880,
        0
      ],
      "id": "e0653272-878d-4c31-bda5-09b5620fb198"
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "Run Apify scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify scraper": {
      "main": [
        [
          {
            "node": "Pick columns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick columns": {
      "main": [
        [
          {
            "node": "Append to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "active": false
}