What Is a Checksum Error? 7 Causes and How to Fix Each
A checksum error means data failed its integrity check. Which one you...
The complete n8n SEO automation workflow: connect Ahrefs API to keyword filtering, AI content generation, and WordPress auto-publishing in one end-to-end pipeline.
Every guide on n8n SEO automation covers the same 10 individual tasks. None of them show you how those tasks connect into a single pipeline that starts with a keyword list and ends with a published WordPress post — meta title, meta description, schema markup, featured image, and all. This guide does exactly that.
Most n8n SEO automation content shows you how to pull Ahrefs data into a Google Sheet, or how to generate a content brief using GPT-4, or how to auto-publish to WordPress. Each workflow is documented in isolation. That is where the real problem lives.
When you run disconnected workflows, you reintroduce manual handoffs at every stage. Your rank tracking fires at 7 AM and delivers a Slack message. Someone reads the Slack message and copies the keywords into another tool. A brief gets generated and saved to Notion. A writer opens Notion, reads the brief, opens ChatGPT, generates a draft, copies it to WordPress, adds meta fields manually. The automation covered 20% of the work and left 80% on the table.
For a deeper publishing setup, read our n8n WordPress automation workflow guide, where we explain how to auto-create SEO-ready WordPress drafts with meta data, schema considerations, featured images, categories, tags, and review steps.
The pipeline in this guide covers 100% of the journey from keyword data to live published post. Every stage passes its output directly to the next stage. No Slack messages. No copy-paste. No manual handoffs.
Starting from a Google Sheet of seed keywords, this workflow produces: filtered keyword queue → content brief → 1,800-word AI draft → published WordPress post with Yoast SEO meta title, meta description, focus keyword, FAQ schema, and featured image — fully automated, running on a schedule.
The Writimate pipeline that this article documents runs this workflow for our own content. This article itself was produced by that pipeline and edited by our team before publication. Build time for first draft: 7 minutes.
Before building individual nodes, understand the complete architecture. Every stage has one job and one output that feeds the next stage. No stage does more than one thing.
| Stage | n8n Node Type | Input | Output | Time |
|---|---|---|---|---|
| 1. Trigger | Schedule Trigger | — | Workflow starts | <1s |
| 2. Keyword Pull | HTTP Request Ahrefs | Seed keyword list | Raw keyword + metrics JSON | 3–8s |
| 3. Filter + Queue | IF Node + Code + Google Sheets | Raw keyword JSON | Filtered queue row written to sheet | 2–4s |
| 4. Brief Generation | AI Agent Claude | Keyword + metrics | Structured content brief | 15–30s |
| 5. Draft Generation | AI Agent GPT-4 | Content brief | Full HTML article draft | 45–90s |
| 6. WordPress Publish | HTTP Request WP REST API | Draft + meta fields | Published post URL | 2–5s |
| 7. Quality Gate | IF Node + Error Handler | Each stage output | Slack alert or auto-retry | Continuous |
Total pipeline execution time from trigger to published post: 90–150 seconds. That is the gap between this architecture and the 4-hour manual workflow it replaces.
Open a new workflow in n8n. Add a Schedule Trigger node as your first node. This is the only node that does not receive input from another node — it fires on a time condition and wakes the entire pipeline.
Mode: Cron Expression | Expression: 0 6 * * 1 | This fires every Monday at 6:00 AM. Start with weekly execution while you validate quality. Increase to daily after your first 10 articles confirm the pipeline output meets your standards.
A daily trigger publishing one article per day on a new domain can look unnatural if the content is not reviewed properly. Start with Monday-only triggers. Add Wednesday later if quality is holding.
Connect the Schedule Trigger to your first HTTP Request node. The trigger passes an empty object {} to the next node — that is intentional and correct. The Ahrefs node pulls its own data and does not need input from the trigger beyond the start signal.
Add an HTTP Request node. This is where most n8n SEO guides stop — they show you how to call Ahrefs and dump the response to a Google Sheet. That is not a pipeline. That is a data export. The difference in this stage is that the output flows directly into the filter node, not into a sheet for someone to review later.
Navigate to n8n credentials and create a new HTTP Header Auth credential. Set the header name to Authorization and the value to Bearer YOUR_AHREFS_API_KEY. Name it "Ahrefs API" and save. You will reference this credential in every Ahrefs HTTP Request node.
Store your Ahrefs API key in n8n's credential vault, never in the node parameters directly. If you self-host n8n, also set it as an environment variable in your .env file as a backup. Rotate the key if you ever share workflow exports with anyone.
// Node: HTTP Request
// Method: GET
// URL: https://apiv3.ahrefs.com/v3/keywords-explorer/overview
{
"keywords": "n8n automation,SEO automation,AI content pipeline",
"country": "us",
"limit": 50
}
The Ahrefs Keywords Explorer endpoint returns keyword metrics that help the filter stage decide whether a keyword enters your publishing queue.
Raw Ahrefs output is noise until filtered. This stage is where most people building n8n SEO pipelines make their most consequential mistake: they filter only by keyword difficulty and miss three other signals that determine whether a keyword is worth producing content for.
const keywords = $input.all().map(item => item.json);
const filtered = keywords.filter(kw => {
if (kw.volume < 200) return false;
if (kw.difficulty > 45) return false;
if (kw.clicks_per_search < 0.4) return false;
if (kw.cpc === 0) return false;
return true;
});
const scored = filtered.map(kw => ({
...kw,
opportunity_score: (kw.volume / Math.max(kw.difficulty, 1)).toFixed(1)
}));
scored.sort((a, b) => b.opportunity_score - a.opportunity_score);
return scored.slice(0, 5).map(kw => ({ json: kw }));
Connect the Code node to a Google Sheets node. This writes each filtered keyword as a new row in your content queue sheet. The queue sheet becomes your audit trail for every keyword that enters the publishing pipeline.
The queue sheet serves as your cannibalization prevention layer. Before the brief generation stage runs, check whether this keyword already exists with status "published". If yes, skip it.
This is where generic n8n content pipelines fail. They send a keyword directly to GPT-4 and ask it to write an article. The output is usually generic because the AI has no information about the specific SERP, competitor content gaps, or the angle that would make the article useful.
The brief generation stage fixes this by doing SERP research programmatically and feeding that intelligence into the AI before any content is written.
Add an HTTP Request node that calls your SERP data provider to pull the top 10 results for the target keyword. Extract their titles, meta descriptions, and URLs. This data goes into the brief prompt.
You are an expert SEO content strategist.
Output only valid JSON.
Target keyword: {{ $json.keyword }}
Monthly search volume: {{ $json.volume }}
Keyword difficulty: {{ $json.difficulty }}
Produce a JSON brief with:
- target_keyword
- secondary_keywords
- search_intent
- recommended_title
- recommended_h1
- meta_description
- word_count_target
- h2_sections
- must_include_topics
- avoid_topics
- content_angle
- internal_link_target
- faq_questions
With a structured brief available, the draft generation node has everything it needs to produce a strong first draft. This stage uses a separate AI node from the brief generator so you can use one model for strategic analysis and another model for long-form writing.
Write a {{ $json.brief.word_count_target }}-word article using this brief.
Title: {{ $json.brief.recommended_h1 }}
Target keyword: {{ $json.brief.target_keyword }}
Secondary keywords: {{ $json.brief.secondary_keywords }}
Angle: {{ $json.brief.content_angle }}
Requirements:
- Include target keyword in first 100 words
- Use clean HTML
- Use h2 and h3 heading hierarchy
- No markdown
- Add FAQ section at the end
Add a Code node after the draft generator to extract the meta description, clean the content, validate word count, and prepare the final fields WordPress needs.
This is the stage many guides cover too quickly. A useful automation should not only create a post. It should send the title, slug, content, status, SEO meta title, meta description, focus keyword, categories, tags, and featured image.
In WordPress admin, go to Users → Your Profile → Application Passwords. Generate a new application password named "n8n Pipeline". Copy it immediately because WordPress shows it only once.
{
"title": "{{ $json.title }}",
"content": "{{ $json.content }}",
"slug": "{{ $json.slug }}",
"status": "draft",
"meta": {
"_yoast_wpseo_title": "{{ $json.title }}",
"_yoast_wpseo_metadesc": "{{ $json.meta_description }}",
"_yoast_wpseo_focuskw": "{{ $json.focus_keyword }}"
},
"categories": [12],
"tags": [45, 67]
}
Set the WordPress status to draft until you have reviewed at least your first 20 articles. Human review protects quality, accuracy, and trust.
Add two nodes after the publish node. The first generates a featured image based on the article title. The second uploads it to the WordPress Media Library and attaches it to the post.
A pipeline without error handling is a liability. When it works, it is invisible. When it fails, it may publish a half-formed post, skip a title, or waste API credits in repeated calls.
After Stage 3 filtering, add an IF node. If filtered keyword count equals zero, send a notification and stop workflow execution.
After Stage 4, validate that all required JSON fields are present. If headings or title are missing, stop the workflow.
If draft word count is below 80% of the target, throw an error instead of sending the draft to WordPress.
After Stage 6, verify that the WordPress API returned a post ID and draft status. If not, send the full error payload for manual review.
| Tool | Monthly Cost | Used For | Can Reduce? |
|---|---|---|---|
| n8n self-hosted VPS | $6–12 | Workflow execution | No |
| Ahrefs | $199+ | Keyword research API | Yes |
| OpenAI API | $40–80 | Draft generation | Yes |
| Anthropic API | $15–25 | Brief generation | Yes |
| SERP API | $3–10 | SERP data | Yes |
| Image generation | $8–15 | Featured images | Yes |
A freelance SEO content writer may charge far more per article than this pipeline costs per generated draft. The real value is not only cost reduction, but faster research, faster formatting, and a repeatable publishing system.
A seven-stage n8n pipeline that starts with a seed keyword list, pulls related keywords, filters opportunities, generates a SERP-informed content brief, produces a structured AI draft, prepares SEO fields, uploads a featured image, and sends the post to WordPress as a draft.
What it does not do: replace editorial judgment. Every draft should still be reviewed by a human before publishing. That is where you add first-hand examples, original insight, fact-checking, and the final quality layer.
Build the pipeline once. Run it every week. Spend your time on the editorial work that automation cannot replace.