When people discuss the cost of n8n, many compare only the subscription price, then discover after a month in production that most of the bill comes from model calls. n8n itself orchestrates flows; the work of processing content usually happens in the model API behind it. The former is billed by plan or by server, the latter by tokens or requests, and the two cost structures are entirely different.
This article breaks n8n-related costs into four calculable blocks and gives estimation steps and controls. Actual amounts vary with plans, models, and exchange rates, so no fixed figures are given here; defer to the official n8n pricing page and the in-site model pricing.
Note: n8n is a trademark of its respective owner. This article is not affiliated with n8n and is intended as a technical and cost discussion only.
1. What the cost consists of
Start with a cost map so you do not fixate on the software subscription alone.
| Cost item | Billing basis | Easily missed portion |
|---|---|---|
| n8n Cloud subscription | Tiered by plan and monthly executions | Team size, overage executions, plan upgrades |
| Model API | Input and output token usage | Retries, repeated context, long outputs |
| Self-hosted infrastructure | Server, database, backups, bandwidth | Operations labor, monitoring, upgrades, security |
| Workflow operations | Debugging, reruns after failure, log storage | Repeated executions of unattended flows |
Of these four, the Cloud subscription is the most visible, the model API the least predictable, self-hosted infrastructure the most underestimated, and workflow operations often absent from the budget entirely. Calculate them together when looking at the total.
2. Cloud vs self-hosted: do not count only the software fee
The value of n8n Cloud is that it removes deployment, upgrades, backups, and availability maintenance. Plans are typically tiered by execution count, and going over means an upgrade or extra capacity. It suits small teams without dedicated operations staff who want to launch quickly.
The self-hosted Community edition can be deployed on your own and does not charge a per-seat subscription, but "free" refers only to the software license. The server, PostgreSQL, Redis in queue mode, object storage, backups, monitoring, logs, security patches, and upgrade windows are all real costs. n8n uses the Sustainable Use License (fair-code model), which places additional restrictions on redistribution and providing hosted services to third parties; read the license text before commercial use. If the team lacks operations capability, the total cost of self-hosting often exceeds expectations.
A simple test: if the value of the time spent maintaining the instance each month exceeds the difference in Cloud plan price, choose Cloud. If data must stay on your own network, flow volume is high, and the team has operations capability, then consider self-hosting.
3. Executions: the most underestimated variable
n8n plans are usually designed around "executions". A workflow run generally counts as one execution, but actual consumption is amplified by these factors:
- Polling triggers: scheduled checks may produce execution records even when there is no new data; check the rules for your version.
- Loops and sub-workflows: processing batch data item by item, or splitting logic into sub-flows, increases run counts.
- Failure retries: node retries and workflow reruns often count as executions again.
- Debug executions: repeatedly running manually in the editor consumes quota as well.
The ways to reduce executions are straightforward: use webhooks instead of polling where possible; merge batches instead of triggering item by item; deduplicate at the entry point; set sensible intervals for scheduled jobs; debug with a single sample first.
In an n8n Code node, you can also summarize model usage per call for later reconciliation:
// Summarize token usage for a single run (field names depend on the actual response)
const usage = $json.usage ?? {};
const input = usage.prompt_tokens ?? 0;
const output = usage.completion_tokens ?? 0;
return [{ json: {
input_tokens: input,
output_tokens: output,
total_tokens: input + output
// Unit prices are on the in-site pricing page; this only records usage
}}];
4. Pay-as-you-go API billing: where tokens go
The model API bill is determined by both input and output. Input is not just the user's sentence; it also includes the system prompt, conversation history, retrieved documents, tool definitions, and format instructions. Output is billed by generation length. Three common multipliers:
- Repeated context: every turn of a multi-turn conversation carries the history, so input cost accumulates over long conversations.
- Stuffing long documents: putting a whole contract or a full web page into the prompt makes each call expensive, and repeated calls make it worse.
- Retries and multiple versions: resending after a failure, or asking several models in parallel, multiplies usage.
The usual optimization order is: first tier your models, using cheaper models for classification, cleaning, and summarization and stronger ones for complex generation; then compress context and pass only necessary fields; then constrain output length with structured, brief answers; and only then consider caching. Some model vendors offer prompt caching that reduces the input cost of repeated prefixes; whether it is supported and how large the discount is depend on the vendor documentation.
5. Retries, caching, and hidden costs
Retries are necessary in automation, but they have two billing consequences: execution counts increase, and model requests may be charged again. Whether a failed request is billed depends on the upstream vendor; do not assume it is free. Keep retries to 2-3 attempts, use exponential backoff, and make write operations idempotent so messages or accounting entries are not duplicated.
Caching needs to be considered at two layers. Workflow-level caching stores "results", for example skipping a record that has already been processed; model-level caching stores "prefixes", such as a fixed system prompt and a long document. The former relies on a database or Redis, the latter on vendor capabilities, and neither substitutes for the other.
Several other items are often overlooked: execution history and workflow logs consume database space; image, audio, and transcription calls have separate pricing; and running a debug pass over the full dataset can instantly generate a large number of executions and tokens.
6. Budget control: limits, alerts, and review
Set boundaries in advance:
- Assign a separate API key per project or workflow for attribution and easy disabling.
- Set a monthly budget or usage cap on the gateway side, with alerts as thresholds approach.
- Write the
usageof each call to a spreadsheet or database and aggregate by workflow. - Set concurrency and retry limits specifically for high-consumption flows.
- Review the three most expensive flows every month for duplicate calls.
- Keep some headroom for business growth and price changes.
A unified OpenAI-compatible gateway consolidates keys, usage, and quotas from multiple model vendors in one place, so switching models does not require changing workflows. To try it, sign up first; models and prices are on the model pricing page.
7. A reusable estimation procedure
Do not quote from intuition; run through this sequence:
- Pick one representative workflow and take 20-50 real samples rather than fabricated test data.
- Count monthly triggers, including scheduled runs, webhooks, empty polling runs, and manual executions.
- Record input and output tokens for each call from the response and calculate the averages.
- Multiply by a retry factor, for example marking up by 20%-50% based on the historical failure rate.
- Add the monthly cost of the Cloud subscription or of servers, databases, backups, and log storage.
- Add the labor cost of maintaining the instance and troubleshooting failures.
- Review quarterly, since plan rules, model prices, and business processes can all change.
For example, if a flow triggers ten thousand times a month, thirty percent of which call a model, with an average of two thousand input tokens and five hundred output tokens per call, multiply three thousand calls by twenty-five hundred tokens to get roughly seven and a half million tokens per month, then convert at the current price of the chosen model. Check the model pricing page for unit prices; do not reuse figures from older articles.
FAQ
How does n8n Cloud count executions?
Usually each workflow run counts as one execution, but whether polling, retries, and manual runs count depends on the current plan rules. The safest approach is to watch the usage page of your account for a week, then estimate against your own trigger frequency.
Is self-hosted n8n really free?
The Community edition does not charge a per-seat subscription, but you bear the cost of servers, databases, backups, monitoring, and operations labor. Enterprise features require separate licensing, and you should confirm the restrictions of the Sustainable Use License before commercial use.
Why is the model bill much higher than expected?
Common causes include repeated context, batch loops that call per item, failure retries, and debug runs over full datasets. First look at the input-to-output ratio in the usage detail, then check whether any workflow is reprocessing the same record.
Are failed retries billed?
Execution counts usually increase; whether model requests are billed depends on the upstream vendor's rules. Limit retry counts, record the result of each request, and make write operations idempotent.
How do I set a budget cap for a team?
Split API keys by project, set monthly quotas and alerts on the gateway side, and feed usage logs into internal reports. When something looks wrong, disable the corresponding key first, then locate the specific workflow.
Next steps
Cost optimization for n8n comes down to two things: reducing unnecessary executions and controlling the tokens of each model call. Quantify both first, then decide between Cloud and self-hosting. To manage model keys, usage, and budgets in one place, start by signing up for ZSQH AI Gateway; prices are subject to the model pricing page.
Related reading:
