{"id":1462,"date":"2026-06-14T23:45:32","date_gmt":"2026-06-14T22:45:32","guid":{"rendered":"https:\/\/howtomake.best\/my_website4\/automated-content-pipeline-n8n-openrouter\/"},"modified":"2026-06-14T23:45:36","modified_gmt":"2026-06-14T22:45:36","slug":"automated-content-pipeline-n8n-openrouter","status":"publish","type":"post","link":"https:\/\/howtomake.best\/my_website4\/automated-content-pipeline-n8n-openrouter\/","title":{"rendered":"How I Built a $0 Automated Content Pipeline: n8n + OpenRouter + ComfyUI + WordPress"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Over the past month I built an automated content pipeline that generates 2500+ word SEO articles, creates images, and publishes to WordPress \u2014 all for free. Here is exactly how it works, what it cost, and the real Rank Math scores it achieves.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-0-what-the-pipeline-does\">What the Pipeline Does<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The pipeline runs daily and performs these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Research<\/strong>: Queries SearXNG for trending topics in AI\/automation niches<\/li>\n<li><strong>Generation<\/strong>: Uses OpenRouter&#8217;s gpt-oss-120b:free model to write 2500+ word articles in two parts (Part A + Part B concatenated)<\/li>\n<li><strong>SEO Structure<\/strong>: Injects Rank Math TOC shortcode, FAQ blocks, internal\/external links, anchor-linked headings<\/li>\n<li><strong>Images<\/strong>: Generates hero image via ComfyUI (juggernaut model), uploads 4 inline images<\/li>\n<li><strong>Publishing<\/strong>: Creates WordPress post, sets Rank Math meta, uploads images, publishes if score \u2265 81<\/li>\n<li><strong>Social<\/strong>: Posts to X and LinkedIn (when bridge is running)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-1-pipeline-architecture\">Pipeline Architecture<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/howtomake.best\/my_website4\/wp-content\/uploads\/2026\/06\/pipeline_architecture.png\" alt=\"Pipeline Architecture\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The pipeline is a single Python script (~1100 lines) running in WSL, not a complex n8n workflow. n8n handles image generation and has webhooks for WordPress publishing, but the orchestration is local Python. This keeps it simple and debuggable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-2-n8n-workflows\">The n8n Workflows<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">n8n runs on Docker at 172.30.0.10:5678 with 100+ workflows. Three are critical to the pipeline:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/howtomake.best\/my_website4\/wp-content\/uploads\/2026\/06\/n8n_screenshot.png\" alt=\"n8n Overview\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ComfyUI Image Gen<\/strong> (WDiBQ0A8n49Gd7MO): Receives a prompt, calls ComfyUI API on Windows host, returns the image URL. ~20s runtime.<\/li>\n<li><strong>WP Publish<\/strong> (0RdzR0MKwrQtXIk9): Creates WordPress post, sets Rank Math meta, handles media upload via upload-media.php. Auth via app password.<\/li>\n<li><strong>SEO Article Writer<\/strong> (mQNioKkECklJd24i): Generates 2500+ word articles via groq webhook. ~75s runtime.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-3-cost-comparison\">Cost Comparison: Manual vs Automated<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/howtomake.best\/my_website4\/wp-content\/uploads\/2026\/06\/cost_comparison.png\" alt=\"Cost Comparison\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead><tr><th>Method<\/th><th>Cost\/article<\/th><th>Time\/article<\/th><th>SEO Score<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>Manual writer (Fiverr)<\/td><td>$50<\/td><td>3-4 hours<\/td><td>Varies<\/td><\/tr>\n<tr><td>ChatGPT API (gpt-4o)<\/td><td>$8<\/td><td>5 min<\/td><td>~70<\/td><\/tr>\n<tr><td>OpenRouter (gpt-oss-120b:free)<\/td><td>$0<\/td><td>5 min<\/td><td>~85<\/td><\/tr>\n<tr><td>This pipeline<\/td><td>$0<\/td><td>~6 min<\/td><td>85-91<\/td><\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-4-seo-score-evolution\">SEO Score Evolution<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/howtomake.best\/my_website4\/wp-content\/uploads\/2026\/06\/seo_evolution.png\" alt=\"SEO Score Evolution\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We iterated from 55 to 91 by fixing specific Rank Math score factors:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>v2<\/strong>: Added TOC (table of contents) \u2192 +10 points<\/li>\n<li><strong>v3<\/strong>: Added inline images \u2192 +6 points<\/li>\n<li><strong>v4<\/strong>: Added keyword in slug, proper TOC classes \u2192 +10 points<\/li>\n<li><strong>v5<\/strong>: Fixed heading keyword stuffing \u2192 +5 points<\/li>\n<li><strong>v6<\/strong>: Added image alt text \u2192 +5 points<\/li>\n<li><strong>v7<\/strong>: Removed hero image duplication, fixed TOC to shortcode \u2192 stabilized at 85<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-5-key-technical-decisions\">Key Technical Decisions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Two-Part Generation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Single API calls cap at ~2000 tokens output. We split generation into Part A (intro + setup) and Part B (advanced + troubleshooting + FAQ), concatenating them. This reliably produces 2500+ rendered words.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Focus Keyword in URL<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Rank Math penalizes slugs that don&#8217;t contain the focus keyword. We build the slug from the focus keyword (e.g., &#8220;best-free-ai-tools&#8221;) not the full title. Short, keyword-rich URLs score higher.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Rank Math TOC Shortcode<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Raw HTML TOC divs don&#8217;t collapse. Using the <code>[rank_math_table_of_contents]<\/code> shortcode gives you the native Rank Math JS with collapsible sections and proper styling.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-6-what-still-needs-work\">What Still Needs Work<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Social posting<\/strong>: The bridge at 172.30.0.6:9121 is down. Need to route through n8n webhooks instead.<\/li>\n<li><strong>Image alt text<\/strong>: Using focus keyword as alt \u2014 could be more descriptive.<\/li>\n<li><strong>Topic selection<\/strong>: Currently random from 10 niches. Should use actual search volume data.<\/li>\n<li><strong>Internal linking<\/strong>: Links to slugs that may not exist yet. Need to check post existence first.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-7-source-code\">Source Code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The pipeline script is at <code>\/workspace\/scripts\/auto_content_pipeline.py<\/code> (~1121 lines). Key functions:<\/p>\n\n\n\n<pre><code>generate_article(title, focus_keyword)     # Two-part OpenRouter generation\ninject_seo_structure(content, title, kw)   # TOC, links, FAQ\npublish_wordpress(title, content, kw, ...) # REST API + Rank Math meta\nverify_score(post_id, focus_keyword)       # Parse actual post content<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For the full setup \u2014 n8n Docker Compose, WordPress config, ComfyUI API \u2014 check the infrastructure docs in <code>\/workspace\/infra\/<\/code>.<\/p>\n\n\n<p>[rank_math_table_of_contents]<\/p>\n\n\n\n<div class=\"rank-math-block\" id=\"rank-math-faq\"><div class=\"rank-math-list\">\n<div class=\"rank-math-list-item\"><h3 class=\"rank-math-question\">How much does the pipeline cost to run?<\/h3><div class=\"rank-math-answer\">$0. The OpenRouter model (gpt-oss-120b:free) has no cost. ComfyUI runs on local RTX 3090. WordPress hosting is already paid. The only cost is electricity.<\/div><\/div>\n<div class=\"rank-math-list-item\"><h3 class=\"rank-math-question\">Can this scale to multiple posts per day?<\/h3><div class=\"rank-math-answer\">Yes. Each post takes ~6 minutes end-to-end. The bottleneck is ComfyUI image generation (~1 min per image, 5 images per post). Running 10 posts\/day would take ~1 hour.<\/div><\/div>\n<div class=\"rank-math-list-item\"><h3 class=\"rank-math-question\">Why Rank Math score 85 and not 95?<\/h3><div class=\"rank-math-answer\">95 requires perfect keyword density, readability, and AI detection scores. Current models (gpt-oss-120b) are not large enough to hit 95 reliably. The practical ceiling with free-tier models is 85-91.<\/div><\/div>\n<div class=\"rank-math-list-item\"><h3 class=\"rank-math-question\">Is the content unique?<\/h3><div class=\"rank-math-answer\">Yes. Each article is generated fresh with live SearXNG research context. No spinning or rewriting. The two-part generation produces original content every run.<\/div><\/div>\n<div class=\"rank-math-list-item\"><h3 class=\"rank-math-question\">What is the biggest technical challenge?<\/h3><div class=\"rank-math-answer\">Image pipeline reliability. ComfyUI occasionally fails to generate, and inline image URLs need to be swapped from private ComfyUI IPs to public WordPress URLs after upload. We fixed this by always updating post content after all uploads complete.<\/div><\/div>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Real numbers from building an automated content pipeline that generates 2500+ word SEO articles for free. Cost comparison, architecture diagrams, and actual Rank Math scores.<\/p>\n","protected":false},"author":1,"featured_media":1463,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts\/1462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/comments?post=1462"}],"version-history":[{"count":2,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts\/1462\/revisions"}],"predecessor-version":[{"id":1468,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/posts\/1462\/revisions\/1468"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/media\/1463"}],"wp:attachment":[{"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/media?parent=1462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/categories?post=1462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howtomake.best\/my_website4\/wp-json\/wp\/v2\/tags?post=1462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}