Review and approve pending WordPress posts with Gemini and Slack
Quick overview When a writer submits a WordPress post for review, Gemini checks it and an editor gets it in Slack with one Review button. Publish it, or send it back with a note: the post returns to drafts and the author gets the note by email.
How it works Review Request Webhook receives {"post_id": 123} from WordPress the moment a post moves to Pending, so there is no schedule to tune. Header Auth keeps the endpoint private. Settings holds the Slack channel, your house style, the minimum word count, whether a featured image or excerpt is required, the answer time and the sender address. Get Post reads the pending post through the WordPress API (a pending post is not public, so this uses your WordPress credential) and Get Author reads the writer's name and email. Post Checks is a short Code node that tests what Settings requires: a title, the word count, the featured image and the excerpt. Route Post sends a complete post to review, an incomplete one straight back to the author, a post that is no longer pending to Ignore Post, and a read error to the channel as a setup warning. Review Post sends the post and your house style to Gemini Chat Model and gets back a verdict (ready or needs work), a one-line summary and up to five concrete issues, checked against a JSON schema. If Gemini fails, Review Verdict still sends the post on, marked for review by hand. Ask Editor posts the summary, the issues, the checks and the preview and edit links to Slack with a Review button, then waits. The button opens a short form: Publish, or Send back with a note for the author. Editor Decision and Route Decision read the answer. Publish: Recheck Post reads the post again and Still Pending lets Publish Post set it live only if nobody changed it while it waited. Send back: Author Note writes the email, Back to Draft returns the post to drafts and Email Author sends the note. Incomplete posts take the same route with the list of what is missing. Publish Result and Return Result word the outcome and Post Update posts it to the channel: published with the link, sent back with the note, no answer in time, or what failed.
Setup Open Settings. Set review_channel, describe your house style in house_style (Gemini reviews against it), and adjust min_words, require_featured_image, require_excerpt, answer_within_hours (default 48) and from_email. Open Review Request Webhook, add a Header Auth credential (for example X-Webhook-Token with a long random value) and copy the production URL. In WordPress, go to Users, open an administrator, create an application password and connect it as a WordPress credential on Get Post, Get Author, Recheck Post, Publish Post and Back to Draft. With an editor account everything works except the author's email, and Slack tells you so. Create a Gemini API key and connect it on Gemini Chat Model. The template uses gemini-3.1-flash-lite, which is enough for a copy check. Create a Slack app with the chat:write scope, connect its bot token on Ask Editor and Post Update, and invite the app to the channel (/invite @your-app), or Slack answers not_in_channel. The Review button opens an n8n form, so no Slack interactivity setup is needed. Connect your mail server as an SMTP credential on Email Author. Use an address your server may send from in from_email. In WordPress, send {"post_id": 123} to the webhook URL when a post moves to Pending. The free Webhook Actions plugin does it without code: new webhook on wp_after_insert_post, map args.0 to post_id, add the conditions args.1.post_status equals pending, args.3.post_status is not pending and args.1.post_type equals post, and attach the header credential. Or import the ready-made build with exactly this setup. A short PHP snippet that does the same is under Additional info. Activate the workflow, log in as a contributor (or any user) and click Submit for Review on a post. The Review button in Slack opens the form.
Requirements WordPress 5.6 or later, with application passwords (built in) and an administrator account A Gemini API key, a Slack workspace and an SMTP mail account
Customization Change what Gemini looks for by editing house_style in Settings, or the issue descriptions in Review Post's schema, for example to check SEO titles or banned words. Swap Gemini Chat Model for OpenAI, Anthropic or a local model; Review Post works with any chat model node. Review pages or a custom post type: change the post type in the WordPress condition and the resource in Get Post, Recheck Post, Publish Post and Back to Draft. Schedule instead of publishing: set a date in Publish Post, or add a date field to the Ask Editor form.
Additional info Who is this for. Blogs where contributors, freelancers or guest authors submit posts for review. WordPress has the Pending status but never tells the editor, so pending posts wait until someone looks.
Why wp_after_insert_post. It fires once the post, its featured image and its categories are all saved. transition_post_status fires earlier, so with the block editor a post submitted together with its featured image would be reported as having none.
WordPress side without a plugin. Put this in functions.php or a custom plugin, and replace the URL and the token with yours (the token must match the Header Auth credential in n8n):
add_action( 'wp_after_insert_post', function ( $post_id, $post, $update, $post_before ) { // Only the moment a post is submitted for review, not each save while it waits. $before = $post_before ? get_post_status( $post_before ) : ''; if ( 'post' !== get_post_type( $post_id ) || 'pending' !== get_post_status( $post_id ) || 'pending' === $before ) { return; } $payload = []; $payload['post_id'] = $post_id;
$args = [];
$args'headers' = 'application/json';
$args'headers' = 'YOUR-TOKEN';
$args['body'] = wp_json_encode( $payload );
$args['blocking'] = false; // do not make the writer wait for n8n
wp_remote_post( 'https://YOUR-N8N/webhook/wordpress-post-review', $args );
}, 10, 4 ); `
Related Templates
AI Weather Forecasts with MCP Integration
Real-time Weather Forecasts with MCP Tools This n8n workflow demonstrates how to integrate real-time weather intelligen...
Extract Named Entities from Web Pages with Google Natural Language API
Who is this for? Content strategists analyzing web page semantic content SEO professionals conducting entity-based anal...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
๐ Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments