Automate SEO article publishing to WordPress using this powerful n8n workflow. It integrates GPT-4 for content generation, PostgreSQL for intelligent category tracking, and handles media uploads.
Download this n8n workflow template and start using it instantly.
Content marketers looking to scale blog production without manual effort.
SEO specialists needing an automated way to cover long-tail keywords and balance category usage.
Developers seeking advanced n8n templates integrating databases (Postgres) and large language models (OpenAI).
Blog owners requiring scheduled, high-quality content delivery.
This sophisticated automation solves the problem of manual content creation and repetitive category selection for large-scale blogging operations. It uses the power of an n8n workflow scheduled to run periodically. The core intelligence lies in its ability to analyze existing WordPress categories, check usage statistics stored in PostgreSQL, and then select the least-used topic to ensure broad SEO coverage.
Once a topic is chosen, the n8n node sends requests to GPT-4 for generating a highly structured article (complete with WordPress HTML blocks, TOC, and CTA) and even generates a placeholder image. The entire process—from idea generation and database logging to media upload and final publication—is handled seamlessly by this powerful n8n workflow, making it one of the most comprehensive n8n templates available for content automation.
The process begins with the Schedule Trigger n8n trigger, initiating the automation based on a set interval (e.g., hourly).
AI Agent SEO Headings n8n node, powered by GPT-4-mini, generates a highly unique, non-duplicative article title.usedcategories table using an 'upsert' operation. This ensures the category won't be reused immediately in the next cycle, enhancing the SEO strategy.AI Agent SEO writer n8n node, powered by GPT-4, generates the complete article text. This prompt is carefully configured to output content strictly in native WordPress HTML block format, ensuring compatibility and structure (including a Table of Contents).featuredmedia ID.Post to WP HTTP Request n8n node then publishes the new article with a 'publish' status to the WordPress site, completing the n8n workflow execution.To deploy this powerful n8n workflow, follow these steps:
Config n8n node. Change the domain assignment value to your actual WordPress site URL (e.g., https://yourdomain.com).n8nblog) and a user with write privileges. Crucially, create the public.usedcategories table with columns: categoryid (INTEGER PRIMARY KEY), name (TEXT), description (TEXT), title (TEXT), and usedat (TIMESTAMPTZ).YOURPOSTGRESCREDENTIAL linking to your newly configured database.YOUROPENAICREDENTIAL for the GPT-4 nodes.Wordpress account (or similar, matching the connection in the HTTP Request nodes) with API access rights (POST /media, POST /posts).Schedule Trigger n8n trigger for full automation. Schedule Trigger: The starting n8n trigger point. Configured to run at regular intervals (e.g., every few hours) to maintain continuous content flow.
Config (Set): A setup n8n node used to define the base WordPress domain, which is referenced dynamically throughout the n8n workflow's HTTP Requests.
Load Categories (HTTP Request): Fetches categories from the WordPress REST API. Essential for category filtering and selection.
Category Filter (Code): A critical n8n node that defines which category IDs should be ignored by the AI agent (e.g., generic or review categories).
Selecting recent (Postgres): Executes a query to find the lastusedat timestamp for all categories in the database, enabling the intelligent category rotation strategy.
Picks Less Used (Code): This logic n8n node compares the last used time of available categories and selects the one with the oldest timestamp, ensuring content diversity.
AI Agent SEO Headings (Langchain Agent): Uses GPT-4-mini for rapid title generation. The prompt leverages existing recent titles to guarantee the new title is unique and SEO-focused.
AI Agent SEO writer (Langchain Agent): The main content generation n8n node. Uses GPT-4 to generate complex, structured content conforming to specific WordPress block requirements, ensuring the published post is clean and highly formatted.
Updating posts DB (Postgres): An Upsert operation that tracks the new article title and marks the category as 'used now' in the PostgreSQL database.
Media Upload to WP (HTTP Request): Uploads the placeholder image file retrieved by the Download Image n8n node directly to the WordPress media library, generating the featured_media ID needed for publication.
Prepare Post JSON (Code): The final transformation n8n node, consolidating the category ID, featured media ID, GPT-generated content, and new title into the correct structure for the WordPress API.
Post to WP (HTTP Request): The final action n8n node, publishing the complete, SEO-ready article to the configured WordPress site.
Automate 1080p video short creation using Perplexity, Google Gemini, and FFmpeg. This sophisticated n8n workflow handles content generation, video editing, and direct publishing to YouTube.

Automate social media content creation using this n8n workflow. Generate optimized captions for Instagram, X, and Threads with GPT-4o, store drafts in Notion, and auto-publish to Instagram.

Use this powerful n8n workflow to automatically generate professional LinkedIn carousel posts using Google Gemini AI and Post Nitro, triggering daily or via manual form submission.

Use this powerful n8n workflow to automate the entire SEO content lifecycle: AI metadata generation, article composition via OpenRouter/LLM, image creation, and instant publishing to WordPress.

Automate content creation for social media. This n8n workflow uses a scheduled n8n trigger to fetch news topics, scrape articles via Dumpling AI, and generate high-quality, LinkedIn-ready commentary using GPT-4o.


Automation consultant helping growth teams, agencies, and founders scale with AI + no-code. I specialize in building GPT-powered content systems, lead gen automations, and PostgreSQL-enhanced flows. 📬 Book custom n8n work or DM for collabs.







































