Retrying the same LLM approach five times is just expensive failure. The fix is layers: first the LLM attempt, then a deterministic scripted path for the workflows that have one, then human escalation. Without the middle layer, the human escalation rate jumps from about 3 percent to about 15 percent. Script the deterministic paths for your most common workflows and let the LLM handle the edge cases it is actually good at.
Before you start
A list of your agent’s most common workflows, and a way to run a scripted version of each one.
Pick the common workflows
List the agent’s workflows by frequency and pick the top three. A workflow that runs a hundred times a week deserves a scripted path; one that runs once a month does not.
For each one, write the steps a script can do without judgment: look up the order, fill the form, send the standard reply.
Script the path with the same tools
Write the scripted path using the same tools and the same checks the agent uses, so the result is identical whichever path ran. The script must validate its inputs and verify its result, just as the agent should.
Keep the script short and readable: a fallback nobody can read is a fallback nobody will trust.
Test the fallback by breaking the LLM step
Run the workflow with the LLM step disabled and confirm the scripted path completes it correctly. Then run it with the LLM step working and confirm the script is not used.
Log which path ran for each task, so you can see how often the fallback saves a run.
Practice check: fictional Maple Corner agent, 100 tasks a week
The table below is fictional practice material, worked out by hand from the stated layers. It is the expected result for the practice workflows, not a run of any agent.
| Layer | Tasks resolved | Share | Verdict |
|---|---|---|---|
| LLM attempt | 85 of 100 | 85% | Most runs resolve here |
| Scripted fallback | 12 of 100 | 12% | Caught by the script |
| Human escalation | 3 of 100 | 3% | Only the hard ones |
| No fallback, escalation | 15 of 100 | 15% | Without the script |
The scripted fallback resolves 12 of 100 tasks that the LLM could not, so only 3 reach a human. Without the script, 15 of 100 would escalate.
Expected result. UNTESTED: the shares in the practice table are worked out by hand, not measured by running an agent. Script the fallback path for your own three most common workflows, test it with the LLM step disabled, and log which path resolves each task.
Limits
- A fallback that is never tested is not a fallback: break the LLM step on purpose and watch the script run.
- Script the common workflows first: the rare ones are where the LLM earns its keep.
