← All Projects


Live — Project 4 of 5

Topic in.
Published post out.

A fully automated content pipeline that takes a topic, runs it through three chained Claude API calls — research, writing, SEO — and publishes a finished blog post to Ghost CMS. Zero human writing required.

<2min
Topic to published post

3
Chained Claude API calls

700+
Words per generated post

8
n8n pipeline nodes

The Business Problem

Content marketing is expensive and slow

A single blog post — researched, written, SEO-optimised, and published — takes a skilled writer 3 to 6 hours. For businesses publishing weekly, that’s a serious bottleneck.

This pipeline collapses that 3–6 hours into under 2 minutes. A marketing manager enters a topic, clicks submit, and a fully written, SEO-optimised post appears in their CMS draft queue — ready to review and publish. The human stays in control of the publish decision; the AI handles all the creation work.

Before
3–6 hrs
Research → draft → SEO → publish

After
<2 min
Push a topic. Get a published post.

This pipeline is live and running. Visit the demo — enter any topic and watch it publish a real post to Ghost CMS in real time.


Open live demo →

8-Node n8n Pipeline

How the workflow runs end to end

Every step below is a node in a single n8n workflow. The pipeline fires on a webhook, runs three Claude API calls in sequence, assembles the Ghost post payload, publishes it, and returns the result to the UI.

01
Webhook Trigger
Receives { topic, keyword, language } from the form submit. Starts the pipeline.
n8n Webhook

02
🧠
Claude — Research & Outline
Sends the topic to Claude. Returns a JSON outline: title, target audience, 5 sections with key points each.
Claude API · claude-sonnet-4-6

03
⚙️
Clean Outline
Strips control characters from Claude’s JSON response to prevent downstream parse errors. Stores clean text for next node.
n8n Code Node

04
✍️
Claude — Full Draft
Receives the outline. Returns a 600–900 word blog post as clean HTML using h2, p, ul, and li tags only.
Claude API · 4096 max tokens

05
🔍
Claude — SEO Meta
Receives title + post excerpt. Returns JSON: meta title (60 chars), meta description (155 chars), URL slug, 5 focus keywords.
Claude API · SEO specialist prompt

06
📦
Assemble Ghost Payload
Merges HTML body + SEO metadata into a Ghost-compatible post object: title, html, slug, meta tags, tags, status.
n8n Code Node

07
👻
Ghost — Create Post
POSTs the assembled payload to the Ghost Admin API via JWT authentication. Ghost creates the draft and returns the post URL and ID.
Ghost Admin API

08
📡
Respond to UI
Returns the final JSON to the demo frontend: title, excerpt, meta tags, focus keywords, Ghost post URL, and pipeline timing.
n8n Respond to Webhook

Prompt Engineering

Three Claude calls, three different jobs

Each Claude call in the pipeline uses a distinct system prompt tuned for its specific task. This is multi-step prompt chaining — not a single AI call, but a coordinated chain of specialist agents.

01
Content Strategist

Research & Outline

Generates a structured JSON outline: H1 title, target audience description, 5 section headings, and 3–5 key points per section. Forces JSON-only output — no prose.

Output shape
{ title, targetAudience,
  sections: [{ heading,
    keyPoints[] }] }

02
Expert Blog Writer

Full Draft

Expands the outline into a complete 600–900 word blog post in clean HTML. Uses h2, p, ul, and li tags only. Leads with value, short paragraphs, practical takeaway at the end.

Output format
<h2>Section Heading</h2>
<p>Body text...</p>
<ul><li>Point</li></ul>

03
SEO Specialist

SEO Meta

Generates complete SEO metadata from the post title and excerpt. Enforces character limits: 60 chars for meta title, 155 for meta description, lowercase-hyphenated slug.

Output shape
{ metaTitle, metaDescription,
  slug, focusKeywords[] }

Architecture

Tech stack & how it connects

n8n
n8n (n8n.cloud)
Workflow orchestration — the entire pipeline runs as a single n8n workflow with 8 nodes

AI
Claude API (claude-sonnet-4-6)
3 chained calls: research + outline, full draft writing, SEO meta generation

👻
Ghost CMS
Publishing target via Admin API. JWT authentication, programmatic post creation with full metadata

🌐
Netlify
Hosts the demo frontend (vanilla JS). Serverless function acts as proxy to protect the n8n webhook URL

JS
Vanilla JS / HTML / CSS
Single-file demo UI. Form, live pipeline status panel, results display with Ghost post URL

Git
VS Code + Claude Code
Built entirely with Claude Code in VS Code. Git + GitHub for version control and Netlify auto-deploy

Web Form

Netlify Proxy

n8n Webhook

Claude API ×3

Ghost CMS

Published Post

Engineering Detail

The JSON sanitisation problem (and fix)

When Claude’s response text (containing newlines or special characters) is interpolated directly into a JSON body in n8n’s HTTP Request node, it causes Bad control character in string literal errors. This took real debugging to solve.

❌ The Problem

Claude returns multi-line JSON or HTML. Feeding it directly into the next HTTP Request node’s JSON body breaks the payload — control characters like \n and \t inside string values are invalid in raw JSON bodies.

✅ The Fix

Insert a Code node between each Claude call and the next HTTP Request. Strip all control characters with .replace(/[\x00-\x1F\x7F]/g, ' '), store the clean value in a variable, then reference {{ $json.cleanField }} in the JSON body.

Clean Outline node — Code Node (JavaScript)

const outlineRaw = $('Claude — Research & Outline').item.json.content[0].text;
const language = $('Webhook (form submit)').item.json.body.language || 'English';

// Strip control characters that break JSON interpolation
const cleanOutline = outlineRaw
  .replace(/[\x00-\x1F\x7F]/g, ' ')
  .replace(/"/g, '\\"');

return [{ json: { cleanOutline, language, outlineRaw } }];

Skills Demonstrated

What this project proves

🔗
Multi-step LLM chaining

Three Claude API calls in sequence, each with a distinct system prompt — research, writing, SEO. Not a single-shot prompt, but a coordinated chain of specialist agents.

⚙️
n8n workflow orchestration

8-node workflow with webhook trigger, HTTP Request nodes, Code nodes for data transformation, and Ghost API integration — all wired together without a single line of server code.

🔑
CMS API integration

Ghost Admin API with JWT authentication. Programmatic post creation with full metadata — title, HTML body, slug, meta tags, and focus keywords.

🧪
Prompt engineering

Each prompt enforces a strict output format (JSON or HTML only, no prose, no code fences) and character constraints. Reliable structured output from LLMs.

🐛
Production debugging

Solved the JSON control character problem that breaks n8n ↔ Claude integrations — a real-world issue not covered in tutorials. The fix is reusable across projects.

🚀
End-to-end deployment

n8n.cloud for workflow hosting, Netlify for the demo frontend with serverless proxy, Ghost for CMS. Full stack deployed and smoke-tested end to end.

Business Value

Who pays for this kind of automation

01
Content & marketing agencies
Agencies producing 20+ posts/month for clients. This cuts production time by 80% and lets writers focus on strategy and editing instead of drafting.

02
E-commerce stores
Stores that need weekly SEO content but can’t afford a dedicated content team. Automate product guides, buying guides, and comparison posts at scale.

03
SaaS companies
Maintain a technical blog without pulling engineers away from product work. Generate documentation, tutorials, and thought leadership with a single click.

04
Any blog on Ghost, WordPress, or Webflow
The same pipeline architecture works with any CMS that has an API. Adaptable to WordPress REST API, Webflow CMS API, or custom headless CMS targets.

Let’s Work Together

Want this pipeline built for your business?

I build custom AI automation workflows — content pipelines, lead gen, document processing, CRM integration. Let’s talk about what you need.

Also available on
the live demo
— see the pipeline running in real time.