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
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 is | Consequence |
|---|---|---|
| Code selects every next step from declared conditions | A workflow (class 2) | Output-level testing; workflow controls |
| A model selects the next step inside one responsibility | A bounded agent (class 3) | Envelope, agent identity, trajectory evaluation (bounded agent) |
| Code sequences several separately owned agents | A 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):
| Class | Predictability | Latency | Cost per task | Test effort | Attack surface | Typical additions to the control bundle |
|---|---|---|---|---|---|---|
| 0 single call | High | Low | Low | Low | Low | Gateway, output filters |
| 1 grounded answer | High | Low–medium | Low | Medium | Medium (indirect injection via documents) | Permission-aware retrieval, citation checks |
| 2 workflow | High | Medium | Medium | Medium | Medium | Step validation; human checkpoints where needed |
| 3 bounded agent | Medium | Medium–high | Medium–high | High | High | Tool policy, agent identity, budgets, trajectory evaluation |
| 4 multi-agent | Low–medium | High | High | Very high | Very high | Agent 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.
| Code | Pattern | Use when | Forces | Trade-off | Factory note |
|---|---|---|---|---|---|
| WF-CHAIN | Prompt chaining with programmatic gates | The task splits cleanly into fixed steps | Accuracy per step vs end-to-end latency | Rigid; latency adds up | Each gate is a test the shared evaluation harness runs in CI |
| WF-ROUTE | Routing: a classifier sends input to a specialised handler or model | Distinct input categories need different handling | Specialisation vs misroute risk | Misroutes need a fallback path and a human queue | Core of recipe family 5; the router’s confusion matrix is an evaluation signal |
| WF-PAR-SECT | Parallelisation by sectioning | Independent subtasks, or a guardrail beside the main call | Throughput vs aggregation complexity | Aggregation is code that must be tested | The usual way to run an output guardrail without adding latency |
| WF-PAR-VOTE | Parallelisation by voting | Higher confidence needed (vulnerability or compliance screening) | Confidence vs cost | Cost multiplies with voters | Code tallies the votes; thresholds are declared in the recipe, not a prompt |
| WF-ORCH | Orchestrator–workers: a model decomposes, workers execute, results synthesised | Subtasks are not known in advance | Flexibility vs testability | Borders on agentic; harder to test | Requires an ADR stating why WF-CHAIN will not do; often the first step of agency creep |
| WF-EVAL | Evaluator–optimiser loop | Clear quality criteria and iteration measurably helps | Quality vs cost and termination | Needs exit conditions and an iteration cap | The evaluator’s rubric is a catalogue asset, calibrated against human labels |
| WF-HITL | Human approval checkpoint | High-stakes, subjective or regulated decisions | Accountability and contestability vs throughput | Needs a task inbox, a service level and a named approver | Enforced by the workflow, never requested by the prompt; the controlled-execution rung made concrete |
| WF-PIPE | Document or data pipeline with model steps | Extraction, classification, enrichment at volume | Volume vs per-item certainty | Batch-oriented; error queues required | Core 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
- Make every stage and branch explicit in the recipe. Each stage has an input/output contract (usually MI-STRUCT schemas) and a test.
- Put limits outside the model. Retries, timeouts, iteration caps, termination conditions and spend limits are workflow configuration, not instructions in a prompt.
- 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.
- 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).
- Record every routing outcome, vote, gate result and approval as evidence (audit evidence), and review misclassification and failure queues on a schedule.
- 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):
| Code | Pattern | Who decides the next step | Workflow-style control |
|---|---|---|---|
| MA-SEQ | Sequential pipeline of agents | Code | The shape of a department process once its stages are stable |
| MA-CONC | Concurrent fan-out / fan-in | Code | Merge logic is code; disagreements are surfaced, not averaged away |
| MA-LOOP | Generator–critic loop | Code | Iteration 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) | |
|---|---|---|
| Move | The stable hot path of an agent becomes a workflow or rules | A procedural system hands its exceptions to an agent |
| Trigger | Trajectory traces show the same tool sequence in most runs over a sustained period | Exception queues with high manual effort and varied resolution paths |
| Forces | Cost and predictability vs residual flexibility | Relief of manual effort vs new agency in an old process |
| Controls | Replay tests confirm equivalence before the switch; the agent remains for residual cases; the change is an ADR | The agent starts at a low rung (see source difference below); results return through typed interfaces |
| Why | Lower cost, higher predictability, smaller test surface; the move that pays | A legacy platform joins the estate without being rewritten |
Procedure: codify a stable agent path (IN-CODIFY)
- 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.
- 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.
- Build the workflow (WF-CHAIN or WF-PIPE) for the hot path, with stage contracts and tests.
- Replay recorded cases through the new workflow and compare outcomes with the agent’s. Do not switch until equivalence is shown.
- Route the hot path to the workflow; keep the agent, inside its existing envelope, for residual cases. Narrow the agent’s envelope accordingly.
- 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)
- Select an exception queue with high manual effort and varied resolution paths.
- Wrap the legacy system behind typed interfaces (IN-FACADE) so the agent never acts through screens or raw credentials.
- Register the agent with its own envelope, identity and wrangler (agent lifecycle).
- Start low: read-only or draft. Results go back to the procedural system through the typed interface, where existing controls apply.
- 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.
| Question | Setting |
|---|---|
| Actor | agent-servicedesk-triage-001, with a registered owner |
| Mandate | Three 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 |
| Means | Agent identity scoped to Now Assist read/write on the three queues only; no access to change management or CMDB write APIs |
| Memory | Read 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 |
| Monitoring | Every 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
| Pillar | What Bank A configured |
|---|---|
| Identity | Agent identity with a sponsor lifecycle workflow (the wrangler is sponsor); a dedicated conditional-access policy |
| Network | Deny-by-default egress; three FQDNs allow-listed (the ticketing tenant, the inference endpoint, the bank’s identity provider) |
| Security | AI security-posture monitoring; three custom prompt-injection detections in the SIEM |
| Compute | Hosted agent runtime in an EU region; the provider runs the OS, the bank runs contract operations |
| Data | Ticket sensitivity label read before each action; session state kept 30 days at C2, zero at C3 or above |
| Integration | Ticketing connector registered in API management; model connector brokered through the MCP gateway |
| Observability | Evidence records to the monitoring platform; weekly evidence pack reviewed by the wrangler |
| Governance | A policy initiative enforces the Mandate at deployment; exceptions go to the virtual CAB |
| Automation | Envelope shipped through the standard infrastructure-as-code pipeline; OIDC-federated deployment identity |
| AI platform control | Agent 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:
- It states a principle that survives a change of vendor.
- It names trade-offs, not only benefits.
- It maps to a component someone can build or audit.
- Any numbers come with a method.
- 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
| Failure | Recognise it | Recover |
|---|---|---|
| Approval requested by prompt | The model is told to “wait for sign-off”; no workflow state blocks execution | Make the approval a workflow state that needs an approval record |
| Agency creep through WF-ORCH | A model starts choosing subtasks with no ADR; test suites stop covering the paths | Require the ADR; if paths can be enumerated, revert to WF-CHAIN |
| Unbounded evaluator loop | WF-EVAL or MA-LOOP runs with no cap; cost spikes | Declare iteration and cost caps in the recipe; enforce outside the model |
| Routes in prompts | Changing a destination needs a prompt release | Move destinations to a business-owned rule table |
| Votes counted by a model | A model “summarises” the voters’ verdicts | Code tallies; thresholds declared in the recipe; every ballot kept as evidence |
| Codification without replay | An agent replaced by a workflow on intuition; regressions in residual cases | Restore 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 controls | Re-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)
Related guidance
-
Choose the Shape of an AI ProductA least-agency decision sequence for choosing a product design: agency classes and their trade-offs, the eight questions, evidence for every step up, the consequence matrix that caps action scope, the cut-set review for agents, the other selection dimensions, and the design record. -
The Ten AI Product Recipe FamiliesThe ten recipe families and their design cards (flow, action scope, data classes, controls, evidence, evaluation, anti-patterns), how to fit a request and choose between neighbours, the pattern catalogue beneath them, the human duties each recipe must staff, who governs the catalogue, and the pipeline checks that catch family drift, families of one and orphans. -
Bounded-Agent PatternA class 3 agent lets a model choose the next step, but only inside a registered, validated and enforced envelope of Mandate, Means, Memory and Monitoring. -
Agent-Driven DepartmentsWhat an Agent-Driven Department is and how to test for one, the six-system stack it runs and the order to build it, the measured agent share, and the consolidation boundary: what moves into the department, what stays with the CISO, CRO, DPO and the business, and the order in which to move it. -
The Agent-Speed SDLCA committed artefact chain, governed context, trusted tests and eight SDLC controls that let coding agents work quickly while intent, review, identity and evidence stay connected. -
Evaluate, Assure and Test Agent ResilienceDefine a versioned evaluation contract, test the trajectory and the execution boundaries, run three assurance layers into one quarterly pack, map the OWASP Agentic Top 10 to controls that demonstrably fire, bring agents into threat-led penetration testing with a five-section scope, keep a continuous cadence between formal tests, land every finding as a live control-plane artefact, and engineer recovery down to a minimal AI service level on models you host. -
The Enterprise Agent Control PlaneThe firm-owned services that make every agent action identifiable, decidable, approvable and reconstructable: the ownership boundary, six planes and their contracts, the Policy Decision API with its latency budget, the persistence schema, the build sequence and the tests that show it works. -
Build a Unified Control MapJoin the firm's AI and technology controls in one traceable operating view: rows are operating concerns, columns are frameworks read at their own altitude, every cell points to live evidence, and existing ITIL, COBIT and CIS artefacts are extended to agents with a five-question test instead of a parallel AI governance track. -
Operate the Agent LifecycleInventory, register, sign, zone, review, suspend, recover and retire agents through a six-stage lifecycle with named human ownership, zone-specific authority and evidence at every transition. -
Design and Operate the Model GatewayBuild the model gateway as the governed edge for every model call: per-client identity, per-request highest-class routing, tokenisation, pinned models, a conformant wire contract, a correlated evidence record, a tested concentration answer, and day-two cost, latency and reliability operations across two estates and three meters.