Automated SEO Blog Content Factory for WordPress & GitHub - n8n Workflow

Use this advanced n8n workflow to fully automate your SEO content pipeline, from keyword scoring in Postgres to drafting articles using OpenAI and Perplexity, and publishing directly to WordPress. Explore powerful n8n templates for AI content.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

SEO Agencies and Consultants needing scalable content production.
Technical Marketers looking for advanced AI-driven n8n workflow solutions.
Developers wanting to leverage the n8n node ecosystem for automated GitHub and WordPress management.
Anyone seeking efficient, autonomous content generation processes using n8n templates.

Overview

Managing a high-volume content strategy requires significant time investment in research, drafting, optimization, and publishing. This expert-level n8n workflow transforms that manual effort into a scalable, scheduled automation. It integrates research (Perplexity), advanced drafting (OpenAI and OpenRouter), keyword tracking (Postgres), media handling (HTTP Request), version control (GitHub), and final publication (WordPress).

This robust n8n workflow starts by analyzing and scoring potential keywords stored in a Postgres database. It then uses powerful AI language models to generate a highly structured, SEO-optimized article (complete with introduction, development sections, conclusion, and FAQ). Finally, it handles all the technical publishing details, including updating the GitHub repository (for static sites or tracking) and submitting the sitemap for immediate indexation. This automation leverages specialized n8n node configurations for maximum reliability and quality control.

How it Works

This complex automation starts with a scheduled n8n trigger, initiating two main parallel tracks: keyword scoring and article drafting.


  1. Keyword Selection and Scoring: A Schedule Trigger initiates the process, fetching keywords from Postgres. Keywords are routed through a scoring section, where a Code n8n node calculates keyword quality and relevance. The best keywords are selected by an AI Agent, which uses a Structured Output Parser to ensure the output fits the necessary database schema, logging the selection to Postgres.

  2. Research and Planning: The workflow selects a topic and uses the Preliminary Plan n8n node (powered by OpenAI) and the Perplexity Message a model n8n node for comprehensive, up-to-date research on the topic.

  3. Outline and Drafting: An OpenAI Chat Model generates a detailed content plan (outline), which is then segmented. Multiple AI chains (header post, Intro, dev 1, dev 2, conclusion, FAQ section) run in parallel, using various AI services (OpenAI, OpenRouter) to generate high-quality text sections.

  4. Media and Assembly: An HTTP Request n8n node fetches related images (Image Covers2). Custom Code n8n node logic selects and filters the best images. All generated content sections are then merged and aggregated.

  5. Publishing & Updates: The final article is saved to the GitHub repository via the Create blog GitHub n8n node. It is then published to WordPress using the Create a post1 n8n node.

  6. SEO Finalization & Notification: The workflow updates the necessary GitHub files (articles.json, sitemap.xml). A wait approval Slack n8n node sends a notification. Finally, the sitemap is submitted, and the new blog post URL is logged in Postgres for future internal linking optimization, completing the full n8n workflow.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and import it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Credentials Setup: This workflow requires several credentials. Set up connections for the following services:

Postgres: Required for keyword, status, and internal link tracking.
OpenAI/OpenRouter/Perplexity: Required for all large language model (LLM) operations and content generation.
GitHub: Required for committing the generated markdown/HTML file and updating sitemaps/article lists.
WordPress: Required for publishing the final article.
* Slack: Required for sending approval notifications or updates.

  1. Node Configuration: Review the Code n8n node steps and the various Set n8n node configurations to ensure dynamic data references (e.g., database table names, file paths for GitHub) match your specific project structure.

  2. Activation: Once all credentials are set, activate the Schedule Trigger n8n trigger to begin the automated content pipeline.

Node Details

This n8n workflow uses a wide array of specialized nodes:

Schedule Trigger: The primary n8n trigger, used to initiate the content generation process at predetermined intervals.
Postgres Nodes: Used extensively (Fetch Keywords1, Select rows from a table, Insert rows in a table, etc.) to manage keyword databases, track article status, and log final URLs for internal linking.
LangChain AI Nodes (Agent, LLM Chain): Forms the core intelligence. The Choose keywords, Intent, etc agent utilizes a PostgreSQL tool and OpenAI Chat Model to make smart decisions on keyword priority.
Perplexity Node (Message a model): Used early in the process for up-to-date informational retrieval, enriching the data passed to the drafting LLMs.
OpenAI/OpenRouter Chat Models: Provide the underlying text generation capabilities for the various LLM Chain nodes (header post, Intro, etc.). The parallelization across multiple LLM chains ensures structured, high-quality output.
Code Node: Several Code n8n node instances are used for custom data manipulation, such as scoring keywords (Score Keywords), cleaning up image data, and preparing files for GitHub commits.
GitHub Nodes (Create blog, get sitemap1, Edit a file): Manages the file infrastructure, saving the generated blog posts and updating crucial SEO files like the sitemap and internal article manifest.
WordPress Node (Create a post1): The final publishing n8n node, pushing the complete HTML content to the live blog.
Slack Node (wait approval): Used to send a notification to a specific channel, providing a human checkpoint or simply confirming the article was successfully published.
HTTP Request Node (submit sitemap): Sends a GET request to search engine services to prompt re-indexing after the sitemap is updated.

Related n8n Workflows

Paid

Nodes: 25 Nodes
Updated: December 26 2025
View all
Created by

Automation expert & n8n power user. I build advanced workflows combining AI, outbound, and business logic. Grab my templates or reach out for custom builds.

Featured*