Building an Agent-Operated Content Pipeline
by Allan Hillman, AI Engineer & Solution Architect
Most AI content tooling gets the risk model backwards. It generates polished text and publishes it, then asks a human to catch mistakes after the fact. I wanted the opposite. On my own site, an agent can do the tedious 80 percent of drafting, but nothing reaches a reader until I have looked at it. The interesting engineering is not the generation. It is the gate.
The pipeline in one sentence
A topic goes in, a structured draft comes out as an unpublished entry in Contentful, and I review, edit, and publish it by hand. The agent never touches production. That single constraint shapes every other decision.
Structured output, not markdown parsing
Early on I had the model return markdown and I parsed it into the CMS rich-text format. That path is a bug factory. Headings, lists, and links all have edge cases, and a small formatting slip becomes a broken entry. So I moved the contract up front. The model returns a small JSON shape with typed blocks: paragraph, heading, list, quote. The script maps those blocks to Contentful rich-text nodes with zero guessing. Fewer moving parts, and the failure mode is a clear validation error instead of a silently mangled post.
A review gate you cannot skip
The script creates the entry and stops. It does not call publish. In Contentful, a created entry is a draft by default, so the safe behavior is also the default behavior. There is no flag to auto-publish, because the whole point is that a person signs off. The script prints the direct edit link and gets out of the way.
Guard the voice mechanically
Style rules that live only in a prompt drift. So the ones that can be checked are checked in code. Before anything becomes a draft, the spec is validated: the slug has to be clean, the body cannot be empty, and the text cannot contain an em-dash, which is my single most reliable tell for unedited machine text. If the guard trips, no draft is created. The prompt asks for the voice. The code enforces the part of it that is objective.
Why this reads as leadership, not novelty
The agent removes the boring part of writing without owning judgment.
The data model is the contract, so drafts are structurally valid or they do not exist.
The safe path is the default path, which is how automation earns trust.
Every layer fails loud, so a bad input is caught at the boundary, not by a reader.
None of this is exotic. It is a typed contract, a hard review gate, and a couple of guards that fail loud. That is the shape of AI systems I want in production: useful enough to lean on, bounded enough to trust.
Let the agent draft. Keep the publish button human.