{
  "name": "Shotmint: daily website screenshot archive",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "triggerAtHour": 6
            }
          ]
        }
      },
      "id": "a1b2c3d4-0001-4000-8000-000000000001",
      "name": "Every day at 06:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a1b2c3d4-0101-4000-8000-000000000001",
              "name": "api_key",
              "value": "YOUR_KEY",
              "type": "string"
            },
            {
              "id": "a1b2c3d4-0101-4000-8000-000000000002",
              "name": "urls",
              "value": "https://example.com\nhttps://en.wikipedia.org/wiki/Screenshot",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "a1b2c3d4-0002-4000-8000-000000000002",
      "name": "Your key and URLs",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// One item per URL: accepts newlines, commas or spaces, and bare domains like example.com\nconst { api_key, urls } = $input.first().json;\nreturn String(urls).split(/[\\s,]+/).filter(Boolean)\n  .map(u => ({ json: { api_key, url: /^https?:\\/\\//i.test(u) ? u : 'https://' + u } }));"
      },
      "id": "a1b2c3d4-0003-4000-8000-000000000003",
      "name": "One item per URL",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        440,
        0
      ]
    },
    {
      "parameters": {
        "url": "https://shotmint.creasework.com/v1/screenshot",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $json.url }}"
            },
            {
              "name": "full_page",
              "value": "true"
            },
            {
              "name": "block_ads",
              "value": "true"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-Key",
              "value": "={{ $json.api_key }}"
            }
          ]
        },
        "options": {
          "batching": {
            "batch": {
              "batchSize": 2,
              "batchInterval": 0
            }
          },
          "response": {
            "response": {
              "responseFormat": "file",
              "outputPropertyName": "data"
            }
          },
          "timeout": 90000
        }
      },
      "id": "a1b2c3d4-0004-4000-8000-000000000004",
      "name": "Shotmint screenshot",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        660,
        0
      ]
    },
    {
      "parameters": {
        "operation": "write",
        "fileName": "={{ '/home/node/.n8n-files/shotmint-' + $now.toFormat('yyyy-MM-dd') + '-' + $('One item per URL').item.json.url.replace(/^https?:\\/\\//i, '').replace(/[^a-z0-9.-]+/gi, '_').replace(/_+$/, '') + '.png' }}",
        "dataPropertyName": "data",
        "options": {}
      },
      "id": "a1b2c3d4-0005-4000-8000-000000000005",
      "name": "Save PNG (swap for Drive, S3, Slack...)",
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        880,
        0
      ]
    },
    {
      "parameters": {
        "content": "## Shotmint daily screenshot archive\n1. Get a free key (25 renders a month, no signup): https://shotmint.creasework.com/pricing#free\n2. Open **Your key and URLs**: paste the key and your URLs (one per line).\n3. Activate the workflow: it captures every URL each morning as shotmint-DATE-site.png files.\n\n1 credit per screenshot; failed renders are free. Files land in /home/node/.n8n-files (the folder n8n 2.x allows in Docker; change the path if you run n8n elsewhere). Or replace the last node with Google Drive, S3, Dropbox or Slack to keep the files elsewhere. Every parameter: https://shotmint.creasework.com/docs\nNeed more credits? €5 for 2,000, never expire: https://shotmint.creasework.com/pricing",
        "height": 300,
        "width": 520
      },
      "id": "a1b2c3d4-0006-4000-8000-000000000006",
      "name": "Read me",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -340
      ]
    }
  ],
  "connections": {
    "Every day at 06:00": {
      "main": [
        [
          {
            "node": "Your key and URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Your key and URLs": {
      "main": [
        [
          {
            "node": "One item per URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "One item per URL": {
      "main": [
        [
          {
            "node": "Shotmint screenshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shotmint screenshot": {
      "main": [
        [
          {
            "node": "Save PNG (swap for Drive, S3, Slack...)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}