A Cheaper AI Workflow Doesn’t Have to Do Less
What I learned about scaling good workflows by changing agent responsibilities deterministic work into code, calling AI only when needed, and setting a budget the app can enforce.
I’m experimenting with AI workflows, and when one actually solves a problem for me I naturally want to share it with colleagues. But I’m learning more about the cost of that firsthand. A workflow I can afford while experimenting on my own may be too expensive to run as often as I’d like, especially when more people start using it.
I ran into this with an AI workflow that builds a context library from my work. It gathers meeting notes, transcripts, and updates from several teams’ backlogs each day. The model uses that material to suggest decisions and learnings for me to review. I check those suggestions before saving them alongside the factual records in a Google Sheet. The idea is to keep useful context somewhere I can return to, rather than hold it all in my head or piece it together again later.
After using it for a while, I wanted to see whether it could work for colleagues too. But when I measured usage, the workflow was consuming over a million credits a month, above the per-person allowance and about five times what top power users at my company were using. I couldn’t extend that pattern to everyone who might find it useful.
Refactoring the workflow brought monthly credit spend down by reducing token use from over a million to under 100,000, with two constraints guiding the changes: output quality and cost. Here are three things I learned that I expect to use again for scaling agents.
Move predictable work out of agents and into code. Save model calls for the work that needs interpretation.
Watch the recurring cost of agent coordination. Smaller inputs help, but the agent may still be loading context to run a process code could handle.
Enforce cost caps in code, not policy. Decide before each model call whether it can proceed and what happens if it cannot.
1. Move predictable work into code
My first attempt was to run the workflow less often and give it fewer sources to read. That cut token use by about 25%, but the output became less useful as I took away things I valued. I needed a different approach so I looked at what I was asking the agent to do. It was doing everything: reading instructions, history, and full transcripts, then managing the coordination and interpreting the material. Delegating everything to the agent gave me a lot of flexibility to experiment with the flow myself, but not every step needed AI and using it this way was prohibitively expensive.
As the process became clearer, I moved work with repeatable rules into Python. Selecting part of a transcript is a good example where code can compare timestamps and return the section within a date range without asking an AI model to work through it. The next step of deciding whether that conversation contains a meaningful decision or something worth learning from is a better fit for an agent.
Having code do the deterministic work meant less work for the model. Moving those routine tasks into Python cut token use by 75–90%.
2. Change who runs the workflow
The Python helpers took over the routine work, but the agent was still in charge, loading instructions and context every time it ran the process. Even with less work to do, the workflow was still using roughly 170,000 tokens a month.
I put Python in charge of the coordination instead. Code ran the steps and called the model only when there was something to interpret. That brought monthly token use from roughly 170,000 to under 100,000, more than a 7-fold reduction. Across all the changes, usage fell from roughly 1.1 million tokens a month to under 100,000.

When the workflow runs but there’s nothing new to interpret, Python stops without calling the model. I no longer load an agent’s instructions just to find out there’s no work to do.
When there is new material and enough budget, I still get three or four proposals to review, and the factual records are saved as before. I’m still getting the help I wanted, with far fewer tokens.
I’d still consider letting an agent run a workflow that changes often. Starting that way gave me room to experiment. Once I knew which steps stayed the same, moving them into code made sense. Shorter prompts helped too, though they didn’t remove the cost of having the agent run the process.
3. Enforce the budget before calling the model
Finally, I set a monthly budget of 100,000 tokens per user, aiming to keep as much of the value as possible while putting a firm limit on usage. The architecture refactor reduced spend and the cap prevents more demand from turning into more model calls than the budget allows. Instead of telling the agent to use fewer tokens, I made the app check whether it could afford the next model call. If there isn’t enough budget, it saves the facts and leaves interpretation for later.
The workflow does two things: saves what happened and helps me make sense of it. Saving what happened doesn’t need the model, but connecting those records to earlier work or suggesting a possible learning takes a model call. So when the budget runs out, I can still capture new information while the interpretation has to wait.

For now, I think having the model interpret new material once a week will be enough, with the option to trigger an earlier run if there’s budget left. I may find that’s too long to wait for useful insights. If so, more frequent runs may be worth a larger budget, but I want to make that choice deliberately rather than let usage grow by default.
What I’ll remember for my next workflow
I started by running the workflow less often and giving it less to read, but that reduced its usefulness along with its cost. Moving routine tasks into Python helped me keep more of what I valued. Putting Python in charge of the process then removed the need for an agent to load instructions and coordinate every run. Together, those changes brought monthly usage from roughly 1.1 million tokens to under 100,000. The hard cap gives the workflow a way to stay within that budget when there’s more work than it can afford to interpret.
For the next recurring AI workflow, I’ll look at three things: which steps follow rules code can handle, whether the model needs to coordinate the process at all, and what should happen when the budget runs out. Smaller prompts can help, but they leave some responsibilities unchanged. I want to understand what I’m paying the model to do before deciding it needs more capacity.
I’d still start with an agent when I need room to experiment. Moving a settled process into code means maintaining those rules, and a hard budget means accepting that some interpretation may wait. Here, I’m willing to make those tradeoffs. I can keep capturing the facts, reserve model calls for making sense of them, and decide deliberately when more timely interpretation is worth spending more.

Discussion about this post