AI Content Generation and WordPress Publisher - n8n Workflow

An advanced n8n workflow leveraging Perplexity research and OpenAI to automatically generate SEO-optimized HTML blog posts and publish them as drafts to WordPress, dramatically accelerating content production.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Marketing teams requiring high-volume, fact-based content generation.

  • SEO professionals seeking to rapidly test content ideas and keyword targeting.

  • Automation specialists building complex AI content factory n8n templates.

  • Content managers who need perfectly structured, HTML-ready WordPress drafts.

Overview

This n8n workflow represents a powerful, end-to-end AI Content Factory. It solves the costly and time-consuming process of manual research and content structuring by integrating premium AI tools like Perplexity for detailed, sourced research and OpenAI (via the Langchain n8n node) for high-quality, long-form content generation. The n8n workflow is meticulously designed to ensure the output is compliant with strict SEO standards, generating unique slugs, titles, and meta descriptions. Crucially, it formats the final content into perfectly structured WordPress HTML, complete with an index and custom styling, ready for immediate review and publication as a draft. Implementing this specialized n8n template dramatically accelerates content production cycles.

How it Works

The entire process is orchestrated by a sophisticated n8n workflow, ensuring accurate data handling from research to final publication.


  1. Initiation (n8n Trigger): The process begins with an 'On Form Submission' n8n trigger, where a user inputs the core Research Query specifying the blog topic.

  2. Sourced Research: The 'Perplexity Research' n8n node uses an HTTP Request to leverage the sonar-pro model to execute the query, collecting detailed, fact-based information and citations.

  3. Data Preparation: The 'Cleanup Links' n8n node processes the Perplexity output, replacing numbered citations (e.g., [1]) with the actual source URLs, preparing the data for the AI copywriter.

  4. Long-Form Copywriting: The 'Copywriter AI Agent' n8n node, using a sophisticated Langchain prompt and a gpt-4o-mini language model, generates a comprehensive (1500-2000 word) blog post draft based entirely on the researched facts.

  5. Parallel SEO Generation: Simultaneously, the 'Create Title, Slug, Meta' n8n node analyzes the draft content and generates optimized SEO elements (title, slug, meta description) according to strict formatting and keyword guidelines. A Structured Output Parser ensures the data is clean JSON.

  6. HTML Structuring: The 'Create HTML' n8n node takes the raw draft and converts it into fully styled, WordPress-compatible HTML. This includes an estimated reading time, key takeaways, a hyperlinked Table of Contents (TOC), and necessary CSS overrides for links and headings.

  7. Publishing & Imaging: After cleaning the raw HTML tags ('Cleanup HTML' n8n node), the data is aggregated. The WordPress n8n node publishes the post as a draft, dynamically injecting the generated title, slug, and cleaned HTML content. Separately, the n8n workflow downloads a featured image, uploads it to the WordPress media library, and then uses a final HTTP Request n8n node to assign that image to the newly created post.

  8. Notification: A final step uses the Telegram n8n node to send a success confirmation message, completing the n8n workflow execution.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON code and paste it into your n8n instance to import the n8n workflow.

  2. Credentials Setup:

OpenAI: Set up an 'OpenAi account' credential for the Langchain/OpenAI n8n nodes.
Perplexity: Configure an HTTP Header Auth credential named 'Perplexity' containing your API key for the 'Perplexity Research' n8n node.
WordPress: Configure a WordPress API credential for the 'Wordpress' n8n node and the associated HTTP Request n8n nodes for image handling.
Telegram: Set up a 'Telegram account' credential and provide the TELEGRAMCHATID environment variable or parameter for the success notification n8n node.

  1. Configuration: Update the hardcoded image URL in the 'Set Image URL' n8n node if you do not want to use the placeholder image.

  2. Activation: Activate the n8n workflow to make the 'On form submission' n8n trigger URL live. You can access the form directly via the webhook URL.

Node Details


  • On form submission (n8n trigger): The entry point of the n8n workflow. It collects the essential Research Query from the user.

  • Perplexity Research (HTTP Request n8n node): Calls the Perplexity API using the sonar-pro model to gather detailed research findings based on the input query.

  • Cleanup Links (Set n8n node): Cleans and standardizes the research data by mapping AI citations to their corresponding source URLs found in the API response.

  • Copywriter AI Agent (Langchain n8n node): The core long-form content creator. It uses a structured system prompt and an OpenAI language model to generate a 1500-2000 word SEO-focused blog post draft.

  • Create Title, Slug, Meta (Langchain n8n node): Runs in parallel to the copywriter. It uses strict guidelines and a Structured Output Parser n8n node to generate a perfect SEO title, URL slug, and meta description.

  • Create HTML (OpenAI n8n node): The key formatting n8n node. It converts the raw blog post draft into structured, style-compliant HTML, adding elements like a hyperlinked TOC, custom CSS, and required WordPress classes.

  • Wordpress (n8n node): Publishes the final content to the specified WordPress site. It dynamically pulls the title, slug, and cleaned HTML content from previous n8n node steps.

  • Upload Image to Wordpress (HTTP Request n8n node): Handles the binary upload of the featured image to the WordPress media library.

  • Set Image on Wordpress Post (HTTP Request n8n node): Updates the newly created WordPress post ID with the featured image ID, completing the publishing step.

Related n8n Workflows

Free

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by
Joseph LePage
Joseph LePage

As an AI Automation consultant based in Canada, I partner with forward-thinking organizations to implement AI solutions that streamline operations and drive growth.

Featured*