How to Cut n8n AI Agent Token Costs by Half

November 17, 2026

The token bill on an n8n AI Agent workflow comes mostly from three places: long system prompts repeated every turn, chat memory that never trims, and agents that call four tools when one would do. Fixing those three typically halves monthly spend. The platform licence is rarely the problem — self-hosted n8n is free, and Cloud starts near €20 a month, while a busy agent can cost several times that in API fees.

Here is what to change, in order of impact.

Why is my n8n agent so expensive?

Because every turn resends the entire conversation plus the tool schemas. If your system prompt is 1,200 tokens and you have ten tools with 100-token descriptions each, that is 2,200 tokens of overhead before the user types a word — every single turn.

Ten turns in a session, eighteen sessions a day, and the overhead alone is 396,000 tokens. That is the number to attack.

Which settings cut tokens the most?

  • Trim the system prompt. Rewrite to under 400 tokens. Remove examples the model does not need, keep the rules that prevent wrong tool choice.
  • Cap memory. Set the memory node to a fixed window (last 6-10 messages) instead of unlimited. Unlimited memory grows cost linearly with conversation length.
  • Prune tools. Under eight tools. If a tool is used once a week, move it into a separate agent.
  • Use cheaper models for routing. A small model to classify the request, a frontier model only for the answer.
  • Set a max iterations value on the Agent node so a loop stops at 5 steps, not 30.

How do you measure the savings?

The Agent node logs token usage per run in its output. Turn on execution logging (or save executions to Postgres) and export a week of runs before and after. Typical result from these five changes: total tokens down 40-60%, answer quality essentially unchanged.

If quality drops, the usual cause is a system prompt that got too terse. Add back one or two tool-selection rules, not the whole example block.

Cheap model or cheap workflow — which first?

Workflow changes first, always. Downgrading to a small model on a badly designed workflow gives you cheap bad answers. A tight workflow on a mid-tier model usually beats both.

There is a floor, though. Tool-calling reliability on small models degrades fast. If your agent needs to call HTTP Request with constructed JSON bodies, keep a frontier model there.

When is n8n the wrong choice for cost reasons?

If you run a single prompt with no tools, n8n adds a layer you do not need — call the API from a 30-line script. n8n earns its place when the agent has to touch multiple systems and you want retries, logging and visual debugging. Those features cost tokens in prompt overhead, and that is a fair trade only when the workflow genuinely needs them.

Quick Summary

  • Prompt overhead per turn is usually 2,000+ tokens; cut it to under 700.
  • Fixed memory windows beat unlimited history on cost.
  • Under eight tools; separate agents for rarely used actions.
  • Set max iterations to 5 to kill loops.
  • Expect 40-60% token savings from prompt and tool pruning alone.

Model support and node options are listed on the n8n AI Agent tool page.