Workflows All the Way Down

Workflows All the Way Down
Why the AI agents that actually work look nothing like the demos
Every few weeks, someone posts a video of an AI agent that "does your job." You give it a goal, walk away, and come back to a finished outcome. A one-shot miracle worker.
I've watched dozens of these. None of them survive contact with real work.
Ask one to do A, B and C, and what you'll often get back is: a polished A, a half-finished B, a cheerful TODO comment where C should have been, an unsolicited D, E and F that nobody requested, and a quietly broken G and H you'll discover next Tuesday. Hand it something it isn't quite sure how to do, and it'll happily run in circles forever, billing you by the loop.
None of this, in fairness, is the model's fault. We've handed it the entire problem in one go, with no structure and no checkpoints, and asked it to be wise. It is behaving exactly like an extremely capable new graduate on their first day — willing, energetic, occasionally brilliant, and in desperate need of someone to break the work into stages and review it as they go.
The systems that do work — the ones in production, holding up under real codebases, real reviewers, and real users — look much more mundane than the marketing. They are also, conveniently, the ones that scale.
We have been building these systems for a while now, and the view we have arrived at fits in three words.
Everything's a workflow.
What a workflow actually is
A workflow is a sequence of stages an agent moves through to complete a task. Complex tasks decompose into simpler ones. Simpler ones are easy to do or hit a snag.
Most of what we do as workers is already this. Attend a meeting. Write an email. Make a call. Review a document. These small, repeating routines make up the majority of millions of jobs.
None of this is new. It's how craftspeople, factories, professions, and well-run teams have always worked. A house, a legal case, a piece of software — the work to build any of them breaks down into progressively simpler stages, with checkpoints between them. And often (usually) each stage will start with or end in an artifact. A plan, a diagram, a specification, a brief, a note. These artifacts are the trails we leave as we build. And they are what can be read or written to control what we are doing, or to review what we have done.
And so it is with AI. For an AI agent, each stage consumes some artifacts — files, pictures, diagrams, emails, drafts — and produces other artifacts. Along the way it interacts with the wider context: reading what it needs to read, writing what it needs to write, looking up what it doesn't already know. And, importantly, it can reach into the systems we let it touch — the CRM, the inbox, the finance platform, the issue tracker, whatever.
Getting work done with agents is about closely defining what they should do, and then managing them as they do it. Compared to some of the hype about agents this might sound like a lot of work. Indeed, it is far from "I just tell it what to do and it does it!" This is more like treating agents like precocious children.
If "Agents as workflows" feels like a downgrade, it is only because the dominant story has been "agents as one-shot magic." That story doesn't deliver (yet) for the reasons we have described above. What humans intuitively know — when to break work into stages, when to review progress, when to redo a piece, when to abandon the plan — is exactly the structure AI agents need to inherit.
This process of reviewing, deciding when to redo work, deciding whether a new approach is needed, or whether something can be delivered is the process of managing the agent workflow process.
To some extent agents can manage themselves. One agent can review another agent's work. Another can fix what is wrong. A third can work out fiendish ways to test it. Then another can review what has been done and make a judgement about whether it can be released.
But there will always be room for human intervention and in one area humans will remain completely necessary. AI agents can't decide on their own what goals to follow. Top level goals and intentions will always be set by humans. Humans will also ultimately decide whether something is finished. Humans will always be the only ones that can be accountable. But the work will be done by the AI running workflows, run with lesser or greater human intervention.
A particularly useful AI agent, therefore, is a workflow runner. The stages are explicit. The inputs and outputs are explicit. What each stage is supposed to achieve is explicit. And the runner must manage this and ensure that the stage meets its contracts.
That's the whole game.
How the model touches reality
So: how does an AI agent actually do anything?
The answer is almost embarrassingly simple. It uses its words and tokens to tell another computer what to do.
Inside a stage, the LLM doesn't act in some abstract sense. It generates text, and that text is interpreted as tool calls against the surrounding context. Read a file. Write a file. Search a codebase. Run the compiler. Send an email. Query a database. Run a command.
The model's job at each stage is to choose, sequence, and parameterise these calls until the expected artifact exists. The tools available to it are described in its prompt, alongside the purpose of the stage and what a good output looks like.
Designing a stage is, in large part, the art of defining a good set of tools and writing a good prompt.
Two things matter here.
Generic primitives go a long way. A surprising amount of work is achievable with CRUD and search — read, write, list, find. You rarely need a bespoke tool for every operation. Models compose primitives well, and a small toolkit is easier to reason about than a sprawling bespoke one.
Tools that look like training data work better. Bash, git, file paths, SQL, HTTP, JSON — these are dense in the training data. A homegrown DSL with non-obvious semantics is not. If you can express what you need in vocabulary a competent engineer would recognise, the model performs near its ceiling. If you invent a new vocabulary, you pay a tax on every call.
This is why so much production agent infrastructure ends up looking like a thin shell over Unix and version control. It isn't a failure of imagination. It's alignment with what the model actually knows.
Artifacts are the natural gates
Stages produce artifacts. A spec. A plan. A patch. A shortlist of candidates. A draft email.
That artifact is the natural place for oversight to live.
A human — or another agent — can read it and approve. Edit it and continue. Reject it and require the stage to be redone. Or keep it and generate alternatives to compare.
This matters more than it sounds. The dominant alternative is supervising an agent by watching its inner monologue — its chain of thought, its scratchpad — and that's a terrible interface. Monologues are long, partial, and easy to skim past errors in.
Artifacts are concrete. You can diff them. Version them. Comment on them. Hand them between people. Store them as a record of what was decided and why.
Putting humans at artifact boundaries also makes the system safer in the ways that operationally matter. Nothing irreversible — sending an email, merging a pull request, contacting a candidate, charging an account — happens without something concrete to look at first.
Approval becomes a normal step rather than a special one.
How you actually manage an agent
The artifact-and-gate model isn't only about catching bad outputs on the way out. It's also about setting direction on the way in.
The same structure that lets a human review a draft email before it goes out lets a human write the spec that the next five stages are bound by. The same gate that catches a bad candidate submission also enforces that every submission cites the brief it was screened against. The same review step that flags a broken test enforces that tests must pass before the next stage starts.
An artifact, in this sense, is not just a checkpoint. It's a contract. Everything downstream has to honour it.
This gives you something the free-roaming agent architecture struggles to provide: actual management. Not just filtering output on the way out, but setting standards, direction, scope, and policy from the top down — and trusting the system to operate inside them.
It also, conveniently, addresses each of the four ways our enthusiastic new graduate goes off the rails.
Doing all of what you asked. Workflow stages have explicit completion criteria. A stage that should have produced C doesn't quietly end with a TODO; it either produces C or escalates.
Doing only what you asked. The stage has a defined output. An artifact that arrives at review with unsolicited D, E and F bolted onto the side is a failed artifact — it goes back for remediation just as cleanly as one that arrived missing C.
Catching what it might have broken. Review and test stages exist precisely for this. "The work is done" is a different artifact from "the work passes review", and only the second one unlocks the next stage.
Telling you when it doesn't know. A well-designed stage has an "I can't do this" output as well as a "here it is" output. Better to escalate cleanly than to run in circles burning tokens. Agents won't naturally do this — they'll try, and try again, until something gives — but a workflow can require it of them.
This is the difference between supervising an agent and managing one. Supervising is what you do when the only thing you can intervene on is the final output. Managing is what you do when you control the inputs, the boundaries, the checks, and the escalation path.
Workflows compose
A workflow ends. What happens next is, almost always, another workflow.
Sometimes the choice is obvious. A placement record leads into onboarding. A merged pull request leads into release notes.
Sometimes the selection itself needs a small dispatch workflow whose only job is to look at the situation and decide what runs next.
Very occasionally, you encounter a task novel enough that no existing workflow fits, and the right next move is to author a new one.
This is what we mean by workflows all the way down. The top-level "agent" is not a free-roaming reasoner. It is a router over a library of workflows, each of which is a sequence of stages, each of which is a tool-using model call against a defined context with a defined output.
There is no further magic underneath.
Most of what we do can be expressed this way
Software development fits cleanly. Research → idea → spec → plan → implement → review → remediate → publish. Each arrow is an artifact handoff. Each stage has a purpose, a tool set, and an expected output. A senior engineer reviewing the spec at stage three is doing exactly what they'd do in a team of humans — on a concrete document, not a model's stream of consciousness.
Recruitment fits the same shape. Research the client's requirements, source the position, source candidates, present candidates, arrange interviews, follow up, create the placement record.
So does legal discovery. Accounting close. Compliance review. Customer onboarding. Incident response. Content production. Sales prospecting.
Nearly every job has routines, and routines are workflows in disguise.
The interesting work, then, is not "build an agent." It is to identify the workflows that actually run in a domain, define each stage's artifact and context and tools and prompt, put humans at the boundaries that matter, and let the whole thing compose.
What we're building at Modularity
We are building Modularity to automate production-quality software development.
Production-quality is the operative phrase. Anyone can demo a one-shot code generator on a toy task. What survives contact with a real codebase, real reviewers, real CI, and real users is something else — a system that decomposes the work, produces inspectable artifacts at each step, uses the same tools an engineer would use, and lets humans intervene exactly where intervention is valuable.
That system is a workflow runner with good tools and good prompts. That is the architecture. It is, deliberately, not very mysterious.
The work is in the details — which stages, which artifacts, which tools, which prompts, which gates.
That's where we spend our time.