Browse the reference ⌄
Pattern published

Workflow Pattern

Use a workflow when code can determine the next step, even when some steps call a model: the eight workflow patterns with their forces and factory notes, why class 2 is the default, how code-orchestrated multi-agent flows stay workflows, how to codify a stable agent path down or delegate exceptions up, and a composite service-desk triage example read across frameworks and cloud pillars.

Version
0.2.0
Owner
DEIXEI
Last reviewed
Reading time
16 min

For Ai Architect · Platform Engineer · Product Leader · Risk And Assurance · Internal Audit

Sources and details
Section
Patterns
Source works
Book 1 · Book 2 · Research Series
Source chapters
5, 20, 22, 23
Source appendices
02:C
Refresh trigger
source change

Full source list ↓ Source index →

Agency class 2. Code decides the next step. A workflow may call one or more models, but no model controls the process flow. This is the class where most regulated AI products should live, and the one the least-agency rule sends you to first (source claim, Book 2 App C C.6).

The control-flow test

Classify a design by who decides the next step, not by how many model calls it makes or what a vendor diagram calls it.

If…It isConsequence
Code selects every next step from declared conditionsA workflow (class 2)Output-level testing; workflow controls
A model selects the next step inside one responsibilityA bounded agent (class 3)Envelope, agent identity, trajectory evaluation (bounded agent)
Code sequences several separately owned agentsA workflow whose stations are agents (class 4 by ownership)Workflow predictability, plus class 4 identity and registry controls (below)

Why it matters. Call a workflow an agent and you take on the agent’s test burden for no benefit. Call an agent a workflow and you ship an unbounded loop with a workflow’s controls. The label decides which control bundle attaches, whether trajectory evaluation is required, and whether an agent identity is needed at all (author position, Book 2 Ch 22 §4.3–§4.4, where calling a code-sequenced flow an agent pattern is said to license agency creep).

Vendor vocabulary differs; this page follows the control-flow test. Anthropic draws the workflow/agent line where this page does: predefined code paths versus model-directed processes. Google Cloud’s pattern guide lists code-orchestrated sequential, parallel and loop flows among agent patterns; under the control-flow test they are workflows. Microsoft lists sequential orchestration among its multi-agent patterns (Book 2 App C C.12; Paper 2 §5.10). As of November 2026, per Book 2 App C C.12. [FACT-CHECK: vendor guides are revised without version numbers; re-check the current Anthropic, Microsoft Learn and Google Cloud pages before quoting their terms.]

Use this pattern when

  • The task has a sequence, routing rule or checkpoint that can be written as code.
  • The branches can be enumerated, even if there are many.
  • You need branches, stopping points and approval gates that can each be tested.

Do not use it when the path genuinely cannot be enumerated and the work is one coherent responsibility; that is a bounded agent, justified in the design record with a path analysis showing combinatorial branching (product-shape guide).

Why class 2 is the default

Research Paper 1 rates the classes qualitatively (author’s assessment, §7.3):

ClassPredictabilityLatencyCost per taskTest effortAttack surfaceTypical additions to the control bundle
0 single callHighLowLowLowLowGateway, output filters
1 grounded answerHighLow–mediumLowMediumMedium (indirect injection via documents)Permission-aware retrieval, citation checks
2 workflowHighMediumMediumMediumMediumStep validation; human checkpoints where needed
3 bounded agentMediumMedium–highMedium–highHighHighTool policy, agent identity, budgets, trajectory evaluation
4 multi-agentLow–mediumHighHighVery highVery highAgent registry, inter-agent authorisation, replay testing, kill switch

The test-effort column is the one that breaks plans: between class 2 and class 3, the thing under test changes from an output to a trajectory. The class 4 row describes model-orchestrated designs; a class 4 design sequenced in code sits closer to class 2 on predictability and test effort while keeping class 4’s identity and registry controls.

The eight workflow patterns

Names for the first six codes follow Anthropic’s guide (five Anthropic patterns, with parallelisation split into sectioning and voting); WF-HITL maps to Google Cloud’s human-in-the-loop term. Forces, trade-offs and factory notes are from Book 2 App C C.6 and Paper 1 Appendix A.4.

CodePatternUse whenForcesTrade-offFactory note
WF-CHAINPrompt chaining with programmatic gatesThe task splits cleanly into fixed stepsAccuracy per step vs end-to-end latencyRigid; latency adds upEach gate is a test the shared evaluation harness runs in CI
WF-ROUTERouting: a classifier sends input to a specialised handler or modelDistinct input categories need different handlingSpecialisation vs misroute riskMisroutes need a fallback path and a human queueCore of recipe family 5; the router’s confusion matrix is an evaluation signal
WF-PAR-SECTParallelisation by sectioningIndependent subtasks, or a guardrail beside the main callThroughput vs aggregation complexityAggregation is code that must be testedThe usual way to run an output guardrail without adding latency
WF-PAR-VOTEParallelisation by votingHigher confidence needed (vulnerability or compliance screening)Confidence vs costCost multiplies with votersCode tallies the votes; thresholds are declared in the recipe, not a prompt
WF-ORCHOrchestrator–workers: a model decomposes, workers execute, results synthesisedSubtasks are not known in advanceFlexibility vs testabilityBorders on agentic; harder to testRequires an ADR stating why WF-CHAIN will not do; often the first step of agency creep
WF-EVALEvaluator–optimiser loopClear quality criteria and iteration measurably helpsQuality vs cost and terminationNeeds exit conditions and an iteration capThe evaluator’s rubric is a catalogue asset, calibrated against human labels
WF-HITLHuman approval checkpointHigh-stakes, subjective or regulated decisionsAccountability and contestability vs throughputNeeds a task inbox, a service level and a named approverEnforced by the workflow, never requested by the prompt; the controlled-execution rung made concrete
WF-PIPEDocument or data pipeline with model stepsExtraction, classification, enrichment at volumeVolume vs per-item certaintyBatch-oriented; error queues requiredCore of recipe family 4; human-review sampling rate set by risk tier

Three recipe families are built mainly from these patterns: the document processing pipeline (4), the classification and triage router (5) and the review and compliance checker (6). Their full design cards are on the recipe catalogue.

Design and controls

  1. Make every stage and branch explicit in the recipe. Each stage has an input/output contract (usually MI-STRUCT schemas) and a test.
  2. Put limits outside the model. Retries, timeouts, iteration caps, termination conditions and spend limits are workflow configuration, not instructions in a prompt.
  3. Keep routing deterministic after classification. A model assigns labels from a fixed set; a business-owned rule table maps labels to destinations, so a route change never needs a prompt change.
  4. Enforce approval in the workflow. A prompt asking the model to wait for approval is a suggestion; a workflow state that cannot advance without an approval record is a control. Staff the approver with hours (see human duties).
  5. Record every routing outcome, vote, gate result and approval as evidence (audit evidence), and review misclassification and failure queues on a schedule.
  6. Test the whole route, including refusal, fallback, timeout and human-queue paths. Keep tests independent of the agent-generated change they judge (agent-speed SDLC).

Acceptance checks. Every branch has a test; every loop has a cap declared in the recipe; every approval point is a workflow state with a named approver role and a service level; misroute and human-triage rates are reported as a pair; WF-ORCH appears only with an ADR.

Multi-agent flows that are still workflows

Three multi-agent patterns are orchestrated by code (Book 2 App C C.8; Paper 1 Appendix A.6):

CodePatternWho decides the next stepWorkflow-style control
MA-SEQSequential pipeline of agentsCodeThe shape of a department process once its stages are stable
MA-CONCConcurrent fan-out / fan-inCodeMerge logic is code; disagreements are surfaced, not averaged away
MA-LOOPGenerator–critic loopCodeIteration and cost caps declared in the recipe

They keep most of a workflow’s predictability and test effort. They are still class 4 because they contain several separately owned identities, so the agent registry, authorisation between agents, replay testing and a kill switch per agent apply however the sequence is decided. Patterns where a model decides (MA-HANDOFF, MA-SUPER, MA-HIER, MA-GROUP, MA-MAGENTIC, MA-SWARM, MA-DYNSEL) are not workflows; see the recipe catalogue. MA-SWARM is not used for regulated processes.

The department process: a workflow whose stations are agents

The agent-driven department process (recipe family 10) is the largest workflow in the catalogue (source claim, Book 2 Ch 20 §5.5, Ch 23 §5.3):

  • Process state lives in a durable workflow, never inside an agent. That lets you swap, version or scale any agent on its own, and it means each transition is logged against the identity and version of the agent responsible.
  • Approvals are workflow states. Separation between the preparing agent and the executing agent sits in the deterministic layer.
  • Stable stages first. Assemble the process only after each stage has run stably as a lower-class family (pipeline, checker, bounded agent). A process whose stages have never run alone fails where you have least evidence.

Stack, team shape and further rules: agent-driven departments.

Move work between agentic and procedural forms

A design’s shape is not permanent. Translocation moves a workload between agency classes deliberately, in both directions, on evidence (source claim, Book 2 Ch 22 §4.6, App C C.9; Paper 1 §5.2, which credits the idea to QuantumBlack’s description of its agent-estate architecture).

IN-CODIFY (down)IN-DELEGATE (up)
MoveThe stable hot path of an agent becomes a workflow or rulesA procedural system hands its exceptions to an agent
TriggerTrajectory traces show the same tool sequence in most runs over a sustained periodException queues with high manual effort and varied resolution paths
ForcesCost and predictability vs residual flexibilityRelief of manual effort vs new agency in an old process
ControlsReplay tests confirm equivalence before the switch; the agent remains for residual cases; the change is an ADRThe agent starts at a low rung (see source difference below); results return through typed interfaces
WhyLower cost, higher predictability, smaller test surface; the move that paysA legacy platform joins the estate without being rewritten

Procedure: codify a stable agent path (IN-CODIFY)

  1. Owner (this page’s recommendation): the agent’s wrangler proposes; the pattern arbiter rules on the ADR. The sources require only that the change is an ADR.
  2. Evidence: pull trajectory data from the trace store for a sustained window and identify the dominant tool sequence and its share of runs. Trajectory evaluation is what makes this a finding rather than a guess. Book 2 and Paper 1 give no numeric threshold for “most runs” or “sustained”; set and record your own in the ADR.
  3. Build the workflow (WF-CHAIN or WF-PIPE) for the hot path, with stage contracts and tests.
  4. Replay recorded cases through the new workflow and compare outcomes with the agent’s. Do not switch until equivalence is shown.
  5. Route the hot path to the workflow; keep the agent, inside its existing envelope, for residual cases. Narrow the agent’s envelope accordingly.
  6. Record the ADR, the replay results and the updated classification lines of both components.

Acceptance: the replay comparison is attached to the ADR; the agent’s envelope and tool list were narrowed; cost per task and exception rate are tracked before and after.

Procedure: delegate exceptions to an agent (IN-DELEGATE)

  1. Select an exception queue with high manual effort and varied resolution paths.
  2. Wrap the legacy system behind typed interfaces (IN-FACADE) so the agent never acts through screens or raw credentials.
  3. Register the agent with its own envelope, identity and wrangler (agent lifecycle).
  4. Start low: read-only or draft. Results go back to the procedural system through the typed interface, where existing controls apply.
  5. Widen the scope only on replay evidence, as for any agent.

Source difference. Book 2 App C C.9 starts IN-DELEGATE agents at the advisory rung, read-only or draft. Paper 1 §5.2 allows draft or act-with-approval scope from the start, and Book 2 Ch 22 §4.6 says “draft or approval mode”. This page follows the stricter Appendix C reading (read-only or draft) as the default, and treats act-with-approval as a step that needs its own evidence.

Composite example: a service-desk triage agent read across frameworks and pillars

Composite scene (Bank A, a composite Tier 1 universal bank, Q1 2025; Book 1 Ch 5 §6). Product names are Book 1’s and are dated. [FACT-CHECK: verify every named Microsoft and ServiceNow product, preview status and capability against current vendor documentation.]

The agent. agent-servicedesk-triage-001, built on Microsoft Copilot Studio with ServiceNow Now Assist as the back end. It handles the first 90 seconds of each ticket: classify, deduplicate, draft a reply for password-reset-class issues, otherwise hand to a human analyst. The wrangler sits in service-desk leadership.

The five-question envelope (Book 1 Ch 5 §5)

Agents become a third asset class beside hardware and software. The test was run in a forty-minute session with the wrangler, the COBIT BAI09/BAI10 objective owner and the CIS Control 1 owner.

QuestionSetting
Actoragent-servicedesk-triage-001, with a registered owner
MandateThree queues (workplace tech, identity, basic application access). Classify, deduplicate, draft. Resolve only password-reset and known-workaround sub-classes. Never close an escalated ticket. Never write to a ticket touching a regulated business process. Any agent action revertible by an analyst within 24 hours
MeansAgent identity scoped to Now Assist read/write on the three queues only; no access to change management or CMDB write APIs
MemoryRead the past 90 days of tickets for deduplication; write only its own draft replies; no cross-session retention of user-identifying content beyond the ticket
MonitoringEvery action emits an Audit Evidence Schema record; weekly drift evaluation on a held-out sample; human escalation if first-contact resolution falls below 70% week-on-week, or if any deduplication merges tickets across the regulated-process boundary

Two rules govern the test (author preference in Book 1): the answers are written down before the agent ships, and a single action that fails any of the five questions is treated as incident territory even with no operational impact.

The same envelope on the ten cloud pillars

PillarWhat Bank A configured
IdentityAgent identity with a sponsor lifecycle workflow (the wrangler is sponsor); a dedicated conditional-access policy
NetworkDeny-by-default egress; three FQDNs allow-listed (the ticketing tenant, the inference endpoint, the bank’s identity provider)
SecurityAI security-posture monitoring; three custom prompt-injection detections in the SIEM
ComputeHosted agent runtime in an EU region; the provider runs the OS, the bank runs contract operations
DataTicket sensitivity label read before each action; session state kept 30 days at C2, zero at C3 or above
IntegrationTicketing connector registered in API management; model connector brokered through the MCP gateway
ObservabilityEvidence records to the monitoring platform; weekly evidence pack reviewed by the wrangler
GovernanceA policy initiative enforces the Mandate at deployment; exceptions go to the virtual CAB
AutomationEnvelope shipped through the standard infrastructure-as-code pipeline; OIDC-federated deployment identity
AI platform controlAgent registered with the wrangler as named owner, bound to the envelope, every action routed through runtime guardrails

The three framework artefacts

One envelope produced one short extension per framework altitude, each attached to the existing artefact rather than replacing it: an AI-extended ITIL Service Configuration Management practice statement (two paragraphs), AI-extended COBIT BAI09/BAI10 objective statements (one page each, referencing the model usage registry schema), and an AI-extended CIS Control 1.1 safeguard note (two sentences plus a reference to the agent inventory schema). The framework-to-pillar mapping is on the control map.

In Book 1’s composite, a national supervisor’s on-site team later recorded that the evidence chain ran directly from policy-as-code to runtime telemetry with named accountability at each step.

Reading it with the factory taxonomy (this page’s analysis)

Book 1 calls this an agent. Under the control-flow test and the recipe families it is mostly a classification and triage router (family 5): classify, deduplicate and route, with a fixed set of queues and a deterministic hand-off to analysts. Two parts go beyond a router: drafting replies (a content-assistant step inside the flow) and resolving password-reset and known-workaround tickets. The neighbour rule says take the router unless resolution is genuinely in scope; here a narrow slice of resolution is. Two defensible designs follow:

  • Router plus a bounded resolution step. Keep routing as a class 2 workflow with a rule table, and send only the two resolvable sub-classes to a small, separately enveloped resolution step with its own evaluation. Resolution becomes a destination in the rule table.
  • One bounded agent. Keep the single agent, but then it needs the family 8 pack: tool allow-list split read from write, budgets, approval or revert path, kill switch, trajectory evaluation.

What the composite already does right: the 24-hour revert path, the regulated-process exclusion, and a monitoring trigger tied to a measured rate. What to add if you build it: per-label precision and recall, the misroute rate paired with the human-triage share, and a rule that regulatory or complaint language always escalates (family 5 card). Book 1 does not discuss these; they come from the recipe catalogue.

Reading vendor reference architectures

When adopting a vendor or consultancy pattern, separate substance from marketing with the author’s five tests (Book 2 Ch 22 §4.4). An element survives if it passes at least three:

  1. It states a principle that survives a change of vendor.
  2. It names trade-offs, not only benefits.
  3. It maps to a component someone can build or audit.
  4. Any numbers come with a method.
  5. It is consistent with independent sources.

Brand names, unqualified impact percentages and product lists fail all five. Then re-label what survives with the control-flow test before it enters the catalogue.

Escalate only when needed

Stay at class 2 while code can select the next step from declared conditions. Move to a bounded agent only when the path cannot reasonably be enumerated and one coherent responsibility can be kept inside an explicit envelope, and record the rejected lower classes in the design record (product-shape guide). Then watch the trajectories: when they settle into one path, codify it back down.

Author view: many systems called “agents” are workflows with model calls. Name them by their control flow; that makes their behaviour easier to test and govern.

Failure modes and recovery

FailureRecognise itRecover
Approval requested by promptThe model is told to “wait for sign-off”; no workflow state blocks executionMake the approval a workflow state that needs an approval record
Agency creep through WF-ORCHA model starts choosing subtasks with no ADR; test suites stop covering the pathsRequire the ADR; if paths can be enumerated, revert to WF-CHAIN
Unbounded evaluator loopWF-EVAL or MA-LOOP runs with no cap; cost spikesDeclare iteration and cost caps in the recipe; enforce outside the model
Routes in promptsChanging a destination needs a prompt releaseMove destinations to a business-owned rule table
Votes counted by a modelA model “summarises” the voters’ verdictsCode tallies; thresholds declared in the recipe; every ballot kept as evidence
Codification without replayAn agent replaced by a workflow on intuition; regressions in residual casesRestore the agent route; run replay comparison; record the ADR
A workflow labelled an agent (or the reverse)Agent identity and trajectory evaluation bought for a fixed flow, or a loop shipped with workflow controlsRe-classify with the control-flow test and re-attach the right pack

Source notes

  • Workflow pattern names follow Anthropic’s guide, multi-agent names follow Microsoft’s and Google Cloud’s (Book 2 App C, opening and C.12).
  • The trade-off matrix is the author’s qualitative assessment (Paper 1 §7.3), not a measurement.
  • The Bank A service-desk example is a composite (Book 1 Ch 5 §6); its re-reading against the recipe families is this page’s analysis, not Book 1’s.
  • Article-level regulatory anchors for the ten pillars are not restated here; see the regulatory map.

Source material

  • Book 2 (The AI Delivery Factory), Appendix C, The Pattern Catalogue (C.6 workflow patterns; C.8 multi-agent patterns; C.9 translocation; C.12 practitioner guides)
  • Book 2, Chapter 22, The Shape of an AI Product (§4.4 what the published reference architectures agree and disagree about; §4.6 translocation)
  • Book 2, Chapter 23, The Ten Recipe Families (§5.1–§5.3 families 4, 5, 6 and 10)
  • Book 2, Chapter 20, Agent-Driven Departments (§5.5 department process rules)
  • Book 1 (Building Organizations for the Age of AI), Chapter 5, The Framework Backbone and the Cloud Control Plane (§4.2 ten capability pillars; §5 five-question test; §6 worked example)
  • DEIXEI Research Series, Working Paper 01, A Taxonomy for a Reuse-Driven AI Factory (§5.2 translocation; §7.3 trade-off matrix by agency class; Appendix A.4, A.6)
  • DEIXEI Research Series, Working Paper 02, Ten Solution Archetypes for Regulated Finance (§2.2 agency class; §5.4–§5.6, §5.10)

← All AI Delivery Factory guidance

On this page

  1. The control-flow test
  2. Use this pattern when
  3. Why class 2 is the default
  4. The eight workflow patterns
  5. Design and controls
  6. Multi-agent flows that are still workflows
    1. The department process: a workflow whose stations are agents
  7. Move work between agentic and procedural forms
    1. Procedure: codify a stable agent path (IN-CODIFY)
    2. Procedure: delegate exceptions to an agent (IN-DELEGATE)
  8. Composite example: a service-desk triage agent read across frameworks and pillars
    1. The five-question envelope (Book 1 Ch 5 §5)
    2. The same envelope on the ten cloud pillars
    3. The three framework artefacts
    4. Reading it with the factory taxonomy (this page’s analysis)
  9. Reading vendor reference architectures
  10. Escalate only when needed
  11. Failure modes and recovery
  12. Source notes

All pages in Patterns →