Hey,
Today I want to share some thoughts on building AI automations.
Most AI automation tutorials show no-code graphs that look impressive on screen, then fall apart the moment a real business depends on them.
One reason is simple: branching, looping, and retries are hard to build cleanly inside a visual canvas.
That matters because automation is one of the highest-leverage investments any business can make. Good automation doesn’t just save time. It raises quality across an organisation by adding consistency and removing friction from routine work.
The example I always come back to is software deployments. We used to deploy software by hand. It was stressful and error-prone, so teams didn’t do it very often. And when they did, things broke, because humans aren’t great at repeating complex procedures accurately at scale. Moving deployments into automated pipelines transformed software delivery and let teams ship far more often (and with fewer errors).
So if you’re building automations in 2027, what’s the best approach?
Here’s how I think about building them so they actually hold up in production.
The four levels of AI automation
Every step in an automation sits on one of four levels:
Plain code. Fast, cheap, and deterministic. It runs the exact same way every single time, and it’s the foundation of any reliable workflow.
Decision models (routers + classifiers). A newer category of model built to classify, route, or score text and return probability numbers in a fraction of a second.
A single LLM call. Not everything needs an agent. One structured model call inside plain code (for extracting fields from an invoice or drafting a short reply) goes a long way.
An agent. The most capable option, and also the most complex. Useful when the steps can’t be written down in advance.
Start at the bottom and only move up a level when you have to.
Most people skip straight to agents, and that comes with two real downsides: cost and variability. Agents call models in a loop and introduce non-determinism into your workflow. At 30,000 runs a day, that adds up fast.
Decision models (like Google’s Gemini Decisions API, OpenAI’s equivalent, or Jev from TypeSafe) fill a huge gap here. These are new types of AI models that are especially well suited to automation. Classification and routing are two of the most common steps in any business workflow, and decision models can handle them without the speed or cost penalty of a full LLM:
answers = decide.ask(
"Hi, can you automate our invoices? We need it this month.",
real=decide.yes_no("Is this a genuine enquiry?"),
topic=decide.choice("What is it about?", {
"invoices": "Bills and payments",
"other": "Anything else",
}),
)
answers["real"].value # 0.97The benefit of a decision model is the speed and low cost.
Even when a step does need an LLM, pick the smallest model that can handle it.
Here’s an example of the costs for 10,000 runs of a speed-to-lead workflow (one writing call per run):
Claude Fable 5.2: ~$160
Gemini Flash: ~$15
DeepSeek Flash: ~$2.95
That’s a huge cost difference. Most business tasks don’t need frontier reasoning. Choosing the right level and the right model size makes a massive difference over time.
Why code beats visual builders once it matters
No-code tools like Zapier, Make, and n8n are great for quick day-to-day tasks, especially when non-technical teammates need to edit them. Code isn’t the only answer, and it does have more upfront friction.
Longer term, though, if a workflow needs retries, timeouts, loops, and real error handling, a visual graph quickly turns into a tangled mess that’s painful to test. In Python, most business automations boil down to a list of steps and a few if statements. Code also gives you real abstraction, which visual builders struggle with.
People often hesitate to leave no-code because of out-of-the-box integrations.
That used to be a huge advantage.
Today, with coding agents like Claude Code and Codex, building a custom integration for Gmail, Slack, or a spreadsheet takes minutes. Most integrations are just a single HTTP request:
def post(text: str):
url = settings.get("SLACK_WEBHOOK_URL")
retry.call(lambda: httpx.post(url, json={"text": text}, timeout=10).raise_for_status())Writing it in code gives you full control, lets you run everything locally, avoids third-party platform licensing headaches, and lets you write proper tests.
With pytest and local fakes for external APIs, you can verify the rules your business depends on in about a second before anything touches a customer:
A lead is still saved, and Slack is alerted even if the AI models fail.
A duplicate webhook only sends one email.
An invalid webhook signature is rejected before any model runs.
Every price in a generated proposal matches your price list before anything is sent.
Consolidate onto one cloud platform
One anti-pattern I try to avoid is stitching together five different services: a no-code tool here, an inference API there, a separate database, and another tool for logs. Tracking billing across multiple accounts is a headache, and copying API keys between services turns into a security and operational nightmare over time.
I deploy everything to a single cloud provider (I use Google Cloud, though AWS and Azure give you the same building blocks). Compute, databases, storage, secrets, logging, and alerting all sit in one place, with per-client billing if you’re building for others.
Cloud platforms used to feel intimidating, but with coding agents driving the CLI, they’ve never been easier to operate.
There’s also a practical reason you’ll end up on a cloud provider anyway: inference.
Direct model APIs don’t give you the same SLA guarantees or data sovereignty controls that serious business projects require. Once you’re already running inference on AWS, Azure, or Google Cloud, consolidating the rest of your automation stack there just makes sense.
A bonus of cloud-native inference is that you stop managing API keys altogether. On Cloud Run, credentials are auto-injected into the container via a service account:
from google import genai
client = genai.Client(vertexai=True, project=project, location=LOCATION)Calling Claude through AnthropicVertex works the same way. Pair that with Cloud Run jobs for short-lived or scheduled scripts (you only pay while they run), Cloud Run services for webhooks, shadow mode for dry runs before going live, and one project-wide error alert so you know when something breaks before a customer does.
Final thoughts
If you’re building professional AI automations heading into 2027, start code-first. It’s never been easier to write the code, and you get far more control, testability, and reliability than a visual graph can give you.
You can watch the full course on YouTube.
PS: If you want the source code and deployment scripts, they’re free inside AI Developer.
Thanks for reading, and have a nice week.

