Some automation should not be intelligent.
It should be boring.
It should do the same thing every time, for the same reason, with logs you can understand and tests you can run. This is not less advanced. It is the foundation that lets judgment-heavy steps stay controlled.
A deterministic workflow is one where the desired behavior is known in advance. If this happens, do that. If the data is invalid, reject it. If the customer is enterprise, route to this queue. If an invoice is paid, update the account. No creativity required.
AI is expensive ambiguity machinery. Do not spend it on work that needs exactness.
Deterministic first
The default architecture should be deterministic first.
Use code, rules, schemas, and APIs for anything that can be expressed clearly. Use AI only where the work depends on language, judgment, fuzzy classification, summarization, or recommendation.
This matters for three reasons.
First, reliability. Deterministic systems are easier to test. You can write fixtures, expected outputs, and regression tests. A model can be evaluated, but it will not behave like a pure function.
Second, cost and latency. A rule check is cheap and fast. A model call is slower, costs money, and introduces another dependency. If a support workflow receives 50,000 tickets a month and 80 percent can be routed by explicit product IDs, skipping the model on those tickets reduces spend, queue time, and incident surface area. In customer operations, an extra 20 seconds per item can become hours of backlog during a burst.
Third, accountability. When something breaks, deterministic logic is easier to debug. You can inspect the event, rule, state, and output. With AI, you also need prompts, model versions, confidence, structured output validation, and review data.
When deterministic logic should call AI
Use deterministic logic as the dispatcher:
| Situation | Call AI? | Why |
|---|---:|---|
| Required fields are missing | No | Reject or request completion mechanically |
| Product ID maps cleanly to one queue | No | Exact lookup is faster and safer |
| Customer message has no explicit category | Yes | Ambiguity is the work |
| Amount is above approval threshold | No | Route to approval by rule |
| Email thread needs a concise issue summary | Yes | Language compression is useful |
| Output would trigger an external write | Maybe | Generate recommendation or draft, then gate |
The pattern is simple: code decides whether ambiguity exists; AI handles the ambiguous subtask only when it adds value.
What belongs in deterministic automation
Good candidates:
- moving data between systems
- validating required fields
- checking permissions
- deduplicating events
- enforcing thresholds
- routing based on explicit fields
- sending notifications based on status changes
- applying known business rules
- transforming data into standard schemas
- managing retries and exception paths
Bad candidates:
- interpreting messy customer intent
- reading a long policy document and applying judgment
- deciding whether a complaint is reputationally sensitive
- drafting nuanced communication
- summarizing a meeting transcript
The line is not always perfect. That is fine. The goal is not ideological purity. The goal is to avoid outsourcing exact rules to a model just because the model is there.
Deterministic workflow checklist
Before adding AI, answer these questions:
- Can the decision be expressed as a rule?
- Can the input be validated with a schema?
- Can the output be checked mechanically?
- Is the action reversible?
- Is there a known source of truth?
- Can we write five examples with expected outputs?
- Can we handle duplicate events safely?
- What happens if the downstream API is unavailable?
- Who receives the exception?
If most answers are clear, start with deterministic automation.
Example: invoice status sync
A finance team wants automation around invoices.
Bad design: ask an AI agent to monitor inboxes, infer payment status, update the accounting system, and notify account owners.
Better design:
- Pull invoice status from the accounting API.
- Store each invoice event with a unique event ID.
- Validate customer ID, invoice ID, amount, currency, and status.
- Use an idempotency key like invoice_id + status + paid_at.
- If status changes to paid, update the CRM account field.
- If the CRM update fails, retry with backoff.
- If retries fail, send to an exception queue.
- Log every state transition.
Where might AI belong? Maybe to summarize payment issues from email threads, classify disputes, or draft a follow-up. But the core payment sync should be deterministic.
Data contracts are not optional
Deterministic workflows depend on data contracts.
A data contract says: this is the shape of the input, this is the required output, these fields are required, these values are allowed, and this is what happens when the contract is violated.
For AI automation, data contracts become even more important. If a model extracts fields from a document, the workflow should still validate the output before using it. The model can propose. The system verifies.
A basic contract for a routing decision might look like:
`json
{
"category": "billing | product | bug | legal | security | unknown",
"confidence": 0.0,
"rationale": "short explanation",
"requires_human_review": true
}
`
The workflow should reject outputs that do not match the schema. Do not let prose leak into systems that expect structure.
Deterministic does not mean rigid
The old version of automation got this wrong. It tried to turn every process into brittle rules. That is how teams ended up with dead RPA flows, spreadsheet macros nobody trusted, and exception handling that lived in someone's inbox.
Modern automation needs both: deterministic structure and AI judgment. The trick is to put each where it belongs.
Use deterministic logic to create the rails. Use AI to handle ambiguity inside the rails.
The operator's rule
If a decision can be expressed as code, write code.
If the input is ambiguous, use AI as a bounded step.
If the consequence is serious, add a human gate.
Do not make the model responsible for work that should have been architecture.
