Quick Overview
This workflow receives an article brief via webhook, uses Anthropic Claude to generate SEO-ready HTML content, optionally creates a featured image with Google Imagen, then creates a draft post in WordPress with tags and Rank Math SEO metadata and optionally posts a completion message to Slack.
How it works
- Receives a POST webhook request containing an article prompt (and optional title/content/category and writing guides) and optionally validates a Bearer token.
- Builds a structured prompt from your tone and style guides and sends it to Anthropic Claude to generate a JSON payload with the article HTML, excerpt, tags, and SEO fields.
- Optionally generates a 16:9 featured image with Google Imagen based on the returned image subject, then uploads it to WordPress media and sets its alt text.
- Creates or reuses WordPress tags from the generated tag list, collects their IDs, and creates a WordPress post in draft status with the chosen category, author, and featured media.
- Updates the draft post with Rank Math SEO meta fields (focus keyword, SEO title, and meta description) via the WordPress REST API.
- Optionally sends a Slack message with the draft title, edit link, tags, and affiliate note, then returns a JSON webhook response with the created post ID and draft URL.
Setup
- Add credentials for Anthropic, Google AI (PaLM/Imagen), WordPress, and Slack (Slack is required if you enable notifications).
- Update the CONFIG values for your WordPress site URL, default category ID, author ID, and (optionally) a Slack channel ID and a webhook Bearer token secret.
- If you want featured images, keep image generation enabled and ensure your Google AI project has access to the configured Imagen model.
- If you want Rank Math fields to be written via the REST API, install Rank Math and add a mu-plugin that exposes the Rank Math meta fields on posts.
- Copy the webhook URL for the
article-publisher endpoint and send POST requests with at least a prompt field to generate new drafts.