Quick Overview
This workflow collects a keyword via an n8n form, pulls the top Google results using SerpApi, scrapes headings from competitor pages, and uses OpenAI to generate a structured SEO content brief, which it saves to Google Docs and logs to Google Sheets.
How it works
- Receives a keyword, target country, and search intent from an n8n form submission.
- Queries SerpApi’s Google Search API to fetch organic search results for the keyword and keeps the top 10 listings.
- Visits each competitor URL and extracts the page title plus H1/H2/H3 headings from the HTML.
- Aggregates the scraped competitor signals and stops if fewer than three competitor pages were successfully collected.
- Sends the competitor headings and the original inputs to OpenAI (GPT-4o) to generate a structured SEO content brief (titles, meta description, outline, keywords, gaps, and link ideas).
- Formats the brief as markdown, creates a new Google Doc, inserts the brief content, and appends the result to a Google Sheets tab for tracking.
Setup
- Add a SerpApi credential (query-string auth) and ensure your SerpApi plan allows Google search queries.
- Add an OpenAI API credential and confirm the workflow can access the GPT-4o model.
- Connect Google Docs and Google Sheets credentials with permission to create documents and append rows.
- Replace the Google Sheets spreadsheet URL/ID in the append step and ensure a sheet/tab named “Briefs” exists (or update the target sheet name).