Request icon
ChatCompletion icon
Script icon
SlackIncomingWebhook icon

Generate AI Blog Posts in Your Brand Voice and Publish to WordPress as Draft

Automate brand-consistent blog creation with Kestra and OpenAI GPT-4o. Extract your writing style, generate an on-brand post, and publish to WordPress as a draft.

Categories
AIBusiness

Generate publication-ready blog posts that match your existing brand voice and land in WordPress as a draft, all from a single topic input. This AI blog post generator solves the biggest problem with automated content: generic, off-brand writing. Instead of feeding the model abstract style rules, it learns from your real published articles via your RSS feed, builds a structured brand voice profile with OpenAI GPT-4o, writes a full Markdown article calibrated to your target audience, converts it to clean HTML, and posts it to WordPress for human review and one-click publishing. It is a complete content automation pipeline combining AI text generation, CMS publishing, and Slack notifications in declarative YAML.

How it works

  1. fetch_reference_articles (io.kestra.plugin.core.http.Request) pulls your existing blog content from the RSS feed at the brand_url input.
  2. extract_brand_voice (io.kestra.plugin.openai.ChatCompletion) analyzes the sample content with gpt-4o and a jsonResponseSchema, returning structured tone, vocabulary, structure pattern, example opening, and content guidelines.
  3. generate_blog_post (io.kestra.plugin.openai.ChatCompletion) writes a full Markdown article (H1 title, intro, 3-4 H2 sections, conclusion) using the voice profile and the target_audience input as generation constraints.
  4. prepare_wp_payload (io.kestra.plugin.scripts.python.Script) uses the markdown2 dependency to convert Markdown to HTML, split out the title, build an excerpt, count words, and emit a WordPress payload.
  5. publish_to_cms (io.kestra.plugin.core.http.Request) POSTs the draft to the WordPress REST API at cms_api_url using Basic authentication.
  6. notify_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) sends the title, word count, status, and a review link to your content channel.

What you get

  • On-brand drafts learned from your real articles, not generic AI prose
  • Audience-calibrated depth, examples, and terminology
  • Clean HTML, an excerpt, and word count ready for editorial review
  • A WordPress draft (never auto-published) plus a Slack heads-up per run

Who it's for

  • Content teams that publish regularly and want consistent, on-brand drafts
  • Marketing automation owners triggering posts from keyword or campaign calendars
  • Solo bloggers and founders maintaining cadence without the time cost
  • Agencies running one flow per client brand via different brand_url inputs

Why orchestrate this with Kestra

OpenAI and WordPress have no shared scheduler or workflow engine that can chain a model call into a CMS publish, add a script step in between, and notify a team. Kestra fills that gap. You get event triggers, automatic retries on flaky HTTP or API calls, full execution lineage across every task, and a declarative YAML definition you can version control. The brand voice profile, generation, payload prep, publish, and notification run as one observable pipeline instead of glue scripts.

Prerequisites

  • A Kestra instance
  • An existing blog with a reachable RSS feed and a WordPress site with the REST API enabled
  • A WordPress application password for Basic auth and a Slack incoming webhook

Secrets

  • OPENAI_API_KEY: API key for the OpenAI GPT-4o calls
  • WP_AUTH_TOKEN: base64 Basic auth token for the WordPress REST API
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL for notifications

Quick start

  1. Add the OPENAI_API_KEY, WP_AUTH_TOKEN, and SLACK_WEBHOOK_URL secrets to your Kestra instance.
  2. Set the brand_url, cms_api_url, and target_audience input defaults for your site.
  3. Execute the flow with a post_topic.
  4. Review the generated draft in WordPress and publish when ready.

How to extend

  • Add a io.kestra.plugin.core.flow.Pause task before publish_to_cms for a human-approval gate.
  • Auto-populate SEO meta description and keywords from an additional model call.
  • Target other CMS platforms (Ghost, Contentful, Strapi) by swapping the publish Request.
  • Chain into a social post generator for LinkedIn and X variants of the same article.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.