Take a 15-person trading company in France. An n8n workflow reads the supplier invoices that arrive by email. It extracts the invoice number, the due date, the net amount before VAT and the VAT, then prepares the accounting entry. A new supplier comes along with a different layout, so someone tweaks the prompt to handle it.
Since then, the execution history has been green from top to bottom. Three weeks later, the bookkeeper notices that invoices from long-standing suppliers were entered with the gross amount, VAT included, in the net amount field. The workflow never crashed. It was simply wrong, and every run looked clean.
This kind of drift often follows a change to the prompt or the model. To catch it in time, you need to test an AI agent the way you test software: on known cases, against an expected answer, with a score. Here is how to do that with n8n's evaluations, and what the tool does not guarantee.
Why error alerts are not enough
A workflow can fail in two ways. The first is visible: an API stops responding, the execution stops and the error workflow notifies someone. That is covered in n8n error handling in production.
The second is silent. The model returns well-formed JSON, with an amount that looks plausible. As far as n8n is concerned, everything went fine. As far as the company is concerned, a complaint has been filed under "Prospecting", or a draft reply promises a delivery date nobody approved.
An error alert tells you whether the workflow ran, not whether its output is correct.
What it means to test an AI agent
Testing an AI agent comes down to three things:
- A test set: a list of real inputs, for example 50 emails or 30 invoices, stored in a table.
- Expected outputs: for each input, the correct answer, written by the person who does the job today. "Complaint", "Billing", or the exact net amount.
- A metric: a rule that compares the agent's output with the expected output and produces a score.
Add a threshold: the score below which a change does not go to production.
A model can answer the same email differently from one run to the next: a single test proves very little, while the score across the whole set tells you much more.
Building a test set from real cases
How many cases. I recommend about twenty cases while you build, then 50 to 100 before going live for a triage or extraction workflow.
Which ones. Roughly two thirds ordinary cases, in their real proportions. The rest should be edge cases:
- for email triage: a message with two requests, a long forwarded thread, an email in another language, an irritated follow-up that reads like a complaint;
- for reading supplier invoices: a credit note, several VAT rates, a crooked scan, a foreign currency, a deposit invoice;
- every error spotted in production, otherwise it can come back with the next prompt change.
Expected outputs. Have them filled in by the person who knows the work, not by the person writing the prompt. If two people disagree on the right category, settle the rule before asking the model to follow it.
Personal data. Real emails and invoices contain names, addresses, IBANs and phone numbers. I recommend replacing them with fictitious values in the same format. The test set also becomes one more place where data is stored. The questions to ask are in GDPR and AI agents.
Quick checks or scored evaluations
Quick evaluations are for the build phase. According to the n8n documentation, the evaluation trigger runs the workflow once per row of the test set, and the Set Outputs operation writes each output back into a column of the table. You then compare expected and actual outputs by eye.
Metric-based evaluations take over once you go beyond a handful of examples, as the same documentation advises: each case gets a score, visible in the workflow's Evaluations tab. As soon as someone else relies on the result, I recommend a score and a threshold.
How n8n evaluations work
The Evaluation Trigger node. According to its documentation, it reads the test set from an n8n data table (the default) or from Google Sheets, and sends the rows through the workflow one after another.
The Evaluation node. According to its page, it offers three operations:
- Set Outputs writes the results to the test set's data table or Google Sheet;
- Set Metrics records the scores in the Evaluations tab;
- Check If Evaluating routes the execution depending on whether it is an evaluation or a normal run.
Putting it together. The workflow keeps its production trigger and gets the Evaluation Trigger as well. According to the documentation, when there are several triggers, you merge their branches, so the AI step being tested is the one used in production. Right after it, Check If Evaluating splits the paths: during an evaluation, you compute and record the metrics; in production, you apply the Gmail label or prepare the accounting entry.
Place that split before any real action. An evaluation that sends real emails or writes into the accounting system does real damage.
n8n's guide to evaluation in production applies this pattern to a classification task.
On duration, the metrics page gives the maximum number of test cases run in parallel: 1 (one after another) on self-hosted Community and Cloud Pro, 3 on self-hosted Business, 5 on Enterprise. Allow time for a hundred invoices to go through.
Choosing the metrics
n8n provides ready-made metrics, listed in the documentation:
- Categorization: exact match with the reference answer, 1 or 0;
- String Similarity: character-by-character closeness (edit distance), score between 0 and 1;
- Tools Used: whether the execution used tools, score between 0 and 1;
- Correctness and Helpfulness, rated 1 to 5 by a model: whether the meaning matches the reference, and whether the answer actually addresses the request.
You can also compute your own metrics in a Code node and pass them on with the Custom Metrics option.
| Agent output | Recommended metric | Limitation |
|---|---|---|
| Email category | Categorization | No nuance: "Billing" instead of "Accounting" counts as wrong |
| Fields extracted from an invoice | Custom metric, field by field, after normalization (amounts as numbers, dates in one format) | You have to write and maintain it |
| Output format | Custom metric: valid JSON, required fields present | Says nothing about the content |
| Text close to a reference | String Similarity | Two equivalent sentences worded differently get a low score |
| Free-form draft reply | Correctness by a model, plus human review | See below |
What a score from another model is worth
In my view, a judge model's score shows a trend and is not enough to make a decision. It can be lenient with a text that reads well but is wrong, score the same draft differently from one run to the next, and knows nothing about the company beyond the reference you give it. Computing metrics also adds latency and cost: the documentation suggests placing that computation after Check If Evaluating, so production runs do not carry it.
I recommend rule-based metrics wherever the right answer can be checked: category, amount, date, format. Use the judge model only for free text, after comparing about twenty of its scores with those of someone who knows the work. Never change it at the same time as the agent, or you will not know which one moved.
Setting the pass threshold
Decide the threshold with the person responsible for the process, in two forms:
- an overall score that the new version must not lower compared with the version in production, which means recording that score before any change;
- a list of critical cases that must all pass: a complaint never filed as a newsletter, a credit note never entered as an invoice.
Because the model does not always answer the same way, a small drop on 50 cases can be noise: allow a slight tolerance, or run the set a second time, before blocking a change over a minor score drop.
Which n8n plans include evaluations
The n8n documentation separates two cases for metric-based evaluations: on n8n Cloud, the Pro and Enterprise plans; self-hosted, the Enterprise plan. Registered Community Edition users and Starter plan users can use them on a single workflow. The pricing page says the same for Starter, Pro and Enterprise.
The Business plan, self-hosted only, is presented on the pricing page as including everything in the Pro plan, but the documentation does not list it among the plans with metric-based evaluations. The two pages do not settle the question: on a Business license, have n8n confirm this point.
Without full access to metrics, three options remain:
- Quick evaluations. According to their page, they are available on all Cloud plans and, self-hosted, on registered Community Edition, Business and Enterprise; the pricing page includes them on Starter, Pro and Enterprise. Evaluation Trigger and Set Outputs are enough, and you compare by eye.
- Reserve the single allowed workflow for the riskiest process, such as accounting or customer replies.
- A home-made test bench to get scores without the metrics feature: a copy of the workflow, run by hand, that sends each case of the test set through the AI step, compares the output with the reference in a Code node and writes the result.
When to rerun the tests
Rerun the full test set whenever any of these changes: the prompt (even by one sentence), the model or its version, n8n itself (see self-hosted n8n updates and security), the agent's tools or the sub-workflows it calls. For a new type of input, such as a supplier, a category or a language, add a few cases of that type first.
When an error surfaces in production: add the case, check that it fails, fix it, rerun everything. And open every failing case: sometimes it is the expected output that was wrong or ambiguous.
What stays with a human
The test set covers the past, while production brings new cases. I recommend reviewing a small random sample of real outputs every week, and adding the most useful ones to the test set.
Finally, a good evaluation does not replace human approval before sensitive actions: an email to a customer, a payment, a CRM update. An agent that passes almost every test is still wrong on the rest, not necessarily the least serious ones. See where to put human approval. Tests also offer no protection against prompt injection, content crafted to hijack the agent.
Checklist before putting an AI workflow into production
- At least 50 real cases, a third of them edge cases, with expected outputs written by the people who do the work.
- Personal data replaced, test set with restricted access.
- Check If Evaluating placed before any real action.
- Rule-based metrics for whatever can be checked, a judge model checked against human scoring for free text.
- A written threshold and the current version's score recorded.
- An active error alert for technical failures.
- Human approval before every sensitive action.
- Regular review of a sample of real outputs.
At Kirako, we design custom AI agents and n8n automations, and offer audits, consulting and training.
An AI workflow that never crashes can still get a little more wrong every week. A test set kept up to date and a threshold agreed in advance bring that drift to light before it reaches the bookkeeper or the customer.
Sources
Accessed on November 27, 2026:
- n8n: Evaluation node (Set Outputs, Set Metrics, Check If Evaluating)
- n8n: Evaluation Trigger node
- n8n: Run quick evaluations (quick evaluations, plans)
- n8n: Use metrics to measure quality (metrics, plans, parallel execution)
- n8n: Production AI Playbook: Evaluation and Monitoring
- n8n: pricing page (evaluations by plan)
Also available: Read in French