Most automations do not fail loudly. They fail quietly, on a Tuesday, while you are busy with something else. If you want a production-grade AI workflow, the work is less about the clever prompt and more about everything wrapped around it: tests, routing, thresholds and visibility.
This is a builder's walkthrough. You are a technical operator, you already have a few automations running, and you have probably been burned by one of them. Here is how to build the next one so it earns your trust.
One note up front: nothing below predicts your results. Any numbers are illustrative, not a guarantee, and your workflow will have its own failure profile.
Why most automation builds break silently
A traditional script crashes when it breaks. An LLM step does not. It returns something fluent and wrong, and every downstream step accepts it politely. That is the core problem.
In our experience, silent breakage tends to come from four places:
- Input drift. The data changes shape. A client starts forwarding emails with attachments, a form gets a new field, a supplier changes an invoice layout. The prompt was tuned on the old world.
- Model drift. The provider updates a model, or you swap one, and behaviour shifts in small ways. Outputs that used to parse now come back with an extra sentence.
- Plausible wrong answers. The model confidently classifies, summarises or drafts something incorrect. No error is raised because nothing technically failed.
- Plumbing failures. An API times out, a credential expires, a trigger stops firing. Boring, common, and often invisible if nobody is watching for the absence of events.
The useful habit is to ask, for every step: what does it look like when this goes wrong, and who finds out? If the honest answer is "nobody, until a customer complains," you have a prototype, not a production workflow.
The eval harness pattern: 20 pairs as your first test suite
An eval harness sounds heavy. At the start it is not. It is a set of real inputs paired with the outputs you would have accepted, plus a script that runs the workflow against all of them and tells you what changed.

Build your first one like this:
- Pull 20 historical cases. Use real work your team already did: past support emails and the replies you sent, past leads and how they were qualified, past invoices and the fields extracted. Real data beats invented examples because it contains the mess.
- Include the ugly ones. At least five of the twenty should be edge cases: empty fields, forwarded threads, two requests in one message, something in the wrong language. If every example is clean, the suite proves nothing.
- Write down what correct means. For structured outputs, that is an exact match on fields. For drafted text, it is a short rubric: mentions the right order number, does not promise a refund, stays under a length. Keep rubrics checkable.
- Run it on every change. Prompt edit, model swap, new tool: rerun all twenty and compare. You are looking for regressions, not perfection.
Twenty is a starting point, not a standard. It is enough to catch the embarrassing breakages and to make you stop trusting your gut after three spot-checks. Add a new pair every time production surprises you. Over a few months that suite becomes the most valuable asset in the project.
The tradeoff: for open-ended writing, automated scoring is imperfect. You can use a second model call as a judge, but treat that judge as another thing to test. Keep a human review sample alongside it. The idea of moving beyond manual spot-checks into repeatable prompt testing is also covered in n8n's write-up on prompt testing frameworks, which is a reasonable companion read.
Error routing and retry logic: plan for the LLM being wrong
Assume the model will be wrong some percentage of the time. Your design question is what happens next.
Separate the kinds of failure
Not every failure deserves the same response:
- Transient failures (timeouts, rate limits, a 500 from an API). Retry with a short, growing delay, and cap the attempts at three or so. Infinite retries turn an outage into a bill.
- Format failures (the output is not valid, a required field is missing). Retry once with the error message fed back to the model. If it fails again, route it out.
- Judgment failures (valid format, wrong content). Retrying rarely helps. These need validation rules, thresholds, or a human.
Give every failure somewhere to go
Build an explicit failure lane. When a step exhausts its retries or fails validation, the item goes to a review queue with the original input, the model output, and the reason it was flagged. A person fixes it, and that fix becomes a new pair in your eval set.
Two rules that save pain. First, make steps idempotent, so a retry never sends the same email twice or creates a duplicate record. Second, never let a failed item vanish. A dead-letter queue that someone actually looks at beats a clever recovery scheme nobody understands.
The 4-layer reliability stack
We think of reliability as four layers. Skip one and the others carry more weight than they can bear.
Layer 1: Orchestration
The workflow itself: triggers, steps, branching, retries, timeouts. Keep it boring and explicit. Small steps with one job each are easier to test and replace than one giant agent doing everything. Use an agent where the path genuinely varies, and fixed steps where it does not. AI should earn its place in each step.
Layer 2: Evals
Your harness from earlier. It runs before deployment and on a schedule afterward, so model drift shows up in a test result rather than a customer complaint.
Layer 3: Confidence thresholds
Have each risky decision carry a confidence signal, then act differently by level. High confidence proceeds automatically. Middle confidence proceeds with a flag or a delay. Low confidence goes to a human.
Be honest about how you get that signal. Raw model self-reported confidence is weak. Better inputs include agreement across repeated runs, rule-based checks (does the extracted total match the line items?), and retrieval match quality. Dedicated scoring models are an active area; a Latent Space conversation with TypeSafe AI's CEO discusses confidence-scoring models aimed at reliability in production rather than bigger general models. Whatever you use, calibrate it against your eval set instead of trusting a number because it looks precise.
Layer 4: Observability
Log every run: input, output, step timings, retries, which branch it took, and the final outcome. Then add the alerts that matter:
- An error rate above your normal baseline.
- A workflow that has not run when it normally would. Silence is a failure signal.
- A spike in items landing in the review queue.
- Cost per run drifting upward.
A weekly ten-minute look at the review queue and a sample of successful runs will teach you more than any dashboard.
Ship with confidence: the pre-production checklist
Before a workflow touches real customers or real money, we walk through this list:
- Scope is written down. What it does, what it must never do, and who owns it.
- Eval suite passes. Twenty or more real pairs, including edge cases, with a recorded baseline.
- Every step has a failure path. Retries are capped, and failures land in a reviewed queue.
- Actions are idempotent. A retry or a replay cannot double-send or double-charge.
- Thresholds are set and tested. You know what gets auto-approved and what gets escalated.
- Risky actions have a human gate at first. Refunds, external emails, anything hard to undo. Loosen the gate only as evidence builds.
- Logging and alerts are live. Including the alert for "nothing ran."
- Credentials and access are least-privilege. The workflow can touch only what it needs, and your data stays in systems you control.
- There is a kill switch and a rollback. You can pause it in one step and restore the previous version.
- A review date is on the calendar. Models and inputs change, so the workflow needs a scheduled check.
Run it in shadow mode first if you can: the workflow produces outputs, a human still does the real work, and you compare. That alone catches most of what the eval set missed.
Where to go from here
Start small. Pick one workflow that annoys you weekly, collect twenty real examples, and build the failure lane before you polish the prompt.
If you would like a second pair of eyes on which of your workflows is worth hardening first, the free 30-minute AI Opportunity Audit is a no-pressure way to get one. You keep everything we map out, and the roadmap is yours either way.
Visuals in this article are AI-generated.
Sir Tay Jackson
Founder, Air Flow Automations
Founder of Air Flow Automations. Builds custom AI systems for agency owners, e-commerce founders, and service operators who want their time back without adding headcount.



