Download PDF · Cloudnix: Agentic Workflows

Cloudnix Technical Report · CNX-TR-2026-05

Engineering Supervised Agentic Workflows

Jeya Kirubakaran, Ajmal Abubacker, Avinash KS and Avinash Nishant
Cloudnix Software Labs, Bengaluru, India
CNX-TR-2026-05 · Version 1.1 · November 2026
AbstractAgents that plan, call tools and write are easy to demonstrate and hard to run: in production they drift, loop, invent facts and links, overrun budgets and leave no auditable record. We describe the patterns behind agentic systems we operate: a stage-based editorial pipeline with bounded review rounds and human approval; cross-provider maker and checker roles; grounding in a shared rulebook and a verified fact list with link validation; map-reduce generation over whole knowledge bases under a strict time budget; schema-constrained extraction confirmed by people and reused; and per-call usage logging. We relate these to failure modes of production agents and to AI risk-management practice, and close with a case study and a checklist.
Keywords: AI agents; agentic workflows; LLM; human-in-the-loop; maker-checker; grounding; map-reduce; structured output; JSON Schema; cost control; AI governance

Contents
  1. Executive summary
  2. Failure modes of production agents
  3. A supervised pipeline
  4. Cross-provider maker–checker
  5. Grounding
  6. Map-reduce generation
  7. Schema-constrained extraction
  8. Budgets, logging and cost
  9. Security and safety
  10. Case study: an editorial engine
  11. Checklist: 15 questions
  12. References

Executive summary

Agents that plan, call tools and write are easy to demonstrate and hard to run. In production they drift, loop, invent facts and links, overrun budgets and leave no record anyone can audit. This report describes the patterns behind agentic systems we operate: an editorial pipeline in which agents brief, write, review, illustrate and publish under supervision; map-reduce generation pipelines that produce knowledge graphs, component maps, requirements and test cases from whole knowledge bases; and schema-constrained extraction confirmed by people. The common thread is supervision: stages with bounded retries, a different model provider checking each draft, a shared rulebook and verified facts, budgets in time and tokens, and a person at the gate.

Principles.
  1. Stages, not loops. Each job has a stage, a limit and a next step.
  2. The maker never checks itself. A different provider reviews.
  3. Ground every claim. A rulebook and a verified fact list bound what may be said.
  4. Structure every output. Schemas, not free text, cross system boundaries.
  5. Budget everything. Time per request, rounds per draft, tokens per call.
  6. Record everything. Every call logged with tokens and images; every decision kept.
  7. People decide. Nothing reaches the world without approval.

Failure modes of production agents

FailureSymptomPattern (chapter)
DriftQuality degrades over long runsStage pipeline with bounded retries (3)
Self-confirmationA model approves its own mistakesCross-provider maker–checker (4)
Hallucinated claimsInvented features, figures and linksRulebook, verified facts, link checks (5)
Context limitsKnowledge bases larger than any promptMap-reduce generation (6)
Unusable outputFree text breaks integrationsSchema-constrained extraction (7)
Runaway cost and latencyCallers time out; bills surpriseBudgets and usage logs (8)

A supervised pipeline

Ideabrief + outline Writingmaker Reviewchecker Approvala person Publishscheduled revise · up to 3 rounds per runreject → new brief · after 2 new briefs → needs a person
Stages, bounded loops and a person at the gate.

Each stage is a job with its own entry criteria. A run of the scheduler takes the first job that has work: a draft to fix, an idea sent back, or a new idea. The checker may approve, ask for revision or reject. Revision loops are capped at three rounds per run; an article that fails three runs returns to the idea stage for a new brief; an idea that fails after two new briefs is flagged for a person. Every article records its stage, the reason it is there and its history, so a board can show what is happening and why.

Scheduling

One job runs every three hours; publishing of approved work runs every five minutes. Long, unattended loops are not possible by construction.

Cross-provider maker–checker

Models share their own blind spots. The provider that writes is never the provider that reviews; the two swap roles each run. Roles are explicit per provider: maker (writes briefs and drafts), checker (scores against the rulebook) and a small model for image plans and photo selection. Over the period measured, 591 model calls were logged, 341 on one provider and 250 on the other [1, 2].

RoleTaskModel class
Makerbriefs, outlines, draftslarge model
Checkerreview against rules; approve, revise, reject with noteslarge model, other provider
Smallimage plans, photo choicesmall model

Grounding

Every agent reads the same configuration: a rulebook (83 rules, edited by the editorial team), a verified feature list that bounds what may be claimed, a calendar, writer personas and a library of real screenshots. Prompts include only the feature areas, help articles and screenshots nearest the brief; the shared part of the prompt is cached [3]. After generation, every link is checked against real pages and removed if it is not one.

Why a rulebook and not a longer prompt. Rules are edited by the people who own the output, kept in one place, and applied identically by maker and checker, so a correction made once applies to every later run.

Map-reduce generation

Generating a knowledge graph, a component map, requirements or test cases requires reading far more than one prompt holds. Marker fields on a request route it to one of five pipelines; each maps over retrieved chunks on local models, caching per chunk, then reduces on the provider the project chose (its own key, or ours).

map:    for chunk in retrieve(project, scope): notes[chunk] = cache or local_model(prompt_map, chunk)
reduce: result = provider.generate(prompt_reduce, notes)           # JSON, repaired if needed
budget: all attempts share 280 s; no new call with < 10 s left; 2 retries on 408/429/5xx

Pseudocode.

The budget keeps the whole request inside the caller's own timeout: one attempt may use all remaining time so long answers finish, and when too little remains the request ends with a clear error instead of overrunning.

Schema-constrained extraction

When output crosses into another system it must be structured. Import mapping asks a model to map source columns to destinations under a strict JSON Schema [4] with an enumerated set of ten display types and exactly one title; a person confirms or edits the result; the confirmed map is saved and reused by scheduled syncs without calling the model again.

{ "mappings": [ { "source_field": string,
                  "destination": "TITLE" | field_id | "NEW" | "SKIP",
                  "display_type": enum(10) } ] }       additionalProperties: false

Example exchange or schema.

Budgets, logging and cost

Security and safety

RiskControl
Prompt injection via retrieved contentContent treated as data; outputs checked before they act [5]
Unverified claimsVerified fact list; reviewer model; editor approval
Unsafe linksLinks checked against real pages
Key exposureKeys in server-side configuration with restricted permissions; masked in logs
Runaway spendBudgets, round limits, usage logs

The approach aligns with the governance functions of the NIST AI Risk Management Framework [6]: map, measure, manage and govern.

xAgent roles and responsibilities

Treating “the agent” as one entity hides where things go wrong. We separate roles, each with its own prompt, model class, inputs, outputs and failure handling.

RoleInputOutputOn failure
Ideatorsources list, calendar, verified featuresbrief and outline (JSON)new brief; flagged after two attempts
Writer (maker)brief, persona, rulebook, nearest contextstructured article blocksrevision with checker notes
Checkerdraft, rulebook, verified featuresapprove / revise / reject with notesreject returns to ideation
Image planner (small)approved textimage plan per sectiontext-only fallback
Photo selector (small)image plan, licensed photo searchchosen photos with creditsillustration instead of photo
Publisherapproved articlepost with category, tags, author, mediaretried on the next five-minute run

Why small models for small jobs

Image planning and photo choice are short, frequent decisions. Running them on small models reduces cost without touching the quality of the writing, which stays on large models.

xState and data model

Every unit of work is a record with a stage, the reason it is in that stage and an append-only history. This is what makes a pipeline inspectable: the board is simply a view of these records.

article = { slug, stage: idea | writing | review | approval | published | stuck,
            stage_note: "why it is here", persona, brief, draft_ref,
            history: [ { at, from, to, by: agent | person, note } ],
            usage:   [ { call_id, provider, model, role, tokens_in, tokens_out, images } ] }

Example exchange or schema.

ideawritingreviewapprovalpublishedstuck
Article states. Every transition is written to the history with who made it and why.

Concurrency

Each scheduler run takes one job and holds a lock on the article list, so two runs never edit the same article. The review page writes decisions to a separate file that the publisher applies, so a person's action and an agent's action never collide.

xPrompt design that survives change

Persona and voice

Writer personas define tone, habits, topics and a photo description. Personas never claim invented personal facts; the rulebook enforces this.

xQuality assurance for agent output

CheckWhereEffect
Rulebook compliancechecker modelrevise or reject with notes
Claims against verified featureschecker modelunsupported claims removed
Link validitydeterministic checknon-pages removed
Image suitabilitysmall model + rulesoff-topic or non-local images replaced
Title stylerulebookno colon titles, no title case clichés
Human approvaleditor on the boardpublish, back to writing, back to idea

Measuring the pipeline

Useful measures: share of drafts approved in the first round, average review rounds, ideas re-briefed, articles stuck, tokens per published article and time from idea to publication. Each is computed from the history and usage records without extra instrumentation.

xGeneration pipelines over knowledge bases

PipelineMarkerOutput
Knowledge graphgroup typetopics and relations across the project's knowledge base
Componentscomponent typeone level of modules, sub-modules or features
Requirementsgeneration typefeatures, each with child requirements, from selected documents
Test casesgeneration typetest cases for given requirements, keeping test-data variables
Image to markdownextraction typesemantic markdown from one image
retrievescope + querymap (local)cached per chunkreducechosen providerrepairvalid JSONresult
Map-reduce generation with a map cache and JSON repair.

Case study: an editorial engine

A content programme for a commerce platform, run by agents with an editor at the gate.

The engine produces illustrated articles in the voices of a small set of writer personas. Each article moves through idea, writing, review, approval and publishing; images mix generated illustrations, licensed photos with credits, diagrams and real screenshots, with the lead image rotating between seven kinds. At the time of writing the board held 23 ideas, 9 articles awaiting approval and 8 published.

What it changed

Content is produced continuously without the editor drafting; the editor's time goes into approvals and rules rather than first drafts; and every claim is bounded by the verified list.

Checklist: 15 questions

1Is every agent job a stage with an exit?
2Are retries capped?
3Does a different provider review?
4Is there one rulebook for maker and checker?
5Are claims bounded by a verified list?
6Are links validated?
7Is structured output enforced by schema?
8Does a person confirm new mappings?
9Is confirmed work reused instead of regenerated?
10Does every request have a time budget?
11Is every call logged with tokens?
12Are costs attributed per output?
13Is anything published without approval?
14Can a failing idea reach a person automatically?
15Who owns the rules?

xA worked run, end to end

The table follows one article through a real-shaped run. Token counts are illustrative; the sequence, roles and limits are those of the production pipeline.

#StepActorResultRecorded
1Pick jobscheduleroldest ready idealock taken
2Load contextsystemrulebook, persona, nearest feature areas and screenshotsprefix cache hit
3Draftmaker, provider Atyped blocks, ~1,200 wordstokens in/out
4Reviewchecker, provider Brevise: two notes (unsupported claim, title style)notes saved
5Redraftmaker, provider Anotes appliedtokens
6Reviewchecker, provider Bapprovestage → approval
7Imagessmall modelplan: hero infographic, two in-body photos, one diagramimages
8Linksdeterministicone link removed (not a real page)change logged
9Approvaleditorpublishdecision file
10Publishpublisher (5-min job)post with category, tags, author, featured imagepublished list

xDesigning the rulebook

A rulebook is code for language models: it should be specific, testable and owned. Rules that worked best were concrete and checkable.

Weak ruleStrong rule
Write engagingly600–900 words; one idea per paragraph; no more than one list per article
Be accurateMention only features in the verified list; never quote prices or numbers not in it
Good titlesNo colons; sentence case; no “The ultimate guide”
Use relevant imagesHero must match the topic; photos must show the target region; no text in generated images
Sound humanWrite in the persona’s voice; never invent personal facts for a persona

Every editor note that recurs becomes a rule; a previous version of the rulebook is kept so changes can be reviewed.

xFailure handling and recovery

FailureDetectionResponse
Provider timeout or 5xxHTTP statusretry within budget; otherwise leave job for next run
Rate limit (429)HTTP statusback off; retry within budget
Invalid structured outputschema validationJSON repair; else retry once
Checker rejectsdecisionnew brief; flag after two
Image fetch failsstatus / licence checkfall back to illustration
Publish failsCMS responseretried on next five-minute run
Run crashes mid-joblock agelock released; job resumes from last saved stage

xCost model

Cost per output = Σ over calls (tokens in × input price + tokens out × output price) + images × image price. Three levers matter most: caching the shared prefix (largest input saving), keeping review rounds low (each round adds a maker and a checker call) and using small models for small decisions.

cost(article) = Σ_calls ( in_tokens·p_in(model) + out_tokens·p_out(model) ) + images·p_img
rounds_effect ≈ (rounds − 1) × (cost(draft) + cost(review))

Example exchange or schema.

Usage records make each term observable per article, per provider and per role.

xGovernance

FunctionPractice
Governnamed owners for rulebook, facts and approvals
Mapstages, roles and their risks documented
Measurefirst-round approval, rounds, stuck items, cost per output
Managebudgets, limits, human approval, rollback of published items

xImplementation roadmap

PhaseOutcomeActivities
1. DiscoveryWork broken into stagesmap the process; define roles, outputs, approvals and limits
2. GroundingRules and facts in one placewrite the rulebook; compile verified facts; collect references
3. PilotOne pipeline live with a person at the gatemaker and checker on two providers; usage logging; a review board
4. ScaleMore pipelines, measuredbudgets, dashboards of rounds and cost, scheduled runs

xGlossary

Maker–checkerOne party produces, a different one reviews.
RulebookRules every agent follows, owned by people.
Verified factsThe only claims an agent may make.
Map-reduceProcess parts separately, then combine.
BudgetA hard limit on time, rounds or tokens.

References

  1. Anthropic. Claude API documentation: Messages and models.
  2. OpenAI. API reference: Responses and Chat Completions.
  3. Anthropic. Prompt caching, API documentation.
  4. JSON Schema. JSON Schema: Draft 2020-12.
  5. OWASP Foundation. OWASP Top 10 for Large Language Model Applications, 2025.
  6. NIST. Artificial Intelligence Risk Management Framework (AI RMF 1.0), 2023.
About this report. Prepared by the Cloudnix engineering team from systems we have designed, built and operated. Client and product names are withheld; illustrative values are marked as examples. Cloudnix Software Labs, Bengaluru, India · cloudnix.com. This report may be shared freely in its entirety.
Document control
ReportCNX-TR-2026-05Version1.1
IssuedNovember 2026StatusPublished
Filecloudnix-agentic-workflows-v1.1.pdf