← All N8N workflows
AI & researchDate TimeGoogle SheetsHTTP RequestIfOpenAI Chat Model

AI-Generated Summary Block for WordPress Posts - with OpenAI, WordPress, Google Sheets & Slack

Configured with Date Time, Google Sheets, HTTP Request, OpenAI Chat Model, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerWhen clicking ‘Testworkflow’Manual TriggerAI & modelsText ClassifierText ClassifierAI & modelsOpenAI Chat ModelOpenAI Chat ModelRoutingLoop Over ItemsLoop Over ItemsRoutingIfIfTriggerWebhookWebhookTriggerSchedule TriggerSchedule TriggerWeb / APIWordpress - Update PostHTTP RequestData storeGoogle Sheets - GetrowsGoogle SheetsTransformHTML to MarkdownMarkdownAI & modelsOpenAIOpen AiData storeGoogle Sheets - Add RowGoogle SheetsMessagingSlack - Notify ChannelSlackTransformSet fields - FromWebhook inputEdit FieldsTransformDate & Time - SubstractDate TimeTransformSet fields - Preparedata for Gsheets &…Edit FieldsIntegrationWordPress - Get Post2WordpressRoutingNo Operation, donothingNo OpIntegrationWordPress - Get LastPostsWordpressIntegrationWordPress - Get Post1WordpressIntegrationWordPress - Get AllPostsWordpress

Node categories in this workflow

  • Trigger
  • AI & models
  • Routing
  • Web / API
  • Data store
  • Transform
  • Messaging
  • Integration

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
Text ClassifierAI & modelsText ClassifierSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
Loop Over ItemsRoutingLoop Over ItemsSee node parameters
IfRoutingIfSee node parameters
WebhookTriggerWebhookSee node parameters
Schedule TriggerTriggerSchedule TriggerSee node parameters
Wordpress - Update PostWeb / APIHTTP RequestPOST
Google Sheets - Get rowsData storeGoogle SheetsSee node parameters
HTML to MarkdownTransformMarkdownSee node parameters
OpenAIAI & modelsOpen AiSee node parameters
Google Sheets - Add RowData storeGoogle Sheetsappend
Slack - Notify ChannelMessagingSlackSee node parameters
Set fields - From Webhook inputTransformEdit FieldsSee node parameters
Date & Time - SubstractTransformDate TimesubtractFromDate
Set fields - Prepare data for Gsheets & SlackTransformEdit FieldsSee node parameters
WordPress - Get Post2IntegrationWordpressget
No Operation, do nothingRoutingNo OpSee node parameters
WordPress - Get Last PostsIntegrationWordpressgetAll
WordPress - Get Post1IntegrationWordpressget
WordPress - Get All PostsIntegrationWordpressgetAll

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleApi
  • httpHeaderAuth
  • openAiApi
  • slackOAuth2Api
  • wordpressApi

Workflow notes

Trigger - Two Options

Trigger - Two Options

To use this workflow, you have two trigger options.

The default trigger is "When clicking 'Test workflow'", allowing you to manually test the scenario.

If you want to use this workflow in production, you can choose one of the following triggers. You'll need to select the one you prefer and enable it.:

Schedule Trigger

This trigger checks at regular intervals (e.g., every 5 minutes) if a new post has been published on your WordPress blog and triggers the workflow accordingly.

✅ Easy to set up ✅ Automates AI summaries without manual intervention

⚠️ If you run the workflow manually once, the AI-generated summaries will be added to Google Sheets and processed in later steps to prevent duplication.

💡 Recommended follow-up nodes: If you choose this trigger, the following nodes are suggested in the template:

  • Date & Time - Subtract: Subtracts the scheduled interval from the current execution timestamp. For example, if the workflow runs every 5 minutes, it subtracts 5 minutes from the execution time.
  • WordPress - Get Posts: Uses the output of the Date & Time - Subtract node as a filter to retrieve only posts published after the last execution.

Webhook Trigger

If you're familiar with webhooks, you can set up a webhook that triggers when a new post is published.

✅ Faster than scheduled triggers ✅ More event-driven

You can implement this using either:

  • A Webhook plugin on WordPress (not recommended due to plugin dependency).
  • A PHP function that triggers the webhook with authentication for security.

⚠️ Be cautious with how the webhook is triggered—you may not want it to fire on every post edit.

💡 Recommended follow-up nodes for this option:

  • Set Fields - From Webhook Input: Configures the fields based on the data sent to the webhook.
  • WordPress - Get Post: Retrieves the post using the post_id received from the webhook, ensuring higher accuracy than the schedule trigger approach.
WordPress - Get All Posts

WordPress - Get All Posts

This node is used for the initial/test run. In production, you should use the WordPress node that follows the Scheduled Trigger or Webhook Trigger instead.

It retrieves all existing WordPress posts to generate an AI Summary.

🔹 Considerations:

  • In this template, the query is limited to 5 posts to prevent accidental large-scale execution. This makes it easier to fix any issues.
  • You can add filters (category, tag, date, etc.) to target only the posts for which you want an AI Summary.
  • You can enable the "Get All Posts" option in the node if you want summaries for all posts—but make sure this is intentional.
  • The more posts you process, the higher the cost in OpenAI API usage.
Loop Over Items

Loop Over Items

Since multiple posts may be retrieved from the previous step, a "Loop Over Items" node is used to process each post individually, optimizing the execution of subsequent nodes.

🔹 In Production - Using the "Schedule Trigger"

You can continue using the "Loop Over Items" approach in production. Depending on your publication frequency and the schedule interval you've chosen, multiple posts could be retrieved in a single execution. This ensures each post is processed sequentially.

🔹 In Production - Using the "Webhook Trigger"

With a Webhook Trigger, the workflow typically runs for one post at a time, meaning the "Loop Over Items" node is not strictly necessary.

  • You can remove it for a slightly more efficient workflow.
  • However, keeping it won’t cause any issues—it will simply loop over one item instead of multiple.
Google Sheets - Get Rows & IF Nodes

Google Sheets - Get Rows & IF Nodes

This step is used to check whether a post already has an AI Summary.

For the Google Sheets node, you can make a copy of this Google Sheets template by going to File → Make a copy.

🔹 How It Works:

  1. On the first execution, posts retrieved from WordPress and processed for AI summarization are added to a Google Sheet.
  2. On subsequent executions, when the workflow retrieves new posts, it checks if the post_id is already recorded in Google Sheets.

🔹 IF Node Logic:

  • ✅ If a row exists for the post_id → The post already has an AI Summary. The workflow skips processing and moves to the "Loop Over Items" node.
  • ❌ If no row exists for the post_id → The post does not have an AI Summary, so the workflow continues along the execution path that leads to AI Summary generation.
WordPress - Get Post & HTML to Markdown Nodes

WordPress - Get Post & HTML to Markdown Nodes

This step retrieves the WordPress post data using the post_id and converts the HTML content to Markdown. This ensures that the text is formatted in a clean and structured way before being sent to the Text Classifier node (which works with AI). More details about this step are provided in the next sticky note.

🔹 WordPress - Get Post

  • The context=edit option is enabled to retrieve the raw post data.
  • This is necessary because the post content will be updated later in the workflow.

🔹 HTML to Markdown

  • Converts the retrieved HTML content into Markdown format.
  • This makes the text easier to process for the LLM (Large Language Model) in the next step.
  • Markdown ensures that the AI better understands the structure and formatting of the content.
Text Classifier

Text Classifier

This step classifies posts into categories:

  • not_summarized → If the post does not have a summary, the following nodes execute the AI summary generation.
  • summarized → If the post already has a summary, the workflow skips processing:
  • The workflow moves to "Loop Over Items".
  • The "Done" branch goes to the "Do Nothing" node.

The LLM model used is gpt-4o-mini—it's efficient and cost-effective, but you can choose another model if needed.

🔹 Why Use a Text Classifier?

The previous node already filters posts based on Google Sheets, but adding this classification step makes the workflow even more robust:

  • ✅ Extra validation: If a post already has an AI Summary but, for some reason, is not listed in Google Sheets, this step prevents duplicate summaries.
  • ✅ Avoids redundancy: If a post already contains a manual or pre-existing summary at the top (not necessarily AI-generated), this step prevents adding an AI Summary that would be redundant.
OpenAI - Message a Model

OpenAI - Message a Model

This step sends the Markdown-formatted post to GPT-4o-mini, using a System Prompt to instruct the LLM to generate an AI Summary. You can review and modify the System Prompt directly within this node.

🔹 Customization Required

To ensure optimal results, you should:

  • Specify your website's theme in the system prompt. The default example uses electric mobility, but you can replace it with a more relevant theme (e.g., "sustainable mobility", "urban transport," etc.).
  • Modify the "Good" and "Bad" output examples—since the template is pre-configured for electric mobility, make sure to adapt the examples to match your content.

🔹 Output Format

The model is instructed to return the summary in HTML format, which will be used to update the WordPress post.

💡 Customization Tip: You may want to adjust the HTML styling to better match your WordPress theme. Consider modifying the following elements:

  • Background color, text color, and font weight
  • Section title (e.g., rename "AI Summary")
  • Padding, margins, and border styling
  • Removing or customizing the separator

🔹 Default Generated HTML



WordPress - Update Post

WordPress - Update Post

This API call updates the WordPress post and its excerpt.

https://<your-domain.com>/wp-json/wp/v2/posts/{{ $('Loop Over Items').item.json.id }}

🔹 What It Does

  • Adds the AI Summary at the top of the post.
  • Updates the post excerpt using data retrieved from the WordPress - Get Post2 node:
  • If a manual excerpt exists, it is preserved.
  • If the excerpt was simply the beginning of the article, it remains unchanged.
  • This prevents the AI Summary from replacing the excerpt, ensuring a better user experience on your blog’s article listing page.
Set Fields - Prepare Data for Google Sheets & Slack

Set Fields - Prepare Data for Google Sheets & Slack

This node sets fields that will be used in Google Sheets and Slack. You can add or modify fields as needed to fit your specific use case.

🔹 Default Fields in This Template:

The following fields are pre-configured:

  • post_id → The WordPress post ID ({{ $json.id }})
  • title → The rendered title of the post ({{ $json.title.rendered }})
  • post_link → The direct URL to the post ({{ $json.link }})
  • edit_link → A direct link to edit the post in WordPress (https:///wp-admin/post.php?post={{ $json.id }}&action=edit)
  • summary → The AI-generated summary from the OpenAI node ({{ $('OpenAI').item.json.message.content }})
  • summary_date → The date and time when the AI Summary was generated and added to the post.

💡 Customization Tip:

  • You can add additional fields if you want to include more data (e.g., post category, author name, publication date).
  • This step ensures that the necessary information is properly structured before sending it to Google Sheets and Slack.
Google Sheets - Add Row & Slack - Notify

Google Sheets - Add Row & Slack - Notify

This step logs the post with an AI Summary into Google Sheets and sends a notification to Slack.

For the Google Sheets node, you can make a copy of this Google Sheets template by going to File → Make a copy.


🔹 Google Sheets - Add Row

This node automatically maps the columns in Google Sheets, meaning you don't need to manually define each field.

🛠 Configuration Details

  • Google Sheets Document → AI Summary WordPress
  • Sheet Name → AI Summarized Posts
  • Mapping Mode → Auto-map columns based on field names
  • Automatically added fields (examples, based on your setup):
  • post_id
  • summary
  • post_link
  • edit_link
  • summary_date

💡 Since columns are mapped automatically, ensure the column names in Google Sheets match the field names in n8n.


🔹 Slack - Notify

This node sends a message to Slack when a post has been updated with an AI Summary.

🛠 Configuration Details

  • Channel → wp-posts-ai (you can choose another channel)
  • Message Format → Simple Text Message
  • Notification Text -> Configured inside the node (check the "Message Text" field)

💡 Best Practices:

  • 🔕 On the first execution, consider deactivating this node if you have many posts to avoid excessive notifications.
  • 📢 Consider creating a dedicated Slack channel for this workflow to keep AI summary updates separate from other discussions.
📝 AI-Generated Summary Block for WordPress Posts

📝 AI-Generated Summary Block for WordPress Posts

🚀 What is this workflow?

This n8n template automates the process of adding an AI-generated summary at the top of your WordPress posts. It retrieves, processes, and updates your posts dynamically, ensuring efficiency and flexibility without relying on a heavy WordPress plugin.

Example of AI Summary Section

🔄 How It Works

  1. Triggers → Runs on a scheduled interval or via a webhook when a new post is published.
  2. Retrieves posts → Fetches content from WordPress and converts HTML to Markdown for AI processing.
  3. AI Summary Generation → Uses OpenAI to create a concise summary.
  4. Post Update → Inserts the summary at the top of the post while keeping the original excerpt intact.
  5. Data Logging & Notifications → Saves processed posts to Google Sheets and notifies a Slack channel.

🎯 Why use this workflow?

✅ No need for a WordPress plugin → Keeps your site lightweight. ✅ Highly flexible → Easily connect with Google Sheets, Slack, or other services. ✅ Customizable → Adapt AI prompts, formatting, and integrations to your needs. ✅ Smart filtering → Ensures posts are not reprocessed unnecessarily.

💡 Check the detailed sticky notes for setup instructions and customization options!

AI-Generated Summary Block for WordPress Posts - with OpenAI, WordPress, Google Sheets & Slack

AI-Generated Summary Block for WordPress Posts - with OpenAI, WordPress, Google Sheets & Slack

Purpose and structure

This folder contains the AI-Generated Summary Block for WordPress Posts - with OpenAI, WordPress, Google Sheets & Slack workflow. Its executable nodes use dateTime, googleSheets, httpRequest, if, lmChatOpenAi, manualTrigger, markdown, noOp, openAi, scheduleTrigger, set, slack, splitInBatches, textClassifier, webhook, wordpress. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

When clicking ‘Test workflow’, Webhook, Schedule Trigger

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Datetime/1272_Datetime_Webhook_Create_Webhook.json MIT; preserve source notices.

More in AI & research