Originally published at parvejshah.com/blog/deterministic-multi-agent-systems-production by Parvej Shah.
The interesting engineering problem in an automated content pipeline for Minions.AI — a trade-contractor content engine — turned out not to be agent orchestration. It's not really about "researcher" and "writer" agents arguing in a loop, or a fragile hand-off protocol between them. The problem that actually mattered in production was narrower and more dangerous: stopping the pipeline from confidently publishing something false.
The Real Pipeline
Every draft moves through four Qwen (DashScope) model calls, each sized to what the stage actually needs rather than running a flagship model end to end:
| Stage | Model | Why |
|---|---|---|
| Strategist | qwen3.7-max |
Highest-leverage reasoning step — angle, audience fit, positioning. Errors here propagate through the whole draft, and the output is short, so flagship cost is negligible. |
| Writer | qwen-plus |
Long-form generation (700–1000 words). Highest token volume of the four calls, so this is where cost tier matters most. |
| Editor | qwen3.7-flash |
A bounded task — tighten prose, enforce style, and extract + classify every factual claim in the draft. |
| Variants | qwen-flash |
Reformatting already-finished copy for LinkedIn and Facebook — no new reasoning needed. |
This runs as an n8n workflow, not a hand-rolled orchestrator: a scheduled harvester proposes ideas twice a week, and a webhook-triggered pipeline runs each one through the four stages above, generates a hero image, uploads it to Cloudflare R2 before the image host's signed URL expires, and either publishes or gates the result.
The Claims Gate
The Editor stage doesn't just tighten prose — it extracts every factual claim in the draft and classifies it: STATISTIC, FACT, MARKET_CLAIM, PRODUCT_CLAIM, OPINION, or CUSTOMER_RESULT. Each claim then needs a source URL to pass.
One rule is hardcoded, not a judgment call: any claim classified CUSTOMER_RESULT is blocked outright. Not "flagged for review" — blocked. The reasoning is stated plainly in the pipeline's own documentation: the business has zero paying clients as of this writing, so any claim about a customer result would be fabricated by definition. There's no result to attribute yet, so the gate doesn't let the pipeline invent one.
Unsourced statistics, facts, and market claims are blocked too, unless they carry a real source URL. Opinion claims pass without a source — they're not verifiable by nature and aren't gate-relevant.
Enforcement, Not Just Reporting
The gate isn't a lint warning that a human can shrug off — it runs in two places:
- Inline, during generation. If the claims gate doesn't pass, the asset skips straight past the auto-publish step instead of going live to the blog and Facebook Page.
- Again in a separate review-publisher workflow, which polls the database every 5 minutes for anything a human has since approved manually in the review dashboard, and republishes it through the same gated path — so a claim can't sneak through by a human reviewer overriding the wrong field.
Either path leaves anything that isn't cleanly passed in a BLOCKED_PENDING_REVIEW state rather than live on the site.
What This Buys
This doesn't solve "AI agents coordinating AI agents" in some general sense — there's no elaborate retry protocol or critic-agent handshake here, and there doesn't need to be. It solves the one failure mode that actually matters for a marketing content pipeline running largely unattended: don't let the system say something happened for a customer when nothing has happened yet. Everything else — tone, structure, formatting — can be imperfect and get caught in review. A fabricated customer result is the one mistake that isn't safe to publish and fix later.
Parvej Shah is a Lead Full-Stack Web Developer & Platform Architect based in Dhaka, Bangladesh. Explore full architecture case studies and production code at parvejshah.com.
Top comments (1)
I have created a programming language named Hyperlambda. It's got some nifty tricks related to "determinism". Arguably the only deterministic AI PL that exists. I'd love some feedback about it from somebody who obviously shares the same philosophy about security and AI generated code ... :)