The monster my agents built one node at a time
- n8n
- agents
- harness
Today, when I opened the workflow that handles my emails in n8n, I found a monster. The canvas was so tall that I could no longer see all of it on the screen. Dozens of branches started from a single entry point and all came back to cross over on the right, in a tangle of links impossible to follow.
My agent had simply added functions as it went along! A new type of email needed a reply, so it added a branch. A special case came up, so it added a condition. Every addition was correct, tested and delivered. But no agent ever asked whether the new function really belonged there, or whether it already existed in a sub-workflow that it could simply have called.
Why agents pile things up
An agent does what it’s asked, in the context it’s given. If the request is “add handling for this kind of email” and the context is this workflow, the most direct answer is to add nodes to it. Nothing in its instructions asks it to step back, look at the size of what it’s changing or look for what exists elsewhere. It isn’t wrong: it optimizes for the task, not the architecture.
This is where the harness comes in (the harness is the set of rules, tools and checks that frame the agents’ work). A more capable model wouldn’t have solved the problem on its own. What was missing was a question asked at the right moment: before adding a function, does it already exist? And beyond a certain size, should this workflow be split into smaller parts, each with a clear role?
This kind of rule is hard to anticipate; it’s hard to prevent every drift in a system that produces hundreds of workflows. You discover them by opening the canvas one morning, then you fix the harness so the same drift doesn’t happen again. The harness grows like the rest of the system, one discovery at a time.
What I’m changing
The fix doesn’t happen in the workflow first; it happens in the harness. An agent that modifies a workflow will have to check the catalogue of existing sub-workflows before adding a function. Beyond a size threshold, the delivery check will require a split rather than one more branch. As for the monster, it will be broken up into smaller services that other workflows can call.
To give a sense of scale: 251 nodes, 355 links, 83 code blocks, 62 switches and 29 calls to Gmail, but only 9 calls delegated to a sub-workflow. And you? When did you open one of your systems and discover what it had become? I wonder what’s happening in systems without a harness!