AIKit's Auto Blog plugin transforms content marketing from a manual bottleneck into an automated production pipeline — generating, validating, scheduling, and publishing blog posts entirely through LLMs, with zero human intervention. By combining OpenRouter's multi-model gateway, Cloudflare Workers' serverless edge compute, and D1's scalable SQLite database, the plugin delivers a queue-based architecture that has already published over 200 posts autonomously.
The Problem — Manual Content Marketing at Scale Is Unsustainable
Organizations investing in content marketing quickly hit a scalability wall. A single blog post requires research, drafting, editing, SEO optimization, formatting, scheduling, and publishing — consuming 4–6 hours per post. At one post per week, that's manageable. At ten or twenty, the process collapses.
The bottleneck isn't creativity — it's execution. Writers burn out, editorial calendars slip, SEO consistency degrades, and cost per published word climbs exponentially. Traditional automation tools fall short too: CMS schedulers still need pre-written content, RSS scrapers republish stale material, and template-based generators produce thin duplicate content that search engines penalize. The market needed a system that could create original, context-aware content end-to-end.
The Solution — LLM-Powered Auto Blog Plugin with Queue-Based Publishing
AIKit's Auto Blog plugin addresses these challenges head-on. It replaces the human content pipeline with an LLM-driven queue handling every stage: topic generation, writing, validation, formatting, scheduling, and publishing. The human role shifts from writer to strategist — defining guardrails, content guidelines, and cadence, then letting the system execute.
The plugin is a Cloudflare Worker deployed at the edge in over 300+ data centers worldwide. It uses OpenRouter as its LLM gateway, providing unified access to GPT-4o, Claude 3.5 Sonnet, Gemini Pro, and dozens of open-weight models. Users switch providers or models with a single config change — no code modifications needed.
Content generation follows a structured six-stage pipeline:
1. **Topic Discovery** — The system scans existing content, keyword targets, and competitor gaps to propose topics with estimated search volume.
2. **Outline Generation** — Each topic is expanded into a structured outline with H2/H3 headings and target word count.
3. **Draft Production** — The LLM generates a full article following the outline, adhering to tone and brand voice rules from configuration.
4. **Validation** — The draft is checked against quality criteria: minimum length, heading structure, internal linking requirements, and originality.
5. **Scheduling** — Validated posts enter a queue with staggered timestamps for consistent editorial calendar spacing.
6. **Publication** — At the scheduled time, the post is written to D1 and served through the website's template system.
Architecture Overview — Cloudflare Workers + D1 + KV
The plugin's architecture is minimalist. It runs entirely on Cloudflare's free-tier-viable infrastructure, requiring no servers, no containers, and no database administration.
| Component | Role | Why It Was Chosen |
|---|---|---|
| **Cloudflare Workers** | Serverless execution | Global edge deployment, sub-10ms cold starts, zero ops |
| **Cloudflare D1** | Primary database | Serverless SQLite, ACID transactions, point-in-time recovery |
| **Cloudflare KV** | Configuration store | Ultra-low latency reads for settings and API keys |
| **OpenRouter** | LLM API gateway | Multi-model access, fallback chains, unified billing |
| **Cron Triggers** | Scheduling engine | Fires the queue processor on configurable intervals |
The data flow is straightforward. When a cron trigger fires, the Worker reads configuration from KV — including `llmProvider`, `llmApiKey`, `model`, `maxTokens`, and content guidelines — then checks D1 for pending queue items ordered by `scheduled_at`. For each pending item, it calls the configured LLM, validates the returned content, and on success writes the final post to D1 with status `published`.
```sql
-- Core schema for the auto-blog queue
CREATE TABLE queue (
id INTEGER PRIMARY KEY AUTOINCREMENT,
topic TEXT NOT NULL,
outline TEXT,
body_markdown TEXT,
slug TEXT UNIQUE,
status TEXT DEFAULT 'pending' CHECK(status IN ('pending','generating','validating','published','failed')),
scheduled_at TIMESTAMP,
published_at TIMESTAMP,
retry_count INTEGER DEFAULT 0,
llm_provider TEXT,
model TEXT,
tokens_used INTEGER,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```
Configuration lives in KV:
```json
{
"llmProvider": "openrouter",
"llmApiKey": "sk-or-v1-...",
"model": "openai/gpt-4o",
"maxTokens": 4096,
"temperature": 0.7,
"maxPostsPerRun": 3,
"minContentLength": 800,
"brandVoice": "technical but approachable"
}
```
Implementation — Queue Pipeline: Generate → Validate → Publish via D1 INSERT → Archive
The queue pipeline runs within a single Worker invocation, processing up to 3 posts per cron cycle to stay within Workers' CPU time limits.
Step 1: Dequeue
On cron trigger, the Worker executes an atomic transaction that updates status to `generating` and returns the claimed rows. This prevents duplicate processing if two Workers fire simultaneously.
Step 2: Generate
For each dequeued item, the plugin constructs a prompt combining the topic, outline, brand voice guidelines, and formatting instructions. The prompt is sent to OpenRouter with a 30-second timeout. If the primary model fails, the plugin falls back through a chain: `gpt-4o` → `claude-3.5-sonnet` → `gemini-pro` → `mistral-large`. This ensures the pipeline keeps running through individual provider outages.
Step 3: Validate
Raw LLM output undergoes rigorous checks: minimum length (800+ characters), proper heading structure (at least one `##`), no placeholder text (`[insert]`, `lorem ipsum`), language consistency, and MinHash-based originality comparison against recent posts. Content failing validation is marked `failed` with the reason stored. After 3 retries, the post is permanently skipped.
Step 4: Publish
Validated content is written to D1, updating the queue record and upserting into the posts table:
```sql
UPDATE queue SET
body_markdown = ?,
status = 'published',
published_at = datetime('now'),
tokens_used = ?
WHERE id = ?;
```
Step 5: Archive
Posts older than 90 days are moved to a cold-storage archive table, keeping the active queue lean and queries fast.
Results — 235 Posts Published Automatically, Zero Manual Intervention
The production deployment has been running for six months. The metrics speak for themselves:
| Metric | Value |
|---|---|
| **Total posts published** | 235 |
| **Posts per week (average)** | 9 |
| **Manual interventions** | 0 |
| **Average word count per post** | 1,247 |
| **Median generation time** | 18 seconds |
| **Success rate (first attempt)** | 87% |
| **Success rate (with retries)** | 94% |
| **Total tokens consumed** | ~3.2 million |
| **Cost per post (GPT-4o)** | ~$0.08 |
| **Edge latency (95th percentile)** | 1.2 seconds |
The 94% success rate after retries means the pipeline is self-healing — transient API failures don't require human intervention. At $0.08 per post, producing a month's worth of content (40 posts) costs roughly $3.20 — less than a single latte.
Content quality has been validated through organic search. Auto Blog posts average a 40% higher time-on-page compared to manually written posts from the same period, likely because LLM consistency prevents the quality variance typical of multi-author blogs.
Key Takeaways
1. **Queue-based architecture is the right abstraction for LLM content pipelines.** The producer-consumer pattern decouples topic generation from publishing, making the system resilient to API latency spikes and rate limits. Each stage can be independently monitored, retried, and optimized.
2. **Agnostic model selection via OpenRouter eliminates vendor lock-in.** If GPT-4o prices rise or a better model emerges, the change is a single KV entry — not a code deployment. The plugin automatically benefits from model improvements without engineering work.
3. **Serverless infrastructure makes this economically viable at any scale.** Cloudflare Workers and D1 provide a production-grade pipeline at near-zero fixed cost. The infrastructure for 235 posts costs less than a single month of a traditional CMS hosting plan.
4. **Validation is the unsung hero.** Without rigorous validation gates, LLM hallucinations propagate into published content. The validation step catches formatting errors, missing sections, and low-quality output before it reaches readers.
5. **The human role evolves, not disappears.** The strategist defines the framework — topics, voice, SEO targets, quality thresholds. The LLM handles execution. This division of labor produces more content, more consistently, than either humans or models could alone.
AIKit's Auto Blog plugin demonstrates that the future of content marketing isn't about replacing writers — it's about giving them leverage. When the production pipeline runs itself, the strategist focuses on choosing the right topics and connecting content to business outcomes. The LLM handles the rest.