Heaps' Law for Workflows: Why Configuration-Based Systems Are More Robust in the Age of Agentic Coding

Heaps' Law for Workflows: Why Configuration-Based Systems Are More Robust in the Age of Agentic Coding

Key Takeaways

  • In one week in November 2026, Microsoft 365, JPMorgan Chase and Apple's online services each had a major outage. Microsoft linked its outage to a network capacity upgrade and Apple to an internal update. AI is raising the volume of such changes: Google says 75% of its new code is now AI-generated.
  • In a configuration-based workflow system, a workflow is a chain of existing, tested actions. Changing it adds no new code unless a new kind of action is needed.
  • In our repository, the mean net code per workflow change fell from 966 lines in May to 145 in October, and about half of workflow changes since August have needed no code at all.
  • Heaps' law says the number of distinct words in a text grows more slowly than its length. Our vocabulary of actions grows the same way: about 2.6 × N^0.51 over N workflow steps (R² = 0.98 on eight points), close to the exponent of 0.5 typical of English text.
  • The rate at which workflows need a new action fell from about 35 per 100 steps to about 4. It has not reached zero, and Heaps' law predicts it keeps falling without reaching it.

In the week of November 12, 2026, Microsoft 365, JPMorgan Chase and Apple’s online services each had a major outage. Microsoft linked its outage to a network capacity upgrade, Apple to an internal update, and Chase to a software bug. None has been attributed to AI.

AI is now raising the volume of change. When an AI agent writes code, every change can introduce anything code can express, so risk grows with the amount of work done. This article makes a different claim for configuration-based workflow systems: the new code they need grows the way vocabulary grows in a text, more and more slowly as the system does more work.

That pattern has a name in linguistics and information retrieval, Heaps’ law. Below we explain it, test it against the code and the action library behind Arrow AIM, and set out where the comparison holds and where it stops.

Change Is Where Outages Start

Microsoft, November 12–14, 2026. Outlook, Exchange Online, Teams, SharePoint and Microsoft 365 Copilot were unavailable or degraded for many customers for more than a day. Microsoft tied the disruption to “an issue during an earlier network capacity upgrade” and said it would publish a full report once its assessment was complete.1

JPMorgan Chase, November 16, 2026. Thousands of customers reported trouble accessing their accounts and making transactions. Chase said it had “experienced a temporary issue related to a software bug,” and reports described it as a bug rather than a cyberattack.2

Apple, November 17, 2026. iCloud sign-in failed for many users, and the App Store, Apple Music and other services were disrupted. Apple said an internal update caused the outages.3 Because one Apple Account signs users in to all of those services, one failure reached all of them.

Microsoft Azure, October 29, 2025. Microsoft’s final review of an outage of more than eight hours at Azure Front Door found that a sequence of valid customer configuration changes produced metadata that crashed long-running code. Because the crash came about five minutes later, the configuration passed the safeguards meant to block it and spread globally.4 Configuration can break a system too, a point we return to below.

Banks have been counting these costs for some time. Nine UK banks and building societies reported at least 803 hours of unplanned IT outages between January 2023 and February 2025, more than 33 days in total, to Parliament’s Treasury Committee.5

AI Is Raising the Volume of Change

In April 2026, Sundar Pichai wrote that 75% of all new code at Google is AI-generated and approved by engineers, up from 50% the previous fall.6 Satya Nadella said in April 2025 that maybe 20% to 30% of the code in Microsoft’s repositories was written by AI.7

Review has not kept pace. Cortex’s 2026 engineering benchmark found pull requests per author up 20% year over year, incidents per pull request up 23.5%, and change failure rates up about 30%.8 In a survey by debugging company Undo, 81% of engineering leaders building mission-critical software said their organization had a production incident or outage linked to AI coding tools in the past six months.9

Some incidents have been tied to AI tools directly, though the companies involved often dispute the link. The Financial Times reported that a 13-hour interruption to AWS Cost Explorer in December 2025 followed Amazon’s Kiro coding tool choosing to “delete and recreate the environment”; Amazon attributes it to misconfigured access controls and says it affected one service in one region.10,11 In March 2026, Amazon reportedly called engineers together over retail-site incidents with a “high blast radius” linked to “Gen-AI assisted changes”; Fortune reported that the reference to AI was deleted from the briefing note before the meeting, and Amazon later said only one incident involved AI tools and none involved AI-written code.12,13 In April 2026, the founder of startup PocketOS reported that a coding agent deleted the company’s production database and its volume-level backups in about nine seconds, using an access token that had blanket permissions across environments.14

This argument does not depend on AI writing worse code than people, though some studies suggest it does.15 Even at equal quality, more change is reaching production, and with code, a single change can reach anything the code has permission to touch.

A Workflow Built From a Fixed Vocabulary of Actions

A configuration-based workflow system separates two things that code-based automation mixes together.

  • Actions are code. Each one does one specific job, such as reading a document, extracting fields, checking a rule or routing an approval. Each is unit-tested and versioned.
  • Workflows are configuration. A workflow is a JSON file that chains actions together and sets their inputs. Building or changing a workflow puts no new executable code into production.

Connections between actions follow defined interfaces, so a workflow that passes the wrong kind of data from one action to the next fails validation before it runs. Each workflow is pinned to the action versions it was tested with, so an update to an action does not reach a workflow until we move that workflow to the new version and test it.

When an AI agent builds or changes a workflow in AIM, it can only select and connect existing actions.

This makes the actions a vocabulary and each workflow a text written in it. New code enters the system only when a workflow needs a word the vocabulary does not yet have.

New Code per Workflow Change Is Falling

The direct test of the claim is the amount of code behind each workflow change. We measured it from Arrow’s git history for 171 workflow changes between April and November 2026.

Net code lines per workflow change in the Arrow AIM repository, by month in 2026. The mean over all workflow changes rises from 561 lines in April to 966 in May, then falls to 354 in June, 258 in July, 210 in August, 126 in September and 145 in October. The median for changes that needed code falls from 804 lines in May to 73 in September and October. November is a partial month with eight changes.

The mean net code per workflow change fell from 966 lines in May to 145 in October. When a change did need code, the median amount fell from 804 lines in May to 73 in September and October.

A growing share of workflow changes need no code at all. That share was 0% in April and 20% in May, and it has been about half since August.

Share of workflow changes that needed no code in the Arrow AIM repository, by month in 2026: 0% in April, 20% in May, 47% in June, 33% in July, 53% in August, 44% in September, 50% in October and 88% in November, a partial month with eight changes.

How we measured this. A workflow change is one merge that touched a workflow file. Functional code is the code that runs when a workflow executes, as distinct from the workflow’s configuration.

A change counts as needing no code when the same merge touched no functional code, so a merge that also touched unrelated functional code counts against the figure.

Net code per workflow change is the month’s net lines of functional code divided by the number of workflow changes, including those that needed no code. The median covers only the merges that touched at least one line of functional code.

April has five changes and November is a partial month with eight, so their figures are less reliable than the others.

Heaps’ Law: Vocabulary Grows Slower Than Text

Gustav Herdan in 1960 and Harold Heaps in 1978 described a regularity in written language: the number of distinct words V in a text grows with its length N as V = K·Nβ, where β is less than 1.16,17 For English text collections, β is typically around 0.5.18 At that value, a text four times as long contains only about twice as many distinct words.

The reason is reuse. A few words are used constantly, and word frequencies follow a heavy-tailed distribution, which is Zipf’s law; Heaps’ law can be derived from it.19,20 Most of a long text is written in words that have already appeared.

If workflow actions behave like words, the same arithmetic applies to code. The number of new actions needed per new workflow step would be proportional to Nβ−1, which falls as the library grows. Each workflow would need less new code than the one before it, on average.

Our Vocabulary of Actions Follows Heaps’ Law

Lines of code show how much is new. Counting distinct actions shows how often something new is needed. We counted the distinct actions used across the 76 workflows in the AIM library, in the order the workflows were added.

Cumulative distinct actions against cumulative workflow steps in the Arrow AIM library. The count rises from 24 after 68 steps to 104 after 1,332 steps, and a fitted Heaps' law curve, V = 2.6 N^0.51, tracks it closely.

The first 10 workflows had 68 steps and used 24 distinct actions. All 76 workflows have 1,332 steps and use 104. A least-squares fit on the log–log data gives V ≈ 2.6·N0.51, with R² = 0.98 on eight points, and the exponent is close to the 0.5 typical of English text.

The rate of new actions fell from about 35 per 100 steps in the first 10 workflows to about 4 per 100 steps in workflows 51 to 70. It has not reached zero, and Heaps’ law predicts it will keep falling without reaching it. At an exponent near 0.5, halving the rate takes four times as many steps.

Total code follows the same kind of curve. Over the eight months measured above, total net code grew roughly as the 0.7 power of the number of workflow changes (R² = 0.94). From May onward the exponent is about 0.5, which means four times as many workflow changes for twice the code.

Why Sublinear Growth Reduces Change Risk

When an AI agent writes code for each new workflow, the amount of new, never-run code grows in proportion to the work. In a configuration-based system whose vocabulary follows Heaps’ law, new code arrives at a falling rate, and the rest of each change is configuration over actions that are already tested and running elsewhere.

The actions that most workflows depend on are also the ones exercised by the most workflow tests and production runs. Their defects are more likely to have been found already, though a new combination of actions can still expose one.

How a Configuration-Based System Can Improve Security

The same pattern applies to security. Flaws such as injection bugs and unsafe software dependencies live in code, and they mostly arrive when code is added or changed. We add code at a low and falling rate, so we introduce new code-level flaws far less often than a system that writes code for every workflow.

The code we do have still needs dependency patching and security testing. Because it is small and stable, that work stays manageable as we add workflows and customers.

A workflow’s configuration can still be wrong in ways that matter for security, such as sending data to the wrong recipient. That is a narrower kind of error than a flaw in code, and a short workflow change is easier to review for it.

Where the Analogy Stops

Heaps’ law describes an open vocabulary that never stops growing. New actions will keep appearing, especially when we build workflows for a new kind of business process, and each one is new code. Workflows 41 to 50 added 26 new actions, more than the 20 workflows that followed.

Counting actions also misses changes to existing actions, and it treats a small action and a large one alike. That is why the lines of code behind each workflow change are our main measure.

Our evidence comes from one team’s library of 76 workflows and 171 workflow changes. Heaps’ law is usually fitted to text collections of 100,000 words or more, and our library has 1,332 steps, so the exponents are estimates from a small sample.

A fit to a cumulative count also flatters R², because each point includes all the points before it. With eight points, a straight line fits the count of actions about as well as the power law does. The exponents describe this library, and other configuration-based systems may reach different ones.

Configuration can also break a system when it is valid. At Azure Front Door, Google Cloud and Cloudflare, a configuration or data change that was correct in itself triggered a defect in code that was already running.4,21,22 Interface checks and pinned versions limit what a workflow change can do, but they do not prove that every combination of tested actions is safe.

That is why each workflow change in AIM is tested as a whole, in hermetic and end-to-end tests, and not only action by action. What a change can reach is limited to what the pinned actions are built to do, and the combination is tested before it runs.

How Each Change Is Tested

Each change is verified at up to four levels before it reaches production, and each level catches a different kind of failure.

LayerWhat it testsWhat it catches
Unit testsEach action and the services beneath itA broken action
Hermetic workflow testsWorkflow logic, isolated from outside systemsActions chained incorrectly
End-to-end run testsThe full workflow from start to finishIntegration failures
Arrow TRUE consistency testingSteps that use an AI model, run many times against your business rulesInconsistent answers from the AI system

Action tests are reused by every workflow built on those actions. As the vocabulary stops growing, a new workflow starts with most of its verification already done.

If you are planning an AI workflow, a Workflow Walkthrough goes through one of your processes with our team, including which parts would be new actions and which would be configuration. The Workflow Library shows workflows we have built.


References

  1. CNBC (November 12, 2026). “Microsoft apologizes for massive outage that took down Outlook and other 365 services.” https://www.cnbc.com/2026/11/12/microsoft-outage-outlook-aws-google.html. See also Sharwood, S. (November 13, 2026), “Microsoft services restored to all customers, company says it’s ‘deeply sorry’,” The Register. https://www.theregister.com/saas/2026/11/13/microsoft-services-restored-to-all-customers-company-says-its-deeply-sorry/5309609

  2. Wile, R., & Steinberg, K. (November 16, 2026). “Chase says transactions back to normal after outage online and at some branches.” NBC News. https://www.nbcnews.com/business/consumer/outages-chase-banking-online-branches-rcna609673. See also CNN (November 16, 2026), “Thousands of Chase Bank customers report trouble with online banking services.” https://www.cnn.com/2026/11/16/business/bank-outage-chase-us-bank-bank-of-america

  3. TechCrunch (November 17, 2026). “Apple services, including iCloud, App Store, Apple Music, and more, hit by outage.” https://techcrunch.com/2026/11/17/apple-services-including-icloud-app-store-and-apple-music-hit-by-outage/

  4. Microsoft Azure (2025). “Post Incident Review (PIR) – Azure Front Door – Connectivity issues across multiple regions,” tracking ID YKYN-BWZ, October 29, 2025. https://azure.status.microsoft/en-us/status/history/?trackingId=YKYN-BWZ. See also Wiggers, S. (November 5, 2025), “Azure Front Door Outage: How a Single Control-Plane Defect Exposed Architectural Fragility,” InfoQ. https://www.infoq.com/news/2025/11/azure-afd-control-plane-failure

  5. Computer Weekly (March 2025). “Big bank systems down for over 800 hours in last two years due to IT outages.” Figures from the House of Commons Treasury Committee. https://www.computerweekly.com/news/366620352/Big-bank-systems-down-for-over-800-hours-in-last-two-years-due-to-IT-outages

  6. Pichai, S. (April 22, 2026). “Cloud Next ‘26: Momentum and innovation at Google scale.” Google. https://blog.google/innovation-and-ai/infrastructure-and-cloud/google-cloud/cloud-next-2026-sundar-pichai/

  7. CNBC (April 29, 2025). “Satya Nadella says as much as 30% of Microsoft code is written by AI.” https://www.cnbc.com/2025/04/29/satya-nadella-says-as-much-as-30percent-of-microsoft-code-is-written-by-ai.html

  8. Cortex. Engineering in the Age of AI: 2026 Benchmark Report. https://go.cortex.io/rs/563-WJM-722/images/2026-Benchmark-Report.pdf. Summary: Datta, G. (November 12, 2025), “AI is making engineering faster but not better.” https://www.cortex.io/post/ai-is-making-engineering-faster-but-not-better-state-of-ai-benchmark-2026

  9. Stokel-Walker, C. (October 12, 2026). “AI code causes real world production outages.” LeadDev. Survey of 300 senior engineering leaders by Undo. https://leaddev.com/ai/ai-code-causes-real-world-production-outages

  10. The Decoder (February 2026). “AWS AI coding tool decided to delete and recreate a customer-facing system, causing 13-hour outage, report says.” https://the-decoder.com/aws-ai-coding-tool-decided-to-delete-and-recreate-a-customer-facing-system-causing-13-hour-outage-report-says/

  11. Amazon (February 20, 2026). “Correcting the Financial Times report about AWS, Kiro, and AI.” https://www.aboutamazon.com/news/aws/aws-service-outage-ai-bot-kiro

  12. Morales, J. (March 10, 2026). “In wake of outage, Amazon calls upon senior engineers to address issues created by ‘Gen-AI assisted changes,’ report claims.” Tom’s Hardware. https://www.tomshardware.com/tech-industry/artificial-intelligence/amazon-calls-engineers-to-address-issues-caused-by-use-of-ai-tools-report-claims-company-says-recent-incidents-had-high-blast-radius-and-were-allegedly-related-to-gen-ai-assisted-changes

  13. Fortune (March 12, 2026). Amazon’s response on its retail site outages. https://fortune.com/2026/03/12/amazon-retail-site-outages-ai-agent-inaccurate-advice/

  14. Tom’s Hardware (April 2026). “Claude-powered AI coding agent deletes entire company database in 9 seconds.” https://www.tomshardware.com/tech-industry/artificial-intelligence/claude-powered-ai-coding-agent-deletes-entire-company-database-in-9-seconds-backups-zapped-after-cursor-tool-powered-by-anthropics-claude-goes-rogue

  15. CodeRabbit (December 17, 2025). “State of AI vs. Human Code Generation Report.” Vendor study of 470 open-source pull requests. https://www.coderabbit.ai/blog/state-of-ai-vs-human-code-generation-report. See also The Register (December 17, 2025), “AI-authored code contains worse bugs than software crafted by humans.” https://www.theregister.com/2025/12/17/ai_code_bugs/

  16. Herdan, G. (1960). Type-Token Mathematics: A Textbook of Mathematical Linguistics. Mouton.

  17. Heaps, H. S. (1978). Information Retrieval: Computational and Theoretical Aspects. Academic Press.

  18. Manning, C. D., Raghavan, P., & Schütze, H. (2008). Introduction to Information Retrieval, Section 5.1.1, “Heaps’ law: Estimating the number of terms.” Cambridge University Press. https://nlp.stanford.edu/IR-book/html/htmledition/heaps-law-estimating-the-number-of-terms-1.html

  19. van Leijenhorst, D. C., & van der Weide, Th. P. (2005). A formal derivation of Heaps’ Law. Information Sciences, 170(2–4), 263–272. https://doi.org/10.1016/j.ins.2004.03.006

  20. Lü, L., Zhang, Z.-K., & Zhou, T. (2010). Zipf’s Law Leads to Heaps’ Law: Analyzing Their Relation in Finite-Size Systems. PLoS ONE, 5(12), e14139. https://doi.org/10.1371/journal.pone.0014139

  21. Google Cloud (June 13, 2025). Incident report: multiple Google Cloud products, June 12, 2025. https://status.cloud.google.com/incidents/ow5i3PPK96RduMcb1SsW

  22. Cloudflare (November 18, 2025). “Cloudflare outage on November 18, 2025.” https://blog.cloudflare.com/18-november-2025-outage/

Dr. Karthik Krishnan
About the author

Dr. Karthik Krishnan

Dr. Karthik Krishnan brings 25+ years of experience in machine learning and artificial intelligence. As Associate Professor at Northeastern University and Consultant at Arrow Intelligent Systems, his perspective combines deep technical expertise with practical insights into building ML systems that deliver measurable business value.