Quick Overview
This workflow manually scrapes portfolio or case-study pages listed in Google Sheets, converts the HTML into clean text, uses an OpenAI chat model to extract structured project credits (agency, brand, project name), and writes both results and errors back to Google Sheets while marking each input row as processed.
How it works
- Starts when you run the workflow manually.
- Reads rows from a Google Sheets input tab and filters out any URLs already marked as Done.
- Loops through each remaining row, sets the company and URL fields, and fetches the portfolio page HTML with browser-like headers.
- Validates the HTTP response and either logs a fetch error to Google Sheets or strips HTML to plain text (with truncation) for analysis.
- Sends the cleaned page text to an AI extraction agent powered by an OpenAI chat model to return a structured list of projects and credits.
- Appends extracted projects to a Google Sheets output tab (or appends an AI error if extraction fails) and updates the input row status to Done, waiting briefly before processing the next URL.
Setup
- Create a Google Sheets spreadsheet with an Input tab (Company, Website, Page URL, Status) and an Output tab (Company, Website, Page URL, Agency, Brand, Project Name, Full Page Content, Error).
- Add Google Sheets credentials in n8n and select your spreadsheet document and the correct Input/Output sheet names in all Google Sheets nodes.
- Add an OpenAI (or compatible) chat model credential for the LangChain Chat Model node.
- Ensure each Input row has a unique Page URL value so the workflow can update the matching row and set Status to Done.