{
  "name": "Generate website screenshots on-demand with ScreenshotMachine API via webhooks",
  "nodes": [
    {
      "id": "57d3821e-cba4-47fc-b92a-c1dd2e6337ca",
      "name": "Note: Webhook Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        1740
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "This node listens for incoming POST requests. It expects a JSON body with a 'url' property (the website URL you want to screenshot)."
      }
    },
    {
      "id": "6b55c36a-1e8f-4609-af02-e09347b1f06e",
      "name": "Note: URL Validation & Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2060,
        1700
      ],
      "parameters": {
        "width": 400,
        "height": 360,
        "content": "This crucial node validates the incoming 'url' to prevent Server-Side Request Forgery (SSRF) vulnerabilities. It checks for valid HTTP/HTTPS protocols and ensures the URL does not point to internal/pr"
      }
    },
    {
      "id": "4d67e039-3198-4ff1-b72b-94dccf3125df",
      "name": "Note: Screenshot API Call (GET)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2500,
        1660
      ],
      "parameters": {
        "width": 340,
        "height": 320,
        "content": "This node makes an HTTP GET request to the ScreenshotMachine API using the validated URL. Remember to replace 'YOUR_API_KEY' in the URL parameter with your actual API key.\n\nThis method is critical: Sc"
      }
    },
    {
      "id": "296d8f30-1015-4070-acc0-7e1b2e3cbac8",
      "name": "Note: Webhook Response",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        1780
      ],
      "parameters": {
        "width": 340,
        "height": 480,
        "content": "1. If the URL is invalid or blocked by security checks, it sends a clear error message.\n2. If the screenshot is successful, it sends the data received from ScreenshotMachine API back to the original w"
      }
    },
    {
      "id": "548687ec-3af4-4d2b-a8ac-93eecaabcb6c",
      "name": "Note: Resolve URL (HEAD Request)",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1780,
        1820
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "This node performs a HEAD request to the incoming URL.\n\nIt checks if the URL is reachable and resolves any redirects. This acts as an initial connectivity and basic validity check before more granular"
      }
    },
    {
      "id": "86316119-a064-4052-a27c-07c957c71802",
      "name": "Receive URL Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1560,
        1920
      ]
    },
    {
      "id": "1abb0d7c-9064-4e75-89be-cc7c409ecb84",
      "name": "Resolve URL (HEAD Request)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1840,
        2000
      ]
    },
    {
      "id": "1a9218c1-a132-4109-88da-0ac24236de34",
      "name": "Validate URL for SSRF",
      "type": "n8n-nodes-base.code",
      "position": [
        2120,
        1900
      ]
    },
    {
      "id": "922a97b7-1df7-40f6-836e-b8ade7a48176",
      "name": "IF URL Valid",
      "type": "n8n-nodes-base.if",
      "position": [
        2380,
        1980
      ]
    },
    {
      "id": "627362d9-f789-4810-9e2b-5678ee5ac209",
      "name": "Take Screenshot",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2620,
        1840
      ]
    },
    {
      "id": "68c3d952-de02-4de1-bd4e-363a28e1ab05",
      "name": "Respond with Screenshot Data",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3000,
        1920
      ]
    },
    {
      "id": "38161c96-327c-42af-ab14-5825f6f2aafd",
      "name": "Respond with Validation Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3000,
        2080
      ]
    }
  ],
  "connections": {
    "IF URL Valid": {
      "main": [
        [
          {
            "node": "Take Screenshot",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond with Validation Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Take Screenshot": {
      "main": [
        [
          {
            "node": "Respond with Screenshot Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive URL Webhook": {
      "main": [
        [
          {
            "node": "Resolve URL (HEAD Request)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate URL for SSRF": {
      "main": [
        [
          {
            "node": "IF URL Valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Resolve URL (HEAD Request)": {
      "main": [
        [
          {
            "node": "Validate URL for SSRF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IF URL Valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}