Automated Blog Generation with n8n, OpenAI, and SerpAPI

Client: Niche Content Publisher

Industry: Web Store Front / SEO & Content Marketing

Platforms: n8n, OpenAI (GPT-4), SerpAPI, Markdown, Gmail, Google Sheets, WordPress (optional)

Time to Build: 15–20 hours

Time Saved: 6–8 hours per week

Consulting Partner: Lumio Consulting

Project Overview / Problem

This client runs a high-volume content site built on SEO-driven traffic. Their content team was spending hours each week researching trending topics, drafting outlines, creating full-length articles, formatting for HTML, finding feature images, and logging everything into their editorial calendar.

They wanted a way to go from SEO keyword to first-draft blog post—complete with metadata, internal linking, and cover image—without touching Google Docs or copy/pasting between systems.

The final blog didn’t have to be published automatically. It just needed to be written, styled, and delivered to the editor’s inbox—ready for review and polish.

Goals of the Automation

The automation needed to:

  • Identify trending industry topics via search trends

  • Generate high-quality blog drafts (800–1,200 words)

  • Add internal and external links automatically

  • Format the content in HTML for WordPress

  • Deliver content to editor via email

  • Log final post metadata (title, slug, description) in a Google Sheet

Automated Blog Generation with n8n, OpenAI, and SerpAPI

Solution Overview / Step-by-Step Breakdown

This n8n-powered system combined GPT-4, SerpAPI, and live content inputs to deliver production-ready content to the client’s inbox.

[INSERT IMAGE: Overview of the full n8n automation workflow screenshot]

Step 1: Find Trending Topics

  • A scheduled trigger runs every few days.

  • SerpAPI is queried to get the top SEO trends from the past 3 days.

  • GPT-4 selects the most promising topics based on volume + relevance.

Step 2: Generate the Blog Post

  • Perplexity API (optional) is called to gather quick research links.

  • GPT-4 writes the full blog post, including structure and markdown formatting.

  • Editor manually adds external links, if desired.

Step 3: Internal Linking + HTML Conversion

  • System pulls existing posts from a database or Google Sheet.

  • GPT suggests related articles for internal links.

  • Content is converted from Markdown to clean HTML, ready for WordPress.

Step 4: Metadata Generation

  • GPT creates a SEO slug, post title, and meta description.

  • These are saved for manual editing or use in the CMS.

Step 5: Cover Image Selection

  • SerpAPI pulls an image based on the blog topic.

  • One image is selected, embedded, and sent to the editor via email.

Step 6: Delivery + Logging

  • The blog post, image, and metadata are emailed to the content editor.

  • A log of the post (slug, title, date) is added to a Google Sheet for tracking.

Challenges

A few hurdles emerged during the build:

  • Avoiding keyword cannibalization – We had to build in logic that checks if a topic was already covered in the blog’s archive.

  • Balancing GPT tone and format – Early drafts were too generic or lacked nuance; prompt refinement was critical.

  • HTML cleanup – Markdown-to-HTML conversion required sanitizing tags and enforcing style consistency across posts.

  • Image selection logic – SerpAPI sometimes returned overly literal or off-brand images, so fallback filters were implemented.

Results / Outcome / Time Saved

After launching the workflow:

  • Draft creation time dropped by 80%

  • Editors received fully-formatted posts with internal links and SEO metadata

  • Posts were better optimized, more consistently structured, and easier to publish

  • Content calendar stayed full—without late-night writing marathons

Estimated time saved: 6–8 hours per week

Client Feedback

It used to take a full workday to go from topic research to draft. Now I get a formatted blog post with links, metadata, and a cover image sitting in my inbox—ready to go. It’s a dream setup.
— Rae, Editor / Content Publisher

Additional Improvements

Since the original launch, we’ve added GPT-powered alt text and discussed additional enhancements such as:

  • A tone selector ("technical", "casual", "storytelling") to align with audience intent

  • GPT-powered image alt text and captions

  • Slack alerts when drafts are ready

Note: While this particular automation sends a draft post to the editor’s email, additional automation could be put in place to immediately and directly publish the blog via WordPress API. We chose (as is common) to keep the human-in-the-loop versus direct publishing.

Tools, Plug-ins, and Platforms Used

  • n8n – Automation orchestration

  • SerpAPI – SEO trend and image lookup

  • OpenAI (GPT-4) – Blog writing, metadata, internal links

  • Perplexity API – Topic research + source summaries

  • Markdown to HTML – HTML formatting for blog post

  • Gmail API – Email delivery to content team

  • Google Sheets – Editorial log and archive

  • WordPress API (optional) – Publishing or draft scheduling

Interested in implementing this automation or a similar solution?

Click the button below to schedule a free discovery call.

Previous
Previous

Automated Proposal, Contract and Invoice Generation

Next
Next

Automated Social Media Content Publishing with ChatGPT and Make.com