Back to Integrations
integrationPostgres node
integrationWordpress node

Postgres and Wordpress integration

Save yourself the work of writing custom integrations for Postgres and Wordpress and use n8n instead. Build adaptable and scalable Development, Data & Storage, and Marketing workflows that work with your technology stack. All within a building experience you will love.

How to connect Postgres and Wordpress

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

Postgres and Wordpress integration: Create a new workflow and add the first step

Step 2: Add and configure Postgres and Wordpress nodes

You can find Postgres and Wordpress in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure Postgres and Wordpress nodes one by one: input data on the left, parameters in the middle, and output data on the right.

Postgres and Wordpress integration: Add and configure Postgres and Wordpress nodes

Step 3: Connect Postgres and Wordpress

A connection establishes a link between Postgres and Wordpress (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

Postgres and Wordpress integration: Connect Postgres and Wordpress

Step 4: Customize and extend your Postgres and Wordpress integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect Postgres and Wordpress with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

Postgres and Wordpress integration: Customize and extend your Postgres and Wordpress integration

Step 5: Test and activate your Postgres and Wordpress workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Postgres to Wordpress or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

Postgres and Wordpress integration: Test and activate your Postgres and Wordpress workflow

WordPress - AI chatbot to enhance user experience - with Supabase and OpenAI

This is the first version of a template for a RAG/GenAI App using WordPress content.

As creating, sharing, and improving templates brings me joy 😄, feel free to reach out on LinkedIn if you have any ideas to enhance this template!

How It Works

This template includes three workflows:

Workflow 1**: Generate embeddings for your WordPress posts and pages, then store them in the Supabase vector store.
Workflow 2**: Handle upserts for WordPress content when edits are made.
Workflow 3**: Enable chat functionality by performing Retrieval-Augmented Generation (RAG) on the embedded documents.

Why use this template?

This template can be applied to various use cases:

Build a GenAI application that requires embedded documents from your website's content.
Embed or create a chatbot page on your website to enhance user experience as visitors search for information.
Gain insights into the types of questions visitors are asking on your website.
Simplify content management by asking the AI for related content ideas or checking if similar content already exists. Useful for internal linking.

Prerequisites
Access to Supabase for storing embeddings.
Basic knowledge of Postgres and pgvector.
A WordPress website with content to be embedded.
An OpenAI API key
Ensure that your n8n workflow, Supabase instance, and WordPress website are set to the same timezone (or use GMT) for consistency.

Workflow 1 : Initial Embedding

This workflow retrieves your WordPress pages and posts, generates embeddings from the content, and stores them in Supabase using pgvector.

Step 0 : Create Supabase tables

Nodes :
Postgres - Create Documents Table: This table is structured to support OpenAI embedding models with 1536 dimensions
Postgres - Create Workflow Execution History Table

These two nodes create tables in Supabase:

The documents table, which stores embeddings of your website content.
The n8n_website_embedding_histories table, which logs workflow executions for efficient management of upserts. This table tracks the workflow execution ID and execution timestamp.

Step 1 : Retrieve and Merge WordPress Pages and Posts

Nodes :
WordPress - Get All Posts
WordPress - Get All Pages
Merge WordPress Posts and Pages

These three nodes retrieve all content and metadata from your posts and pages and merge them.
Important: ** **Apply filters to avoid generating embeddings for all site content.

Step 2 : Set Fields, Apply Filter, and Transform HTML to Markdown

Nodes :
Set Fields
Filter - Only Published & Unprotected Content
HTML to Markdown

These three nodes prepare the content for embedding by:

Setting up the necessary fields for content embeddings and document metadata.
Filtering to include only published and unprotected content (protected=false), ensuring private or unpublished content is excluded from your GenAI application.
Converting HTML to Markdown, which enhances performance and relevance in Retrieval-Augmented Generation (RAG) by optimizing document embeddings.

Step 3: Generate Embeddings, Store Documents in Supabase, and Log Workflow Execution

Nodes:
Supabase Vector Store
Sub-nodes:
Embeddings OpenAI
Default Data Loader
Token Splitter
Aggregate
Supabase - Store Workflow Execution

This step involves generating embeddings for the content and storing it in Supabase, followed by logging the workflow execution details.

Generate Embeddings: The Embeddings OpenAI node generates vector embeddings for the content.
Load Data: The Default Data Loader prepares the content for embedding storage. The metadata stored includes the content title, publication date, modification date, URL, and ID, which is essential for managing upserts.

⚠️ Important Note : Be cautious not to store any sensitive information in metadata fields, as this information will be accessible to the AI and may appear in user-facing answers.

Token Management: The Token Splitter ensures that content is segmented into manageable sizes to comply with token limits.
Aggregate: Ensure the last node is run only for 1 item.
Store Execution Details: The Supabase - Store Workflow Execution node saves the workflow execution ID and timestamp, enabling tracking of when each content update was processed.

This setup ensures that content embeddings are stored in Supabase for use in downstream applications, while workflow execution details are logged for consistency and version tracking.

This workflow should be executed only once for the initial embedding.
Workflow 2, described below, will handle all future upserts, ensuring that new or updated content is embedded as needed.

Workflow 2: Handle document upserts

Content on a website follows a lifecycle—it may be updated, new content might be added, or, at times, content may be deleted.

In this first version of the template, the upsert workflow manages:
Newly added content**
Updated content**

Step 1: Retrieve WordPress Content with Regular CRON

Nodes:
CRON - Every 30 Seconds
Postgres - Get Last Workflow Execution
WordPress - Get Posts Modified After Last Workflow Execution
WordPress - Get Pages Modified After Last Workflow Execution
Merge Retrieved WordPress Posts and Pages

A CRON job (set to run every 30 seconds in this template, but you can adjust it as needed) initiates the workflow. A Postgres SQL query on the n8n_website_embedding_histories table retrieves the timestamp of the latest workflow execution.

Next, the HTTP nodes use the WordPress API (update the example URL in the template with your own website’s URL and add your WordPress credentials) to request all posts and pages modified after the last workflow execution date. This process captures both newly added and recently updated content. The retrieved content is then merged for further processing.

Step 2 : Set fields, use filter

Nodes :
Set fields2
Filter - Only published and unprotected content

The same that Step 2 in Workflow 1, except that HTML To Makrdown is used in further Step.

Step 3: Loop Over Items to Identify and Route Updated vs. Newly Added Content

Here, I initially aimed to use 'update documents' instead of the delete + insert approach, but encountered challenges, especially with updating both content and metadata columns together. Any help or suggestions are welcome! :)

Nodes:
Loop Over Items
Postgres - Filter on Existing Documents
Switch

Route existing_documents (if documents with matching IDs are found in metadata):
Supabase - Delete Row if Document Exists: Removes any existing entry for the document, preparing for an update.
Aggregate2: Used to aggregate documents on Supabase with ID to ensure that Set Fields3 is executed only once for each WordPress content to avoid duplicate execution.
Set Fields3: Sets fields required for embedding updates.

Route new_documents (if no matching documents are found with IDs in metadata):
Set Fields4: Configures fields for embedding newly added content.

In this step, a loop processes each item, directing it based on whether the document already exists. The Aggregate2 node acts as a control to ensure Set Fields3 runs only once per WordPress content, effectively avoiding duplicate execution and optimizing the update process.

Step 4 : HTML to Markdown, Supabase Vector Store, Update Workflow Execution Table

The HTML to Markdown node mirrors Workflow 1 - Step 2. Refer to that section for a detailed explanation on how HTML content is converted to Markdown for improved embedding performance and relevance.

Following this, the content is stored in the Supabase vector store to manage embeddings efficiently. Lastly, the workflow execution table is updated. These nodes mirros the **Workflow 1 - Step 3 nodes.

Workflow 3 : An example of GenAI App with Wordpress Content : Chatbot to be embed on your website

Step 1: Retrieve Supabase Documents, Aggregate, and Set Fields After a Chat Input

Nodes:
When Chat Message Received
Supabase - Retrieve Documents from Chat Input
Embeddings OpenAI1
Aggregate Documents
Set Fields

When a user sends a message to the chat, the prompt (user question) is sent to the Supabase vector store retriever. The RPC function match_documents (created in Workflow 1 - Step 0) retrieves documents relevant to the user’s question, enabling a more accurate and relevant response.

In this step:
The Supabase vector store retriever fetches documents that match the user’s question, including metadata.
The Aggregate Documents node consolidates the retrieved data.
Finally, Set Fields organizes the data to create a more readable input for the AI agent.

Directly using the AI agent without these nodes would prevent metadata from being sent to the language model (LLM), but metadata is essential for enhancing the context and accuracy of the AI’s response. By including metadata, the AI’s answers can reference relevant document details, making the interaction more informative.

Step 2: Call AI Agent, Respond to User, and Store Chat Conversation History

Nodes:
AI Agent**
Sub-nodes:
OpenAI Chat Model
Postgres Chat Memories
Respond to Webhook**

This step involves calling the AI agent to generate an answer, responding to the user, and storing the conversation history. The model used is gpt4-o-mini, chosen for its cost-efficiency.

Nodes used in this workflow

Popular Postgres and Wordpress workflows

+18

💅 AI Agents Generate Content & Automate Posting for Beauty Salon Social Media 📲

💅 AI Agents Generate Content & Automate Posting for Beauty Salon Social Media 📲 Who Is This For? This workflow is for beauty salons who want consistent, high‑quality social media content without writing every post manually. It also suits agencies and automation builders who manage multiple beauty brands and want a reusable, AI‑driven posting system they can adapt per client. What Problem Is This Workflow Solving? Many beauty businesses struggle to post regularly because research, copywriting, and design all take time and marketing skills. This workflow automates research, writing, image creation, and posting, so your channels stay active and relevant while you focus on clients and services. What This Workflow Does Generates short, engaging posts tailored to a beauty‑salon audience (hair, nails, skincare, make‑up, self‑care) using an AI agent. Uses Tavily Internet Search to pull up‑to‑date information and trends based on a reference link or topic. Turns each post into a detailed, photorealistic image prompt and creates a matching visual with an AI image model (for example, gpt‑image‑1 or other connected providers). Automatically sends the final text and image to Telegram, and can be extended to other social platforms from the Split Out node. How It Works Trigger the workflow Scheduled automatic generation:** Run the parent workflow on a schedule (for example, once per day at 9 AM) to publish new content regularly. Google Sheets trigger:** Generate content when a new row with a reference link or topic is added to your sheet. Use it when you manage ideas or briefs in Google Sheets and want the workflow to react as soon as a new idea appears. RSS Feed trigger:** Start the workflow when new items appear in a selected RSS feed. Ideal for turning fresh blog posts, news, or industry updates into social media content or automated summaries. Meta (Facebook/Instagram) webhook:** Use the Meta Reference trigger to fire the workflow on incoming webhooks from Meta (for example, new comments, messages, or events). Helpful when you want to auto‑respond, log activity, or generate follow‑up content from Meta activity. Airtable trigger:** Start the workflow when records in a selected Airtable base/table change (for example, a new idea, brief, or status update), so your posts react instantly to updates in your Airtable content board. Postgres trigger:** Fire the workflow when new rows are inserted or existing rows are updated in a connected PostgreSQL table, letting you drive content generation from events in your app database or Supabase‑style back end. Manual start:* Hit Execute workflow* whenever you want to spin up a batch of posts on demand, test new prompt settings, or debug the flow step by step. Research and generate copy The GENERATE TEXT agent calls Tavily to gather fresh information on the topic. It writes a post under 1024 characters with a hook, practical tips, relevant hashtags, and a closing line with your salon address and contact. Create the visual The GENERATE PROMPT agent converts the post into a single, clear description of the scene (client, service, salon interior, lighting, mood) with a strict “no text on image” rule. An image model such as gpt‑image‑1 or one of the HTTP image APIs renders a matching beauty visual. Distribute the content The Split Out node fans out the result so Telegram receives a photo post with the generated caption. Additional social or content nodes (for example Facebook, LinkedIn, X, template tools) can be wired after this step for multi‑channel posting. How to Customize This Workflow to Your Needs Brand voice** Edit the system message in the GENERATE TEXT node to adjust tone (luxury, friendly, clinical, playful), language, services, and city. Update the final address and phone line to match your salon details. Topics and triggers** Point the Google Sheets Trigger to your own document ID, sheet, and columns for ideas, links, or campaign themes. Use the Schedule Trigger for fully automatic posting or rely on the Manual Trigger for controlled, batch generation sessions. Models and providers** Swap GPT‑5 llm and the default image model for alternatives such as Mistral, Gemini, Anthropic, DeepSeek, or custom HTTP image APIs by enabling the corresponding nodes and adding credentials. Channels and outputs** Connect or remove social nodes after Split Out depending on which platforms you actively use. Add extra processing steps (for example resizing images or adding UTM parameters) before each channel if needed. Visual style** Tweak the GENERATE PROMPT instructions to control composition (close‑up vs. full‑body), color palette, lighting, and overall salon aesthetic, while keeping the constraint of no text or logos in the image.
+19

💾 Generate Blog Posts on Autopilot with GPT‑5, Tavily and WordPress

Who Is This For? This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents. ​ Whether you run a blog, SaaS, personal brand, newsletter, or client accounts, this tool helps you keep a consistent content pipeline without manually writing every article, creating images, and posting to each platform one by one. ​ ​ 💪🏼 While the template is wired around classic blog + social media distribution, the underlying logic is universal. You can easily adapt it to any niche by editing prompts, swapping models, and re‑wiring nodes. You can plug in any LLM you like, from ChatGPT to Claude, Gemini, Mistral, DeepSeek, OpenRouter, or even local models through Ollama. ​ What Problem Is This Workflow Solving? 🤯 Most teams waste hours on the same repetitive loop: research a topic, gather links, write a blog post, craft social captions, generate visuals, upload everything to multiple platforms, and archive assets. ​ ​ 💎 This workflow solves that by automating the full content chain—from research and blog‑post generation to image creation, publishing across channels, and logging everything in your content database—so your feeds stay active while you focus on strategy, not busywork. ​ What This Workflow Does ✨ Generates in‑depth blog posts tailored to your topic and target audience, enriched with fresh references from the web via Tavily/SerpAPI search tools. ​ ✨ Creates an image prompt and title from the article, generates the visual with OpenAI Images (gpt-image-1), and converts it into a ready‑to‑use image file. ​ ✨ Automatically publishes content to your connected platforms (WordPress for blog posts, Telegram, X/Twitter, Facebook, LinkedIn) while saving images to Google Drive and logging each publication in Google Sheets for tracking. ​ How It Works? Surprisingly simple ☺️ The workflow is triggered by another n8n workflow or by one of several triggers (Facebook, RSS, Google Sheets, Airtable, Postgres) that pass in the blogTopic, targetAudience, and Telegram chatID. ​ ​ The Blog Post Agent (LLM with access to Tavily/SerpAPI) researches the topic, writes a structured article for the specified audience, and sends its output to the Image Prompt Agent, which turns the content into a visual prompt and title. ​ 🎯 The end result: you provide a topic, run the workflow, and receive a complete blog post, matching image, and ready‑made social posts shipped directly to your channels and archives—no manual copy‑paste. ​ How to Customize This Workflow to Your Needs 🎨 Switch AI models and fine‑tune prompts so the agent can handle your exact formats: tutorials, case studies, listicles, product updates, thought‑leadership pieces, or campaign landing posts. 🔍 Refine research sources inside Tavily/SerpAPI to prioritize the domains, blogs, and docs your audience trusts, keeping posts accurate and up to date. ⏰ Adjust posting cadence and schedules to align with peak engagement for your audience, mixing automated slots with manual “launch” runs for special announcements. 📱 Expand or trim channels as needed: keep just WordPress + LinkedIn, add Telegram as a content feed, or plug the workflow into additional automations like email campaigns or RSS feeds. 📊 Use Google Sheets as your content hub to store ideas, angles, CTAs, references, and performance notes so you can double‑down on topics and formats that perform best. 🎬 Swap images for video by replacing the image generation node with video tools (for example, Runway‑style APIs) if your strategy is video‑first while keeping the same prompt pipeline. 💾 Build a reusable prompt library in Sheets, Notion, or Airtable so you can rotate proven prompt patterns each month and keep quality high without reinventing the wheel. 🤖 The system will continuously generate blog posts, visuals, and social updates and publish them across your selected platforms while archiving everything in Drive and Sheets—keeping your brand visible, consistent, and professional with minimal ongoing effort.
+6

WordPress - AI Chatbot to enhance user experience - with Supabase and OpenAI

This is the first version of a template for a RAG/GenAI App using WordPress content. As creating, sharing, and improving templates brings me joy 😄, feel free to reach out on LinkedIn if you have any ideas to enhance this template! How It Works This template includes three workflows: Workflow 1**: Generate embeddings for your WordPress posts and pages, then store them in the Supabase vector store. Workflow 2**: Handle upserts for WordPress content when edits are made. Workflow 3**: Enable chat functionality by performing Retrieval-Augmented Generation (RAG) on the embedded documents. Why use this template? This template can be applied to various use cases: Build a GenAI application that requires embedded documents from your website's content. Embed or create a chatbot page on your website to enhance user experience as visitors search for information. Gain insights into the types of questions visitors are asking on your website. Simplify content management by asking the AI for related content ideas or checking if similar content already exists. Useful for internal linking. Prerequisites Access to Supabase for storing embeddings. Basic knowledge of Postgres and pgvector. A WordPress website with content to be embedded. An OpenAI API key Ensure that your n8n workflow, Supabase instance, and WordPress website are set to the same timezone (or use GMT) for consistency. Workflow 1 : Initial Embedding This workflow retrieves your WordPress pages and posts, generates embeddings from the content, and stores them in Supabase using pgvector. Step 0 : Create Supabase tables Nodes : Postgres - Create Documents Table: This table is structured to support OpenAI embedding models with 1536 dimensions Postgres - Create Workflow Execution History Table These two nodes create tables in Supabase: The documents table, which stores embeddings of your website content. The n8n_website_embedding_histories table, which logs workflow executions for efficient management of upserts. This table tracks the workflow execution ID and execution timestamp. Step 1 : Retrieve and Merge WordPress Pages and Posts Nodes : WordPress - Get All Posts WordPress - Get All Pages Merge WordPress Posts and Pages These three nodes retrieve all content and metadata from your posts and pages and merge them. Important: * *Apply filters to avoid generating embeddings for all site content. Step 2 : Set Fields, Apply Filter, and Transform HTML to Markdown Nodes : Set Fields Filter - Only Published & Unprotected Content HTML to Markdown These three nodes prepare the content for embedding by: Setting up the necessary fields for content embeddings and document metadata. Filtering to include only published and unprotected content (protected=false), ensuring private or unpublished content is excluded from your GenAI application. Converting HTML to Markdown, which enhances performance and relevance in Retrieval-Augmented Generation (RAG) by optimizing document embeddings. Step 3: Generate Embeddings, Store Documents in Supabase, and Log Workflow Execution Nodes: Supabase Vector Store Sub-nodes: Embeddings OpenAI Default Data Loader Token Splitter Aggregate Supabase - Store Workflow Execution This step involves generating embeddings for the content and storing it in Supabase, followed by logging the workflow execution details. Generate Embeddings: The Embeddings OpenAI node generates vector embeddings for the content. Load Data: The Default Data Loader prepares the content for embedding storage. The metadata stored includes the content title, publication date, modification date, URL, and ID, which is essential for managing upserts. ⚠️ Important Note : Be cautious not to store any sensitive information in metadata fields, as this information will be accessible to the AI and may appear in user-facing answers. Token Management: The Token Splitter ensures that content is segmented into manageable sizes to comply with token limits. Aggregate: Ensure the last node is run only for 1 item. Store Execution Details: The Supabase - Store Workflow Execution node saves the workflow execution ID and timestamp, enabling tracking of when each content update was processed. This setup ensures that content embeddings are stored in Supabase for use in downstream applications, while workflow execution details are logged for consistency and version tracking. This workflow should be executed only once for the initial embedding. Workflow 2, described below, will handle all future upserts, ensuring that new or updated content is embedded as needed. Workflow 2: Handle document upserts Content on a website follows a lifecycle—it may be updated, new content might be added, or, at times, content may be deleted. In this first version of the template, the upsert workflow manages: Newly added content** Updated content** Step 1: Retrieve WordPress Content with Regular CRON Nodes: CRON - Every 30 Seconds Postgres - Get Last Workflow Execution WordPress - Get Posts Modified After Last Workflow Execution WordPress - Get Pages Modified After Last Workflow Execution Merge Retrieved WordPress Posts and Pages A CRON job (set to run every 30 seconds in this template, but you can adjust it as needed) initiates the workflow. A Postgres SQL query on the n8n_website_embedding_histories table retrieves the timestamp of the latest workflow execution. Next, the HTTP nodes use the WordPress API (update the example URL in the template with your own website’s URL and add your WordPress credentials) to request all posts and pages modified after the last workflow execution date. This process captures both newly added and recently updated content. The retrieved content is then merged for further processing. Step 2 : Set fields, use filter Nodes : Set fields2 Filter - Only published and unprotected content The same that Step 2 in Workflow 1, except that HTML To Makrdown is used in further Step. Step 3: Loop Over Items to Identify and Route Updated vs. Newly Added Content Here, I initially aimed to use 'update documents' instead of the delete + insert approach, but encountered challenges, especially with updating both content and metadata columns together. Any help or suggestions are welcome! :) Nodes: Loop Over Items Postgres - Filter on Existing Documents Switch Route existing_documents (if documents with matching IDs are found in metadata): Supabase - Delete Row if Document Exists: Removes any existing entry for the document, preparing for an update. Aggregate2: Used to aggregate documents on Supabase with ID to ensure that Set Fields3 is executed only once for each WordPress content to avoid duplicate execution. Set Fields3: Sets fields required for embedding updates. Route new_documents (if no matching documents are found with IDs in metadata): Set Fields4: Configures fields for embedding newly added content. In this step, a loop processes each item, directing it based on whether the document already exists. The Aggregate2 node acts as a control to ensure Set Fields3 runs only once per WordPress content, effectively avoiding duplicate execution and optimizing the update process. Step 4 : HTML to Markdown, Supabase Vector Store, Update Workflow Execution Table The HTML to Markdown node mirrors Workflow 1 - Step 2. Refer to that section for a detailed explanation on how HTML content is converted to Markdown for improved embedding performance and relevance. Following this, the content is stored in the Supabase vector store to manage embeddings efficiently. Lastly, the workflow execution table is updated. These nodes mirros the **Workflow 1 - Step 3 nodes. Workflow 3 : An example of GenAI App with Wordpress Content : Chatbot to be embed on your website Step 1: Retrieve Supabase Documents, Aggregate, and Set Fields After a Chat Input Nodes: When Chat Message Received Supabase - Retrieve Documents from Chat Input Embeddings OpenAI1 Aggregate Documents Set Fields When a user sends a message to the chat, the prompt (user question) is sent to the Supabase vector store retriever. The RPC function match_documents (created in Workflow 1 - Step 0) retrieves documents relevant to the user’s question, enabling a more accurate and relevant response. In this step: The Supabase vector store retriever fetches documents that match the user’s question, including metadata. The Aggregate Documents node consolidates the retrieved data. Finally, Set Fields organizes the data to create a more readable input for the AI agent. Directly using the AI agent without these nodes would prevent metadata from being sent to the language model (LLM), but metadata is essential for enhancing the context and accuracy of the AI’s response. By including metadata, the AI’s answers can reference relevant document details, making the interaction more informative. Step 2: Call AI Agent, Respond to User, and Store Chat Conversation History Nodes: AI Agent** Sub-nodes: OpenAI Chat Model Postgres Chat Memories Respond to Webhook** This step involves calling the AI agent to generate an answer, responding to the user, and storing the conversation history. The model used is gpt4-o-mini, chosen for its cost-efficiency.

Automate Blog Publishing from PostgreSQL to WordPress with OpenAI GPT

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.
+6

Automate SEO Blog Pipeline from Keywords to WordPress with GPT-5 & fal.ai Images

✍️ AI-Powered SEO Blog Automation Workflow Complete PostgreSQL-backed system: Keyword scoring → AI research → Multi-part content generation → fal.ai Nano Banana image generation → WordPress publishing Real Example: AI Applications in Real Estate Playbook — fully generated, optimized, and published with this automation. 🚀 What You Get Full n8n Workflow Package Pre-configured automation** with 80+ connected nodes PostgreSQL schema** for keyword tracking & blog management 3-phase system**: Scoring → Planning → Generation Setup documentation** with customization guide Each Blog Post Includes 2,100+ words across 6 sections (Intro, Dev 1, Dev 2, Conclusion, FAQ, Header) 2 AI-generated images via fal.ai Nano Banana (16:9 format) Internal links to your existing content External citations to authoritative sources Complete SEO metadata (title, slug, description, tags) WordPress-ready draft ⚡ Core Features Keyword Intelligence Multi-factor scoring algorithm (volume, competition, CPC, relevance) Usage tracking prevents cannibalization AI agent selects optimal clusters avoiding impossible competition AI Content Pipeline Perplexity Sonar Pro deep research GPT-5 parallel section generation Grade 13-15 reading level Natural keyword distribution (no over-optimization) Image Generation fal.ai Nano Banana model** for contextual visuals Featured image (16:9) from research summary Body image (16:9) embedded in content Automatic alt text generation 10s wait + 5s retry logic Automation Infrastructure Queries existing posts to prevent duplicates Scheduled execution (every 2-3 days) Error handling with retry logic Non-blocking image generation 🔗 Required Services OpenAI (GPT-5, GPT-4o) OpenRouter (GPT-5 Mini) Perplexity AI (Sonar Pro) fal.ai (Nano Banana model)** WordPress REST API PostgreSQL database n8n instance 📊 Database Schema Keywords Table - Tracks scoring, usage, and Google Ads metrics Cluster Blog Table - Manages topic pipeline and published URLs Full SQL schema included in setup documentation. 🎯 Production Ready 10-15 posts/week** on autopilot 60% faster** than sequential generation (parallel processing) Usage tracking** prevents keyword reuse Customizable** scoring weights and relevance terms for any niche 🛠️ Setup Process Import n8n JSON workflow Create PostgreSQL tables (schema provided) Add API credentials Import keywords from Google Ads Planner Customize relevance terms for your industry Configure schedules and domain URL Test manually → Enable automation 💡 Perfect For Content marketers scaling to 10+ posts/week SEO agencies managing multiple sites Niche site builders needing consistent output WordPress users wanting hands-off publishing Low-authority sites targeting winnable keywords 🔧 Key Customization Points Scoring algorithm weights (volume/competition/CPC/relevance) Relevance terms for your industry (default: AI/automation) Publishing schedule (daily/3x week/weekly) Content length per section Image aspect ratio and format Website domain URL Stop writing blogs manually. This workflow handles research, writing, fal.ai Nano Banana image generation, linking, and publishing while you focus on strategy.
+8

Creating SEO-Optimized Blogs for WordPress Using Specific Tools

✍️ AI-Powered High-Quality Blog Automation Automate SEO-optimized blog creation, publishing, and internal linking — designed for Lovable.dev or seamless WordPress integration. Proven to boost impressions by +15% weekly on real websites. 📌 Example: AI Applications in Real Estate Playbook — fully generated, optimized, and published with this automation. 🚀 What This Workflow Does Bring Your Own Keywords** You provide the keyword list — the workflow applies a scoring formula to rank them by relevance and competition for maximum SEO impact. Keyword Scoring & Logging** Scores primary and secondary keywords, logs them in PostgreSQL, and prevents reuse until strategically relevant. Deep Research & Blog Planning** Uses Perplexity AI and other AI models to outline, plan, and enrich each article with authoritative external sources. SEO-Optimized Redaction** Writes multi-part, long-form blogs with integrated internal links (to your existing content) and external links to reputable sites. Image Generation & Selection** Creates or selects high-quality header and in-article images, optimized for your topic. Full Blog Infrastructure** Internal & external linking logic Blog card + metadata updates Sitemap updates & Google indexing submission Post logging for future reference Publishing Flexibility** Direct GitHub commits for Lovable.dev WordPress-ready export Optional Slack approval before publishing 🔗 Integrated Services PostgreSQL** – Keyword & content database Perplexity AI** – Research & planning OpenAI / OpenRouter Models** – Multi-part blog writing Lovable.dev / GitHub** – Direct publishing WordPress-ready JSON output** – Easy CMS import Slack** – Approval workflow before going live 💼 What You Get Detailed Setup Guide** Workflow Description** 📥 Perfect For Website owners wanting consistent SEO growth Agencies handling multiple client sites Marketers running content-heavy campaigns Lovable.dev or WordPress users who want hands-off publishing 💡 Why You’ll Love It This is more than a blog writer — it’s a complete content infrastructure. From keyword prioritization to publishing and indexing, it keeps your site growing in reach and authority while you focus on your business.

Build your own Postgres and Wordpress integration

Create custom Postgres and Wordpress workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

Postgres supported actions

Delete
Delete an entire table or rows in a table
Execute Query
Execute an SQL query
Insert
Insert rows in a table
Insert or Update
Insert or update rows in a table
Select
Select rows from a table
Update
Update rows in a table

Wordpress supported actions

Create
Create a post
Get
Get a post
Get Many
Get many posts
Update
Update a post
Create
Create a page
Get
Get a page
Get Many
Get many pages
Update
Update a page
Create
Create a user
Get
Get a user
Get Many
Get many users
Update
Update a user
Use case

Save engineering resources

Reduce time spent on customer integrations, engineer faster POCs, keep your customer-specific functionality separate from product all without having to code.

Learn more
Use case

Automate lead management

Using too many marketing tools? n8n lets you orchestrate all your apps into one cohesive, automated workflow.

Learn more

FAQs

  • Can Postgres connect with Wordpress?

  • Can I use Postgres’s API with n8n?

  • Can I use Wordpress’s API with n8n?

  • Is n8n secure for integrating Postgres and Wordpress?

  • How to get started with Postgres and Wordpress integration in n8n.io?

Need help setting up your Postgres and Wordpress integration?

Discover our latest community's recommendations and join the discussions about Postgres and Wordpress integration.
Mikhail Savenkov
Honza Pav
Vyacheslav Karbovnichy
Dennis
Dennis

Looking to integrate Postgres and Wordpress in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Postgres with Wordpress

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon