Quick overview
This workflow runs every morning, reads a list of web pages from Google Sheets, uses Gaffa to capture each page as text and a PDF, and saves a new dated PDF to Google Drive only when the page content changes, updating the tracking columns back in the sheet.
How it works
- Runs every morning on a schedule.
- Reads the “Pages” tab in Google Sheets and keeps only rows that contain a “Page URL”.
- Uses Gaffa to load each URL in a browser, optionally scopes extraction to a provided CSS selector, then generates page text and a PDF.
- If the page cannot be read or no text is returned, writes an error status and “Last checked” date back to the same Google Sheets row.
- Hashes the extracted page text and compares it with the row’s previous “Last hash” value.
- When the hash has changed, downloads the generated PDF and uploads it to the target Google Drive folder with a dated filename, then updates “Last hash”, “Last changed”, “Last PDF”, “Last checked”, and “Status” in Google Sheets.
- When the hash has not changed, updates “Last checked” and sets the status to “no change” in Google Sheets.
Setup
- Install the community node
@gaffa-dev/n8n-nodes-gaffa and create a Gaffa API credential using your API key from gaffa.dev.
- Connect Google Sheets and Google Drive credentials in n8n.
- Create a Google Sheet with a tab named “Pages” and columns including Name, Page URL, Selector, Last hash, Last changed, Last PDF, Last checked, and Status.
- Create (or choose) a Google Drive folder for the archived PDFs and paste both the Google Sheet URL and Drive folder URL into the workflow’s Settings values.
- Adjust the schedule time and the wait_seconds setting if your pages load slowly or rely on JavaScript rendering.