How the MasterContext agency automated client work reports on n8n
MasterContext automated its client reports for paid search: twice a month a bot pulls the data itself, calculates the metrics, and writes a draft conclusion. Zero tokens.
MasterContext, a paid-search agency from Krasnoyarsk, is #1 for paid search in its city by the Runet Rating and a certified Yandex partner. Among its clients are large franchise delivery chains, for example Yobidoyobi: the agency runs Yandex.Direct for them per city and per franchisee separately. In total MasterContext has around 140 clients on Direct setup, and for the Yobidoyobi chain alone the bot assembles about 90 reports.
Every client gets a work report twice a month. Before, a manager put it together by hand. Now the bot assembles the rough part before the team comes in to work.
In short
I built MasterContext a bot on self-hosted n8n that twice a month, at six in the morning, generates the client reports on paid search itself. It exports data from the Direct database, calculates the metrics that aren't in the ready-made BI, and writes a draft conclusion through a decision tree right in the code, with no neural net and not a single token.
The bot puts the finished report with all the numbers and a draft conclusion into a shared Google spreadsheet. The manager finds their client, adds their part, and sends it. The reporting cycle, which used to stretch over 1-3 days, is now ready to go through by morning.
What it was before
The agency has client managers, each with their own set of clients. Reports go out twice a month: on the 1st for the full previous month, on the 16th for the first half of the current one. And every time the manager did the same set of steps by hand:
- opened Yandex DataLens, where the agency's analytics are built;
- pulled the right figures for a specific city or franchisee;
- calculated by hand what DataLens doesn't have: cost of acquisition, efficiency, conversion, average check;
- assembled this into a report message in the usual structure;
- wrote the conclusion: the campaign is growing, holding steady, or dropped, and what to do about it;
- sent the finished report to each of their clients in Telegram.
One report took a fair amount of time, and there are nearly a hundred and fifty clients, each report with its own numbers. All told, the reporting cycle stretched over one to three days. The whole time, the agency's best people were doing not strategy but assembling tables by hand.
The problem wasn't only the time. When you assemble dozens of tables by hand twice a month, it's easy to slip on a number, mix up the comparison period, or miss a client. And a report is the agency's face to the client, so a mistake there is unpleasant.
Before and after
| Before automation | After automation |
|---|---|
| The manager assembled each report from DataLens by hand | The bot exports the data for all clients itself |
| Metrics not in the BI were calculated by hand | The bot calculates them itself by the same formulas |
| The manager wrote the draft conclusion from scratch | A decision tree prepares a draft comparison |
| The reporting cycle stretched over 1-3 days | By morning the reports are ready to go through |
| Numbers are easy to mix up in a manual routine | The calculation is the same for all clients |
| The team's time went into assembling tables | The team's time goes into analysis and decisions |
How it works now
For the managers, almost nothing changed on the surface: they still work with the spreadsheet and still send reports to clients. What changed is that by the time they arrive, the reports are already assembled.
The bot runs twice a month at six in the morning and does everything before the workday starts:
- exports data from the database that feeds Yandex.Direct, the same data DataLens is built on;
- gathers the right figures for each city and franchisee: impressions, clicks, reach, cost per click, cost per lead, conversions, spend;
- calculates the metrics that aren't in the ready-made analytics;
- lays it all out in a fixed report structure (financial totals, key metrics for search, the Yandex Ad Network, display ads);
- through a decision tree, writes a draft conclusion: compares the period to the previous one and formulates what exactly changed;
- puts the finished report into a shared Google spreadsheet that all the managers can access.

In the spreadsheet, each report has its own columns: client, client login, report period, comparison period, report text, result, and manager. The manager finds their row, sees the ready numbers and a draft conclusion, and is left with the most important part: check it, add their judgment, and send.

A decision tree instead of a neural net
The most interesting thing in this project isn't the volume, it's how the conclusion is written. The temptation was obvious: hand the numbers to a neural net and ask it to "write a conclusion for this report". We deliberately didn't do that.
An ad report isn't an essay, it's a comparison of numbers by clear rules. If revenue grew compared to last month, there are more conversions, and the cost per conversion went down, the conclusion is the same: more conversions at a lower cost, an excellent result. If conversion dropped but there are more leads, the wording is different. All these branches can be described in advance.
So I wired the conclusion logic as a decision tree right in the code. The bot walks through the conditions ("this and that metric → this wording") and assembles a draft comparison itself. The manager adds the reason for the result and the action plan, because that's already about judgment, not arithmetic.
What this gives:
- zero tokens. No neural net is involved in the conclusions, so there's nothing to pay for;
- predictability. On the same numbers the conclusion is always the same, nothing drifts or gets made up;
- speed and cost. A decision tree in code runs instantly and costs exactly nothing beyond the server.
This is probably the main idea of the case. Automation doesn't have to be "smart" and expensive to pay off. Sometimes the most reliable solution isn't a neural net but carefully described rules.
Why the reports don't go to the client on their own
Technically the bot could send the finished reports to clients in Telegram itself. We deliberately didn't do that, and it was the agency's own condition.
The client's logic is this: if reports fly out automatically, the manager will stop reading them and turn into a "forward" button. And the agency's value is exactly that a live person looks at the numbers, understands the specific client's context, and adds a conclusion a machine won't make.
So the bot brings the report to the state of "everything calculated, draft conclusion ready" and leaves it in the shared spreadsheet. After that it's the human: the manager finds their client, studies the report, adds the reason and the plan, copies it, and sends. The bot took the assembly, the judgment stayed with the human. Exactly the way the client wanted.
The result
| Metric | Before | After |
|---|---|---|
| Who assembles the report | The manager, by hand | The bot, before the team arrives |
| Reporting cycle | 1-3 days | Ready by morning |
| Scale | ~140 clients, ~90 reports for Yobidoyobi | the same volumes, assembly runs itself |
| Risk of error in manual assembly | High, all by hand | The calculation is the same for all clients |
| Conclusion | Written from scratch | Draft ready, the human finishes it |
| Cost of running the bot | - | ~$5 a month for the VPS, zero tokens |
| What the team does | Assembles tables | Analyzes and decides |
The main thing here isn't that the bot "makes reports for people". It does the boring part: the export, the calculation, the assembly, the draft comparison. And the thing the client actually pays the agency for, the judgment and strategy, is still done by a human, who just now has the time for it.
Where this can be moved to
This setup isn't only about Yandex.Direct and isn't only for agencies. It suits almost anyone who regularly assembles same-type reports by clear rules:
- agencies and marketing departments with a stack of clients or projects;
- any recurring reports on ads, sales, finance;
- situations where the data is in the system, but a person spends days assembling it into a report by hand.
There's no tie to specific tools here. If the data can be exported, the metrics calculated, and the conclusion rules described in words, the same kind of bot will come together for your system: another ad platform, another BI, another spreadsheet.
If you have recurring reporting that someone assembles by hand by the same rules, this setup can be built for your tools. I'll honestly look at which part is worth automating and which is better left to a human.
Write to me on Telegram or leave a request. Tell me how your reports work now, and I'll break down for free what can be assembled automatically there.
Stack
FAQ
- Why does a decision tree in code write the conclusion, not a neural net?
- Because an ad report isn't creative writing, it's a comparison of numbers by clear rules. If revenue grew, there are more conversions, and the cost per conversion is lower, the conclusion is unambiguous. That kind of logic is cheaper and more reliable to describe in code: zero tokens, a predictable result, nothing made up and nothing drifting from run to run.
- Why don't the reports go to the client in Telegram automatically?
- That's what the client wanted. The condition was direct: managers shouldn't forward reports blindly. So the bot puts the finished report with the numbers and a draft conclusion into a shared spreadsheet, and the manager finds their client, reads it, adds their part, and sends it themselves. It's deliberate human-in-the-loop, not an oversight.
- How much does it cost to keep this process running?
- The only ongoing cost is a small VPS, around five dollars a month. No neural net is used in the conclusions, so there's nothing to pay for tokens. The bot runs on the same infrastructure as the agency's other scenarios, so there's no need to keep a separate server just for reports.
- Can the same thing be built for another ad channel or another reporting system?
- Yes. Here the source is the database Yandex.Direct and DataLens are built on, but there's no hard tie to them specifically. If the ad data can be exported, the metrics calculated, and the conclusion rules described, the setup transfers to another channel, another BI, or another report format. The export layer and the set of rules change.
- What about the confidentiality of the agency's clients?
- The agency itself, MasterContext, we name openly. But the specific numbers and client identifiers in the report screenshot are hidden, and we keep it that way. The data doesn't go to external services for a nice conclusion: everything is calculated on the agency's infrastructure, and the reports sit in their own working spreadsheet.
- How often and when are the reports generated?
- Twice a month. On the 1st the bot assembles a report for the full previous month, on the 16th for the first half of the current one, both times compared to the prior period. It runs at six in the morning, so that by the start of the workday the finished reports are already in the spreadsheet and the managers just have to go through them.
Want to automate something in your business?
Tell me what you're sick of doing by hand. 30 minutes for a brief, then a concrete offer or an honest no if it's not my kind of task.