Skip to main content

Agentic Automation

Something has quietly shifted in software development. For the first time in the history of the industry, the ability to write working code is no longer the bottleneck. AI coding assistants have made it possible for a marketing analyst, a customer success manager, or a founder with no computer science background to produce a functioning Python script or TypeScript module that solves a real business problem.

That is remarkable. It is also dangerous — if you let it be.

When everyone can write code, the question is no longer can we build this? It becomes how do we build this in a way that we can maintain, audit, extend, and trust?

This guide is our answer to that question. It describes a framework for building agentic automation systems — automated workflows where AI agents perform discrete tasks, coordinate through a central orchestrator, and report back in a structured, predictable way. It is the framework we use internally at Code Capsules, and it is the framework we built the infrastructure to support.

It is not a tutorial for a specific tool. It is a philosophy with a concrete implementation behind it.


The core ideas

This guide is built around three ideas that we believe are foundational to building agentic automation that actually works in production.

1. Determinism through undeterministic means

Large language models are probabilistic. Ask the same question twice and you may get two different answers. This makes most engineers nervous about building business systems on top of them — and rightly so. Businesses run on predictability. Payroll runs on Fridays. Reports go out on Mondays. Alerts fire when revenue drops.

The instinct is to avoid non-determinism. The insight is that you do not need to eliminate it — you need to contain it.

A human employee is also non-deterministic. You cannot predict exactly what they will write in a customer email, what they will notice in a spreadsheet, or what conclusion they will reach in an analysis. But businesses have been running reliably on human judgment for centuries. They do this by building structure around people: clear job descriptions, defined inputs and outputs, review processes, escalation paths, and audit trails.

The same structure works for AI. The framework in this guide puts the non-deterministic LLM call inside a tightly defined boundary — a function that receives a structured input and must produce a structured output. The orchestration layer above it is entirely deterministic: a queue, a webhook, a state machine. The agent below it is entirely deterministic: a typed contract, a Procfile, a git repository.

The AI sits in the middle, doing the thing only AI can do, surrounded by the things that make systems reliable.

2. Microservice agents

Every agent should do exactly one thing, and do it well.

Not "run the weekly marketing report." That is a workflow. An agent is a step inside a workflow: fetch the data, or analyse the data, or format and send the report. These are three different agents, potentially using three different models, written in three different languages, deployed and scaled independently.

This is the microservice philosophy applied to AI automation. The benefits are identical to why microservices beat monoliths in traditional software: each piece is independently deployable, independently testable, independently replaceable. When your analysis model improves, you swap one agent. When your data source changes, you update one agent. Nothing else breaks.

It also forces clarity about what each agent actually does — a discipline that pays dividends when the agent is being written by someone who learned to code last month with AI assistance.

3. Git as the source of truth

When AI can write agent logic, the natural temptation is to let it write and deploy directly — skipping review, skipping version history, skipping any human checkpoint. This is the mistake.

Git is not a technical nicety. It is an organisational control system. A commit is a record of intent. A pull request is a review process. A branch is an experiment that has not yet been trusted. A rollback is an undo that does not require understanding what went wrong.

These properties become more important when code is generated by AI, not less. The syntax of a Python function does not matter. What matters is that a human — or at minimum a review process — has seen the change, that it is stored somewhere permanent and auditable, and that it can be reverted in thirty seconds if something goes wrong at 2am.

Keeping agent logic in git and deploying through a standard CI/CD pipeline is the single most important decision you can make when building agentic automation for a business.


What this guide covers

SectionWhat you will learn
The ProblemWhy existing automation approaches break as complexity grows
The FrameworkThe orchestrator + agent architecture and how the pieces fit together
Designing AgentsHow to think about agent boundaries, model selection, and the microservice philosophy
DeploymentGit-based deployment with Code Capsules — from a new agent to a running capsule

Who this is for

This guide is written for technical teams — developers, engineering leads, and technically minded founders — who are starting to automate meaningful business processes with AI and want to do it in a way that scales.

You do not need to have built a production AI system before. You do need to be comfortable with the idea that deploying software should involve version control, that reliability comes from architecture not luck, and that the right answer to "can we move faster?" is usually "yes, if we build the foundations correctly."