Opening Problem Statement
Meet Sarah, a digital marketing strategist tasked with creating high-converting, SEO-optimized service pages for her clients. She spends countless hours manually analyzing competitors’ service pages—extracting their structure, headings, meta tags, and keywords—to gain insights. This manual work not only drains her time but is prone to overlooking nuanced SEO signals hidden in competitor pages. Meanwhile, the inability to efficiently generate an optimal content blueprint means slower content production cycles and missed ranking opportunities.
Sarah needs a way to automate this tedious analysis, generate data-driven SEO content blueprints tailored for specific service queries, and shape her content to outperform competitors. Without automation, she faces the risk of losing precious hours weekly, making costly strategic errors, and falling behind more agile competitors.
What This Automation Does
This intricate n8n workflow takes Sarah’s input of competitor URLs, a target keyword, services offered, brand name, and page type, then:
- Scrapes HTML content from up to 5 competitor service pages reliably using the Jina Reader API.
- Extracts and cleans HTML headings (H1-H6), meta tags, and schema data to analyze page structure and SEO elements.
- Processes competitor data through Google Gemini AI models to generate a comprehensive competitor analysis report highlighting meta title trends, common headings, and SEO patterns.
- Analyzes the user intent behind the target keyword independently to understand the audience’s needs, pain points, and buying journey stage.
- Synthesizes competitor insights and user intent analysis to identify content gaps, SEO keyword priorities, and UX/conversion opportunities.
- Creates a well-structured, conversion-focused page outline tailored to the brand’s unique services and user intent.
- Enhances the outline with detailed UX copywriting, calls-to-action, trust signal recommendations, and conversion optimizations.
- Compiles a final markdown blueprint that can be downloaded as a file or shared directly with clients and content teams for execution.
By automating these steps, Sarah saves hours of manual research and ensures every service page is uniquely optimized, maximizes SEO potential, and is primed for conversion.
Prerequisites ⚙️
- n8n account (cloud or self-hosted) 🔌
- Jina Reader API key (for scraping and reading competitor HTML content) 🔑
- Google Gemini (PaLM) credentials for AI analysis and content generation 🔐
- Competitor service page URLs (up to 5) 📁
- Target keyword and detailed service offerings 📊
- Brand name and indication if the page is a homepage or service page 💬
Step-by-Step Guide
Step 1: Setting Up Your Credentials in n8n
Log in to your n8n account. Navigate to Credentials and add your Jina Reader API key. Then add your Google Gemini (PaLM) API credentials as instructed in the official n8n documentation for GoogleAI integration.
Common mistake: Forgetting to set proper scopes or using invalid API keys, leading to errors in subsequent nodes.
Step 2: Configure the Form Trigger to Collect User Input
Locate the Start node of type formTrigger. Configure the form fields as in the workflow, which prompt for:
- Competitors (textarea for URLs, max 5)
- Target Keyword
- Services Offered
- Brand Name
- Is Homepage? (dropdown with Yes/No)
When this form is submitted, it triggers the workflow.
After submission, you’ll see the trigger form response confirmation.
Step 3: Convert Competitor URLs Into Individual Items
The Convert URLs to Items node (code type) takes the multiline competitor URLs string and splits it into individual items for looping. It filters out empty lines and outputs the field competitor_url.
Tip: Ensure URLs are entered correctly, one per line.
Step 4: Loop Over Each Competitor URL
The Loop Over Items node (splitInBatches) iterates over each competitor URL created.
Step 5: Fetch Competitor Page HTML Content
The Get URL HTML node (type httpRequest) calls the Jina Reader API with the competitor URL to retrieve the rendered HTML content. It handles retries and continues on error to avoid halting the workflow if one URL fails.
This node sends an authorized GET request with the URL in the endpoint and requests an HTML response.
Step 6: Extract HTML Elements and SEO Data
The Extract HTML Elements node (code type) processes the returned HTML to:
- Clean heading tags (H1-H6) and store them maintaining the original order with indentation notation.
- Extract meta tags (
title,description, Open Graph tags, Twitter cards, canonical links). - Parse JSON-LD schema markup scripts.
- Generate 2-gram, 3-gram, and 4-gram phrase frequencies from heading texts to analyze SEO keyword patterns.
Its JavaScript carefully decodes HTML entities and sorts headings by position.
Step 7: Set URL-Specific Data
The Set URL Data node structures the competitor URL, extracted outline, meta, and ngram data, converting complex JSON into string fields for subsequent processing.
Step 8: Generate a Consolidated Competitors Data Report
The Code node (JavaScript) formats all competitor data into a custom XML-like string with sections for each competitor’s URL, outline, meta, and ngrams, preparing for AI language model ingestion.
Step 9: Analyze Competitors Using Google Gemini
The Competitors Analysis node (Google Gemini AI chat model) evaluates the competitors data input to produce a detailed SEO competitor analysis report. The prompt instructs it to identify meta trends, headings, SEO concepts, and common content structures.
Step 10: Independently Analyze User Intent
The User Intent Analysis node uses Google Gemini to focus solely on the target keyword to understand the primary and secondary user intents, personas, buyer’s journey stage, and content expectations.
Step 11: Synthesize Insights & Identify Content Gaps
The Synthesis & Gap Analysis node merges competitor and user intent insights to highlight overlapping essentials, content gaps, priority keywords, and possible UX improvements.
Step 12: Generate an Ideal Page Outline
The Ideal Page Outline Generation node advises on the best H1-H4 heading structure, carefully adjusted if the page is a homepage or specific service page, incorporating SEO and conversion best practices.
Step 13: Detail UX Copywriting & Conversion Recommendations
The UX, Conversion & Copywriting Enhancement node crafts tailored CTAs, trust signals, tone of voice, interactive content ideas, and risk reversal tactics to maximize page conversion potential.
Step 14: Compile the Final Service Page SEO Blueprint
The Final Service Page Blueprint node (Google Gemini) consolidates all reports and recommendations into one comprehensive, client-ready markdown document enclosed in an XML tag for easy export.
Step 15: Download the Blueprint as Text File
The Convert to File node allows exporting the compiled blueprint as a .txt file. You can copy and share it directly or render the markdown for client presentations.
Customizations ✏️
- Modify the Google Gemini Model node to test newer models or adjust temperature values for creativity vs. precision.
- Change the Waiting Time (Seconds) in the
Edit Fieldsnode to control pacing for API usage limits, especially important on free tiers. - Update the Form Trigger to add more fields like geographic targeting or competitor page types for enhanced analysis granularity.
- Extend the Extract HTML Elements node code to capture additional SEO elements like internal links or schema types.
- Tweak the Final Service Page Blueprint AI prompt to emphasize particular copywriting styles or brand personality traits.
Troubleshooting 🔧
Problem: “HTTP Request to Jina API times out or fails repeatedly.”
Cause: Incorrect API key or exceeding rate limits.
Solution: Double-check the Jina Reader API key in Edit Fields, ensure URLs are correct, and consider increasing wait times or adding retries.
Problem: “Google Gemini AI node returns empty or error responses.”
Cause: Invalid Google Palm API credentials or quota exceeded.
Solution: Verify Google Gemini credentials are up to date under n8n credentials. If on free tier, set wait seconds high enough (>20).
Problem: “Extracted headings or meta tags are empty or inconsistent.”
Cause: Competitor pages have unusual HTML structures or JavaScript rendering missing.
Solution: Review the competitor URLs manually. Consider re-running or removing problematic URLs. Inspect Extract HTML Elements code adjustments if needed.
Pre-Production Checklist ✅
- Verify all API keys (Jina, Google Gemini) are valid and have quota available.
- Test the form trigger by submitting sample competitor URLs and checking each node’s output for expected data.
- Confirm the competitor URLs are accessible and publicly available service pages.
- Check the final blueprint output in preview and ensure markdown formatting is clean.
- Backup workflow JSON before making major modifications.
Deployment Guide
Activate the workflow by toggling it live in n8n. Share the start webhook URL with users who will submit competitor data to trigger the automation. Monitor executions via the n8n dashboard for errors or rate limit issues. For higher volume use, consider self-hosting with sufficient resources and adjust API wait times accordingly to ensure smooth performance.
FAQs
Q: Can I use competitor URLs from non-English websites?
A: Yes, but output quality depends on language support by Jina Reader API and Google Gemini models.
Q: Does this consume a lot of API credits?
A: Yes, each competitor and each AI prompt consumes API calls with costs related. Monitor usage carefully.
Q: Is my competitor data safe?
A: All data is processed within your n8n environment and through your API keys. Ensure you comply with privacy terms when scraping websites.
Conclusion
This n8n workflow powers Sarah to autonomously generate high-level SEO blueprint reports for service pages by deeply analyzing competitors and user intent. It saves her hours weekly, reduces manual errors, and delivers strategic content outlines and copy recommendations crafted by advanced AI models. By using this workflow, marketers and agencies can confidently create SEO-optimized, user-centered service pages with a stronger chance to rank and convert.
Next steps could include integrating automated content creation, continuous competitor monitoring, or expanding to product page blueprints using similar methods. Embrace automation like this to elevate your marketing strategy and win your niche.