Skip to content
NEWError doctor and Watchtower: failed n8n runs explained in plain words, and emailed to you. See what is new

Library / Content Writing & Generation

Content Writing & Generation

Add AI Summary Blocks to WordPress Posts with OpenAI

When run manually, by webhook or on a schedule, OpenAI writes a summary for WordPress posts listed in Google Sheets, updates the post and notifies Slack.

What it does

## 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.

The steps

  1. When clicking ‘Test workflow’
  2. Text Classifier
  3. OpenAI Chat Model
  4. Loop Over Items
  5. If
  6. Webhook
  7. Schedule Trigger
  8. Wordpress - Update Post
  9. Google Sheets - Get rows
  10. HTML to Markdown
  11. OpenAI
  12. Google Sheets - Add Row
  13. Slack - Notify Channel
  14. Set fields - From Webhook input

21 steps in total.

Similar automations