You’re a master of ranking websites, but is your own agency running on manual, repetitive tasks? If you’re buried in keyword research, backlink monitoring, and endless content brief generation, you’re not alone. This operational drag is the ceiling on your agency’s growth.

It’s time to build a solution: a custom AI agent, powered by n8n, that works for you 24/7. This isn’t a vague concept; it’s a concrete set of automated workflows designed to handle specific, revenue-generating tasks. This guide will show you how to build your first two essential agent workflows, step-by-step.

Core Components: Your Agent’s Toolkit

Before we start, let’s gather the tools.

  • n8n Instance: You can use n8n’s cloud offering or self-host on a provider like DigitalOcean or Hetzner. Self-hosting gives you more control and can be more cost-effective for high-volume workflows.
  • LLM APIs: You’ll need an API key from at least one major provider like OpenAI (GPT-4o), Anthropic (Claude 3.5), or Google (Gemini 2.5). We’ll use n8n’s versatile “HTTP Request” node to call these.
  • Data Sources: To be effective, your agent needs data. Get API access for your primary SEO tool (Ahrefs, Semrush, etc.) and Google Search Console. A SERP scraping API can also be useful.

Workflow 1: The “Keyword Opportunity” Agent

This agent automatically finds low-competition, high-intent keywords for your clients, saving hours of manual research.

1. The Trigger: Start with the “Schedule” node. Set it to run automatically every Sunday at 8 PM, so you have fresh opportunities waiting for you on Monday morning.

2. Get GSC Data: Use the “Google Search Console” node to pull all search queries from the last 30 days that have high impressions but a low click-through rate (CTR). This is your pool of untapped potential.

3. Filter & Enrich: Use the “Filter” node to remove any branded keywords. Then, connect to your SEO tool’s API to enrich the remaining keywords with their Keyword Difficulty (KD) score.

4. The AI Brain (LLM Call): This is where the magic happens. Use the “HTTP Request” node to send your data to an LLM.

*   **Prompt Example:**
    ```
    You are an expert SEO analyst. The following list contains keywords with their impressions, CTR, and keyword difficulty.
    
    Identify the top 3 'hidden opportunity' keywords from this list. For each one, explain *why* it's an opportunity (e.g., 'high impressions and low KD suggests we can rank easily') and suggest a compelling blog post title.
    
    [Your list of keywords here]
    ```

5. The Output: The final step is to deliver the results. Use the “Slack” node to send a formatted message to a #client-keyword-opportunities channel or the “Google Sheets” node to add the results to a client-specific report.


Workflow 2: The “Content Brief” Generator

This workflow turns a target keyword into a comprehensive content brief for your writing team in seconds.

1. The Trigger: This can be a “Manual” trigger for ad-hoc briefs, or you can use a “Webhook” node to trigger it from your project management tool (like a Trello card moving to the “Briefing” stage).

2. SERP Analysis: Use a SERP API or a custom scraping solution to get the content from the top 10 ranking pages for your target keyword.

3. The AI Brain (LLM Call): Send the scraped content to your LLM.

*   **Prompt Example:**
    ```
    You are a world-class content strategist. I am providing you with the text from the top 10 Google results for the keyword '[Keyword]'.

    Analyze this content and generate a comprehensive content brief for a writer. The brief must include:
    - A compelling and SEO-optimized title.
    - A meta description under 160 characters.
    - A recommended article structure with H2s and H3s.
    - A list of 5-7 essential semantic keywords to include.
    - 3-5 critical questions the article must answer, based on the provided content.
    ```

4. The Output: Use the “Google Docs” node to create a new document from a pre-formatted template and populate it with the AI-generated brief. Finally, send the link to the new doc back to your project management tool or a Slack channel.


From Workflows to Agent

The true power of an agent comes from chaining these workflows together. Use the “Execute Workflow” node to connect them. For example, after the “Keyword Opportunity” agent finds a great keyword, it can automatically trigger the “Content Brief” agent to generate the brief. This creates a seamless system that moves from data analysis to content production with zero human intervention.

Your Agency on Autopilot

You’ve just built the foundation of an AI-powered SEO agency. Start by automating one of these tasks this week. Once you see the time savings, you’ll be ready to build agents for backlink monitoring, technical SEO audits, client reporting, and beyond. The only limit is your imagination.

Frequently asked questions

What APIs do I need to build an SEO agent in n8n?

At minimum, an LLM API key (OpenAI, Anthropic, or Google), Google Search Console access, and your SEO platform's API (Ahrefs, Semrush, or similar). A SERP scraping API is useful for the content-brief workflow specifically.

Can this replace paid rank-tracking software?

For a scrappy or budget-conscious setup, yes, the keyword-opportunity workflow in this guide builds a comparable daily rank check using a SERP API and a spreadsheet. It won't match a mature rank tracker's historical reporting UI, but it removes the subscription cost.

How do I connect the keyword and content-brief agents together?

Use n8n's Execute Workflow node. Have the keyword-opportunity agent call the content-brief workflow directly once it identifies a strong keyword, passing the keyword as input, so the system goes from opportunity to draft brief with no manual handoff.

Want this built for you?

We design and ship production n8n automation for agencies, and train your team to own it.

Book a build →