{
  "name": "Complete Page Capture - Screenshot & PDF (long runs)",
  "nodes": [
    {
      "id": "19f4532e-c6ea-4c99-a589-35f8b7dae9eb",
      "name": "Run by hand",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "06a8ef6e-8141-4a77-a8b3-d97645c23bb3",
      "name": "Every day",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "notes": "Activate the workflow to run on this schedule."
    },
    {
      "id": "d29fec1a-be29-4132-abc7-e4db7d1b179f",
      "name": "Start Apify run",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        100
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/actors/nimbryxo-studio~full-page-website-screenshot-and-pdf-capture/runs?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"urls\": [\n    {\n      \"url\": \"https://www.apify.com/\"\n    }\n  ],\n  \"format\": \"png\",\n  \"quality\": 85,\n  \"fullPage\": true,\n  \"device\": \"custom\",\n  \"viewportWidth\": 1280,\n  \"viewportHeight\": 1080,\n  \"deviceScaleFactor\": 1,\n  \"colorScheme\": \"no-preference\",\n  \"locale\": \"en-US\",\n  \"waitUntil\": \"domcontentloaded\",\n  \"waitForImages\": false,\n  \"waitForFonts\": true,\n  \"delay\": 0,\n  \"scrollToBottom\": false,\n  \"maxScrollSteps\": 400,\n  \"scrollStepPx\": 250,\n  \"delayAfterScrolling\": 0,\n  \"waitUntilNetworkIdleAfterScroll\": false,\n  \"waitUntilNetworkIdleAfterScrollTimeout\": 1000,\n  \"hideFixedElements\": false,\n  \"cookieBannerAction\": \"hide\",\n  \"pdfPageSize\": \"web\",\n  \"pdfLandscape\": false,\n  \"pdfPrintBackground\": true,\n  \"pdfFitOnePage\": false,\n  \"pdfMargin\": \"none\",\n  \"maxConcurrency\": 1,\n  \"maxRetries\": 0,\n  \"navigationTimeoutSecs\": 60,\n  \"maxPageHeight\": 0\n}",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Actor: nimbryxo-studio/full-page-website-screenshot-and-pdf-capture. Starts the run and waits up to 60 s for it. Header Auth credential: name Authorization, value Bearer + your Apify token."
    },
    {
      "id": "aabacbf6-b091-47f7-a693-0ba2fcc23c93",
      "name": "Run finished?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        520,
        100
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "05ac2606-28dd-4bdd-a149-c8446cf35473",
              "leftValue": "={{ ['SUCCEEDED', 'FAILED', 'ABORTED', 'TIMED-OUT'].includes($json.data.status) }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "bd059c92-9e2d-4922-afb1-80f39f0f62cb",
      "name": "Check the run again",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        320
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/actor-runs/{{ $json.data.id }}?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Waits up to 60 s per check, then loops back."
    },
    {
      "id": "2dd0d20e-b7eb-41c9-a144-6fa0a02674fb",
      "name": "Run succeeded?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        780,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "e1f9cace-7523-4b0b-a768-f5beb2c2ca03",
              "leftValue": "={{ $json.data.status === 'SUCCEEDED' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "d0d3bf9a-c3c4-4356-ab48-2f2b173baed3",
      "name": "Get the results",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        -100
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/datasets/{{ $json.data.defaultDatasetId }}/items?clean=true",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 120000
        }
      },
      "notes": "Each record of the run's dataset becomes one n8n item. Connect your destination after this node."
    },
    {
      "id": "9cd7c49e-070c-45fb-a165-fcce78d2fee3",
      "name": "Run did not succeed",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        1040,
        100
      ],
      "parameters": {
        "errorMessage": "={{ 'Apify run ' + $json.data.id + ' ended with status ' + $json.data.status }}"
      }
    },
    {
      "id": "0d836aae-0e60-40ff-a96a-d0a2546a8e73",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -400
      ],
      "parameters": {
        "content": "## Complete Page Capture - Screenshot & PDF: long runs\n\nSource: [nimbryxo-studio/full-page-website-screenshot-and-pdf-capture](https://apify.com/nimbryxo-studio/full-page-website-screenshot-and-pdf-capture) on Apify.\n\nFor runs that need more than 5 minutes (the synchronous endpoint answers HTTP 408 after 300 s).\n1. Select the same Header Auth credential (name `Authorization`, value `Bearer YOUR_APIFY_TOKEN`) in the three HTTP Request nodes.\n2. Edit the JSON body of **Start Apify run** to change the input.\n3. Connect your destination after **Get the results**.\n\nGenerated by recipeforagents.com. Validated, not executed: runs are billed to your Apify account.",
        "height": 360,
        "width": 500,
        "color": 6
      }
    }
  ],
  "connections": {
    "Run by hand": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every day": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Apify run": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run finished?": {
      "main": [
        [
          {
            "node": "Run succeeded?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check the run again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check the run again": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run succeeded?": {
      "main": [
        [
          {
            "node": "Get the results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run did not succeed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
