{
  "name": "Monitor pages for visual changes",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 6 * * *"
            }
          ]
        }
      },
      "id": "schedule",
      "name": "Every morning",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// Keep this list in a spreadsheet or a table so adding a page is a row, not an edit.\nreturn [\n  { json: { url: 'https://www.example.com/pricing', notify: '#market-watch' } },\n];"
      },
      "id": "watched-pages",
      "name": "Watched pages",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "resource": "web",
        "operation": "screenshot",
        "url": "={{ $json.url }}",
        "outputFilenamePng": "page.png"
      },
      "id": "capture",
      "name": "Capture",
      "type": "@custom-js/n8n-nodes-pdf-toolkit-v2.pdfToolkit",
      "typeVersion": 1,
      "position": [
        440,
        0
      ],
      "credentials": {
        "customJsApi": {
          "id": "1",
          "name": "CustomJS account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const day = new Date().toISOString().slice(0, 10);\nconst safe = $json.url.replace(/^https?:\\\\/\\\\//, '').replace(/[^a-z0-9]+/gi, '-');\n\nreturn [{ json: { ...$json, path: `monitor/${day}/${safe}.png` }, binary: $binary }];"
      },
      "id": "name-by-date",
      "name": "Name by date",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        660,
        0
      ]
    }
  ],
  "connections": {
    "Every morning": {
      "main": [
        [
          {
            "node": "Watched pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Watched pages": {
      "main": [
        [
          {
            "node": "Capture",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Capture": {
      "main": [
        [
          {
            "node": "Name by date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}
