URL to PDF in n8n and Zapier without code

By Siftwright team10 min read

A lot of "save this page as a PDF" work happens in automation tools, not in application code. An agency archives every landing page it launches. An operations team saves supplier terms each time a new vendor is added to a sheet. A finance team keeps a copy of each online invoice page. Nobody wants to stand up a headless browser for this, and nobody should have to write a Python service for it.

Both n8n and Zapier can do it with a generic HTTP step that calls a URL-to-PDF API, then a step that downloads the file and drops it somewhere useful. This guide shows both, using the Siftwright screenshot endpoint in PDF mode. You can import the n8n workflow as it stands. For Zapier it covers the one limit that trips people up, the 30-second step timeout.

If you only need a PDF of one page right now, you don't need any of this: the free website to PDF converter does single pages in the browser.

What the API call looks like

Everything below wraps a single request. You send a public URL, ask for pdf, and pick a page size:

curl https://siftwright.com/v1/screenshot \
  -H "Authorization: Bearer $SIFTWRIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "pdf", "pdfPageFormat": "A4"}'

The response is JSON. Each page you asked for comes back as one entry in results:

{
  "endpoint": "screenshot",
  "count": 1,
  "billed": 1,
  "results": [
    {
      "url": "https://example.com/",
      "status": "ok",
      "format": "pdf",
      "fileUrl": "https://api.apify.com/v2/key-value-stores/.../records/capture-....pdf?signature=...",
      "sizeBytes": 88386
    }
  ],
  "usage": { "plan": "starter", "used": 1, "quota": 10000, "remaining": 9999, "period_end": "..." }
}

Three details shape the automations:

  • The PDF is not in the response body. You get a signed fileUrl. It downloads without your API key and the file is kept for 7 days, so the automation needs a second step that fetches it and stores it somewhere permanent.
  • Failures come back as "status": "error" inside results, not as an HTTP error. A page that doesn't resolve still gives you HTTP 200 with an error entry, and it isn't billed. Your workflow should check status before trying to download.
  • Real HTTP errors mean something is wrong with the request itself: 401 for a missing or wrong key, 402 for an inactive subscription, 429 for quota or rate limits (60 requests per minute per key), 504 if a job ran too long. Those are worth surfacing, not silently retrying forever.

Other options you can pass: pdfPageFormat (A4, A3, Letter, Legal), waitForSelector to wait for a chart or a late-loading element, delaySec (0 to 10), and blockCookieBanners (on by default). The full list is in the API docs.

The n8n workflow

The workflow has six nodes:

  1. Start: a manual trigger. Swap it for a Schedule Trigger, a Google Sheets trigger or a Webhook once it works.
  2. Pages: a Code node that emits one item per URL. In real use this is usually a Sheets or Airtable node.
  3. Render PDF: an HTTP Request node that calls /v1/screenshot.
  4. Keep successes: a short Code node that drops failed pages and logs why.
  5. Download PDF: an HTTP Request node that fetches fileUrl as a binary file.
  6. Save PDF: writes the file to disk. Replace it with Google Drive, S3, Dropbox or an email attachment.

Store the key as a credential

Don't paste the API key into the node. In n8n, create a credential of type Header Auth with:

  • Name: Authorization
  • Value: Bearer sw_live_... (your key, with the word Bearer and a space in front)

Call the credential Siftwright API. The workflow below refers to it by that name. After import, open the Render PDF node and select your credential if n8n doesn't pick it up on its own.

The workflow JSON

Copy this, then in n8n use Workflows → Import from File (or paste it straight onto the canvas):

{
  "name": "URL to PDF (Siftwright)",
  "nodes": [
    { "parameters": {}, "id": "a1", "name": "Start", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [0, 0] },
    { "parameters": { "jsCode": "// One item per page you want as a PDF. Replace with a Google Sheets, Airtable or webhook node.\nreturn [\n  { json: { url: 'https://example.com', name: 'example-home' } },\n  { json: { url: 'https://www.iana.org/help/example-domains', name: 'iana-example-domains' } },\n  { json: { url: 'https://does-not-exist.invalid', name: 'broken-link' } },\n];" }, "id": "a2", "name": "Pages", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [220, 0] },
    { "parameters": { "method": "POST", "url": "https://siftwright.com/v1/screenshot", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ url: $json.url, format: 'pdf', pdfPageFormat: 'A4' }) }}", "options": { "timeout": 300000, "batching": { "batch": { "batchSize": 1, "batchInterval": 2000 } } } }, "id": "a3", "name": "Render PDF", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [440, 0], "retryOnFail": true, "maxTries": 2, "waitBetweenTries": 5000, "credentials": { "httpHeaderAuth": { "id": "swapi01", "name": "Siftwright API" } } },
    { "parameters": { "jsCode": "// Keep successful renders, log failures. Failed pages are not billed.\nconst out = [];\nfor (const [i, item] of $input.all().entries()) {\n  const page = $('Pages').itemMatching(i).json;\n  const r = (item.json.results || [])[0] || {};\n  if (r.status === 'ok' && r.fileUrl) {\n    out.push({ json: { name: page.name, url: r.url, fileUrl: r.fileUrl, sizeBytes: r.sizeBytes } });\n  } else {\n    console.log(`No PDF for ${page.url}: ${r.error || 'unknown error'}`);\n  }\n}\nreturn out;" }, "id": "a4", "name": "Keep successes", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [660, 0] },
    { "parameters": { "url": "={{ $json.fileUrl }}", "options": { "response": { "response": { "responseFormat": "file" } } } }, "id": "a5", "name": "Download PDF", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [880, 0] },
    { "parameters": { "operation": "write", "fileName": "=/tmp/pdfs/{{ $('Keep successes').item.json.name }}-{{ $now.toFormat('yyyy-MM-dd') }}.pdf", "dataPropertyName": "data", "options": {} }, "id": "a6", "name": "Save PDF", "type": "n8n-nodes-base.readWriteFile", "typeVersion": 1, "position": [1100, 0] }
  ],
  "connections": {
    "Start": { "main": [[{ "node": "Pages", "type": "main", "index": 0 }]] },
    "Pages": { "main": [[{ "node": "Render PDF", "type": "main", "index": 0 }]] },
    "Render PDF": { "main": [[{ "node": "Keep successes", "type": "main", "index": 0 }]] },
    "Keep successes": { "main": [[{ "node": "Download PDF", "type": "main", "index": 0 }]] },
    "Download PDF": { "main": [[{ "node": "Save PDF", "type": "main", "index": 0 }]] }
  },
  "settings": {}
}

Why each setting is there

JSON body built with an expression. JSON.stringify({ url: $json.url, ... }) builds the body from each incoming item, so one HTTP node handles any number of pages. Building it with JSON.stringify instead of typing raw JSON with {{ }} inside it means a URL containing quotes or ampersands can't break the body.

Timeout of 300,000 ms. The endpoint waits for the browser to finish, up to about 280 seconds for heavy pages. Most single pages finish in seconds, but a timeout shorter than the API's own limit gives you a failed node while the render may still succeed on our side.

Batching: 1 item every 2 seconds. n8n sends all items in parallel by default. One at a time with a short gap keeps a 500-row sheet well under the 60-requests-per-minute limit, and it's easier on the sites you're capturing.

Retry on fail, 2 tries, 5 seconds apart. This covers the occasional network blip or 502. Don't raise it much: a 401 or 402 will fail every time, and you want to see that quickly.

A Code node instead of an IF node. The response nests the result inside an array, and the useful fields (the page's name, the error message) live in two different nodes. Six lines of JavaScript are clearer than an IF node plus an expression for every field. Failed pages show up in the execution log with their error message.

Download as a file. Setting the response format to File puts the PDF in the item's binary property data, which is what Google Drive's Upload file, S3's Upload, email nodes' attachments and the disk-write node all expect.

Swapping the last node for Google Drive

Delete Save PDF, add a Google Drive → Upload file node, set Input Data Field Name to data, and set the file name to an expression such as:

{{ $('Keep successes').item.json.name }}-{{ $now.toFormat('yyyy-MM-dd') }}.pdf

Dating the file name keeps a history when the same page is captured every week. If you need copies you can prove haven't been changed since, see archiving web pages for compliance, which adds hashes and trusted timestamps.

How we tested the n8n workflow

We ran the exact workflow above on n8n 1.123.97 (self-hosted, imported with n8n import:workflow and run with n8n execute) in two ways:

  • Against the live API with a deliberately invalid key. The Render PDF node sent the request, got HTTP 401 invalid_api_key, retried once and stopped with n8n's "Authorization failed" error. That confirms the header credential and JSON body are wired the way the endpoint expects.
  • End to end against a local stand-in for the API that returns the same response shape, with fileUrl pointing at a real PDF rendered by siftwright.com's free URL-to-PDF tool. Three pages went in. Two came out as one-page A4 PDFs on disk (88,386 bytes each), and the unresolvable domain was dropped by Keep successes with its error logged. The whole run took about 8.5 seconds, including n8n's own start-up.

We did not run it against /v1/screenshot with a real paid key for this post, so the response above shows the documented shape with the file link shortened.

The Zapier version

Zapier has no node for us, but Webhooks by Zapier can call any JSON API. Note that Webhooks by Zapier is a premium app, so it needs a paid Zapier plan. A typical Zap:

  1. Trigger: New Spreadsheet Row in Google Sheets (column A holds the URL), a form submission, or Schedule by Zapier.
  2. Action: Webhooks by Zapier → Custom Request
    • Method: POST
    • URL: https://siftwright.com/v1/screenshot
    • Data: {"url": "<map the URL field here>", "format": "pdf", "pdfPageFormat": "A4"}
    • Headers: Authorization → Bearer sw_live_..., and Content-Type → application/json
  3. Action: Filter by Zapier, so the Zap only continues if Results Status exactly matches ok.
  4. Action: Google Drive → Upload File, with the File field mapped to Results File Url.

Step 4 relies on Zapier's file handling. When you map a URL into a file field, Zapier downloads it and passes the file on, so you don't need a separate download step. Because fileUrl is a signed public link, no extra authentication is needed.

Use Custom Request rather than the simpler POST action. The POST action sends form-style data by default, and you'd have to fight its payload settings to get a clean JSON body. Custom Request sends exactly what you type in Data.

We didn't run this Zap ourselves. It uses only the standard Custom Request, Filter and Upload File steps. If a field name differs in your account, map it from the sample data Zapier shows after you test step 2.

The 30-second limit

Zapier stops waiting for an HTTP request after about 30 seconds, and you can't raise that limit for Webhooks by Zapier. That shapes how you use any rendering API from a Zap:

  • Send one URL per run. The API accepts up to 5 URLs per request, but in Zapier you want each page to be its own Zap run so each request stays short.
  • Keep waits small. delaySec and waitForSelector add to the render time. Use them only for pages that need them.
  • Heavy pages belong in n8n or code. A long, image-heavy page can take longer than 30 seconds to load and print. If a Zap times out on certain pages, move those pages to an n8n workflow (where you control the timeout) or a script.

A timed-out step shows as an error in Zap history. Don't just replay it in a tight loop. Check whether the page is unusually slow first.

Which one to use

n8n Zapier
Request timeout You set it (we use 300 s) About 30 s, fixed
Many URLs per run Yes, with batching One per Zap run is safest
Error handling Code node, retries, error workflows Filter step, Zap history
Self-hosting Yes No
Plan needed for HTTP calls Any, including self-hosted A paid plan (Webhooks is premium)

If your team already lives in Zapier and the pages are ordinary marketing or document pages, the Zapier recipe is the shortest path. If you're capturing hundreds of pages on a schedule, or pages heavy enough to take more than half a minute, n8n gives you the control you need.

Common problems

  • Blank or half-rendered PDF. The page builds its content with JavaScript after load. Add waitForSelector with a CSS selector for the content you need, for example "waitForSelector": "#report-table".
  • Cookie banner printed on every page. blockCookieBanners is on by default and handles common consent buttons, but not every custom one. A banner that survives usually needs a page-specific fix on the site side, or a print stylesheet if it's your own page.
  • Page needs a login. The renderer only sees public URLs. For your own private documents, serve them at a signed, expiring URL. The HTML to PDF at scale guide shows how, along with print CSS for page breaks and margins.
  • 401 in the first run. In n8n, check that the credential value starts with Bearer (with the space). In Zapier, check that the header name is exactly Authorization.

Next steps

Import the workflow, point Pages at your own sheet, and run it with two or three URLs first. A Siftwright API plan starts at $29 a month, and pages that fail to render aren't billed. If something in either recipe doesn't work for you, tell us at support@siftwright.com.

Related guides

Get the next guide by email

Practical tutorials on transcripts, screenshots, news data and agent tooling. A couple of emails a month at most.