Templates / Automate blog publishing from PostgreSQL to WordPress with OpenAI GPT

Automate blog publishing from PostgreSQL to WordPress with OpenAI GPT

Ready for 3.0

by Avkash Kakdiya ✓ · 332 views · created 2025-10-03 · Content Creation, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (7)

PostgresWordpressOpenAI Chat ModelAI Agent

What it does

How it works This workflow automatically generates and publishes marketing blog posts to WordPress using AI. It begins by checking your PostgreSQL database for unprocessed records, then uses OpenAI to create SEO-friendly, structured blog content. The content is formatted for WordPress, including categories, tags, and meta descriptions, before being published. After publishing, the workflow updates the original database record to track processing status and WordPress post details. Step-by-step - Trigger workflow - Schedule Trigger – Runs the workflow at defined intervals. - Fetch unprocessed record - PostgreSQL Trigger – Retrieves the latest unprocessed record from the database. - Check Record Exists – Confirms the record is valid and ready for processing. - Generate AI blog content - OpenAI Chat Model – Processes the record to generate blog content based on the title. - Blog Post Agent – Structures AI output into JSON with title, content, excerpt, and meta description. - Format and safeguard content - Code Node – Prepares structured data for WordPress, ensuring categories, tags, and error handling. - Publish content and update database - WordPress Publisher – Publishes content to WordPress with proper categories, tags, and meta. - Update Database – Marks the record as processed and stores WordPress post ID, URL, and processing timestamp. Why use this? - Automates end-to-end blog content generation and publishing. - Ensures SEO-friendly and marketing-optimized posts. - Maintains database integrity by tracking published content. - Reduces manual effort and accelerates content workflow. - Integrates PostgreSQL, OpenAI, and WordPress seamlessly for scalable marketing automation.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.