Quick overview
This workflow receives a webhook from your CI when a pull request preview is deployed, screenshots only the changed preview routes using Snapshot Site, and posts a single GitHub pull request comment containing a summary table, embedded screenshots, and any capture failures.
How it works
- Receives a POST webhook from your CI with the GitHub owner, repository, PR number, preview base URL, and a list of changed page routes to capture.
- Validates the payload, builds full https:// URLs for each route, removes duplicates, and caps the run to a configurable maximum number of pages.
- Waits 30 seconds to let the preview deployment warm up.
- Iterates through the selected pages and calls Snapshot Site to capture full-page WebP screenshots at 1280px wide with cookie banners hidden.
- Records each capture result as success (with an image link) or failure (with an error message) without stopping the run when a page fails.
- Builds one GitHub-flavoured Markdown comment containing a results table, collapsible screenshot previews, and a “could not be captured” list, then posts it to the pull request as a single comment via GitHub.
Setup
- Install the verified community node
n8n-nodes-snapshot-site and add Snapshot Site API credentials in n8n.
- Add GitHub credentials with permission to create pull request comments (classic PAT with
repo, or a fine-grained token with Pull requests: Read and write for the target repository).
- Activate the workflow, copy the Webhook node’s Production URL, and configure your CI/preview deployment job to POST
owner, repository, prNumber, previewUrl (including https://), and a pages[] array of changed routes (optionally maxPages and commit).