The Core Problem
Most content marketing pipelines leak value at every handoff. A writer produces a draft, an editor adjusts tone, an SEO specialist adds meta tags, a developer publishes the post, and a social media manager promotes it. At each stage, latency, miscommunication, and bottlenecks compound — turning a 2-hour writing task into a 4-day production cycle.
For a solo founder or small team, this pipeline is impossible to sustain. The alternative — not publishing at all — is worse: zero content means zero organic traffic, zero SEO growth, and zero authority building.
What if the entire pipeline could run autonomously, end to end, without a single human touching the production flow?
The Solution
AIKit EmDash's Auto Blog/SEO plugin replaces every stage of the content pipeline with automated systems running on Cloudflare Workers and D1. The architecture is cron-driven, serverless, and costs near zero:
1. **Topic selection** — A cron job reads a content calendar, applies a theme rotation (Content & Growth, Marketing Automation, Sales Channel, Product Launch), and picks the next topic
2. **Content generation** — An LLM agent generates a full blog post with 800-1500 words of body text, markdown headings, code blocks, and excerpt
3. **Queue management** — The generated post is written as a JSON queue file with a numbered slug
4. **Publication** — A separate cron run picks the queue file, calls `blog-publisher.py`, which inserts into D1's `ec_posts` table with proper ULID IDs and revision references
5. **SEO metadata** — The plugin automatically generates OG tags from the title and excerpt, and the dynamic sitemap at `/sitemap.xml` picks up the new post within seconds
6. **Cross-posting** — After publication, the same post can be syndicated to Dev.to via the `devto-publisher.py` script
7. **Calendar tracking** — The content calendar is updated with LIVE status and publish timestamps
Architecture Overview
The data flow breaks down into three layers:
```
┌─────────────────────────────────────────────────────┐
│ Cron Layer │
│ Mon/Wed/Fri 6AM → queue-publisher.py │
│ Any hour → LLM generation → queue file │
└────────────────────┬────────────────────────────────┘
│ queue JSON
▼
┌─────────────────────────────────────────────────────┐
│ Application Layer │
│ blog-publisher.py → rewrite Portable Text → D1 │
│ devto-publisher.py → Dev.to API → cross-post │
└────────────────────┬────────────────────────────────┘
│ D1 insert
▼
┌─────────────────────────────────────────────────────┐
│ Data Layer │
│ ec_posts (D1) → EmDash content API │
│ sitemap.xml (dynamic) → /llms.txt, /llms-full.txt │
│ ec_posts → blog listing, reading time, TOC │
└─────────────────────────────────────────────────────┘
```
Key Design Decisions
**1. No rebuild required.** Unlike static site generators that require a full build-and-deploy cycle, D1 inserts are immediately live. The blog listing, sitemap, LLMS.txt, and SEO tags all query D1 at request time — no CI/CD wait.
**2. Portable Text as interchange format.** The script converts markdown body text to Sanity-style Portable Text JSON (`_type: block`, `_type: span`, `marks: ["strong"]`). This means the plugin can render the same content through EmDash's content API without format conversion.
**3. Slug collision prevention.** Before writing body_text for a new post, the system computes the D1 slug using `slugify()` (lowercase, strip punctuation, spaces-to-hyphens) and checks D1 for an existing match. This prevents UNIQUE constraint errors at publish time.
**4. Recoverable queue.** Failed or colliding posts are archived with timestamps, not deleted. The `published/` directory accumulates a full history, and orphan detection compares published file counts against D1 row counts.
Results
The Auto Blog/SEO plugin has produced **580 published posts** on ai-kit.net with the following metrics:
| Metric | Value |
|--------|-------|
| Total published posts | 580 |
| Avg post length | 800-1500 words |
| Content categories | 4 (Content & Growth, Marketing Automation, Sales Channel, Product Launch) |
| Projects covered | AIKit EmDash, PlayableAd Studio, CCFish, DeFiKit |
| Publish cadence | Every 6 hours (4x daily) |
| Human intervention | Zero (full autonomy) |
| Monthly content volume | ~120 posts |
| Infrastructure cost | ~$0 (Cloudflare free tier + Workers Free plan) |
Key Takeaways
- **Pipeline automation is the unlock** — removing human handoffs from topic-to-publication eliminates the 4-day cycle bottleneck. The entire flow runs in under 60 seconds end to end.
- **Serverless is ideal for content pipelines** — D1 inserts are instant and free. Workers handle HTTP routing with zero cold-start penalty in this use case.
- **LLMs replace the writer (and the editor)** — with good prompt engineering and multi-pass generation, LLM output meets the 800-word minimum with proper structure, code examples, and actionable takeaways.
- **Calendar + queue + cron = autonomous publishing** — the three-component system (calendar for planning, queue for staging, cron for execution) creates a reliable, auditable pipeline that can run indefinitely.
- **OG tags and sitemaps must be dynamic** — if your CMS auto-generates these from D1 at request time instead of baking them at build time, new posts are discoverable seconds after publication, not after the next deploy.