Quick overview
This workflow runs every morning to scrape a table from a web page using Gaffa, sync it to a Google Sheets “Table” tab, and append a per-row audit trail of additions, changes, and removals to a “Changes” tab.
How it works
- Runs every morning on a schedule.
- Uses Gaffa to load the configured web page in a browser and extract the target HTML table into structured rows.
- Stops with an error if the table cannot be read or if no rows contain the configured key column.
- Fetches the extracted rows, keeps only rows that have a value in the key column, and reads the existing rows from the Google Sheets “Table” tab (excluding rows already marked as removed).
- Compares the current web table rows to the Google Sheets rows using the key column to detect new, changed, and removed entries.
- Appends new rows to Google Sheets with first_seen/last_changed dates, updates changed rows in place with a refreshed last_changed date, and marks missing rows as removed by setting removed_on.
- Appends a change-log entry to the Google Sheets “Changes” tab for each addition, change (including field-level before/after details), and removal.
Setup
- Install the @gaffa-dev/n8n-nodes-gaffa community node and add a Gaffa API credential.
- Add a Google Sheets credential and create (or select) a spreadsheet with two tabs named to match your settings (default: “Table” and “Changes”).
- In the Settings step, set the Google Sheets document URL, the page URL, the CSS selector for the table, and a key column name that uniquely identifies each row.