From the ERP to the sales commission report: an agentic system for CFOs

This week a full finance process ran end to end on my system: sales commissions, for a company with a sales team across several countries, entities and currencies. I typed one prompt, "run the pass". About an hour later the team had the final report they work from.
Here is how it is built, and how you could build the same for your own flows.
The process: sales commissions, far from a simple percentage
On paper it is a percentage of sales. In practice it is a complex process, and it can go wrong in many places:
- each salesperson has their own negotiated deal, and there are several types of rules
- for some deals, the rate depends on the rank of the sale in the month: from a given sale onwards, the salesperson earns a higher rate
- that rank counts across all entities
- an unpaid invoice holds its rank but pays nothing
- amounts come in several currencies
Before, it took the equivalent of about three days of one person's work every month. That adds up the calculations across geographies, the checks, the back-and-forth to explain each difference, and the sending.
The structure of the workflow

There are two layers. The first workflow extracts revenue from the ERP (sales invoices and credit notes) into audited, agent-ready data. The second, the commission pass, runs on that data and on a rules master written in plain language and fed by meetings and mails.
The controls follow four ideas:
- Completeness. Before collecting, a separate agent reads control figures straight from the ERP, blind to ours. A script then compares them with what was extracted. If they differ, the pass stops.
- A second independent path recalculates everything from the data.
- The chain stops itself on any unexplained failure. It does not warn and carry on.
- Drift checks run before any calculation, on two points: has the structure of the source changed, and has the rules master changed since it was validated?
The agent never reads the data rows. It reads the dictionaries and runs scripts that print totals. No number travels through its context window so the model can never misread, round or hallucinate one.
The final output is treated as the work of an experienced analyst
Most AI workflows give you a draft at about 80%. You don't trust it enough to send it without doing a deep and exhaustive revision. This one gives a final output. It is not "I built a financial model with one prompt and then I polished it so it saves me X hours". The two are not comparable.
The right comparison is an experienced analyst who has been in the company for more than a year. They have sat in the management meetings where salesperson deals are renegotiated and people join or leave, and they spend a day producing the monthly calculation in Excel. As a CFO you receive it, read the report, and dig only where something surprises you. I treat the final output as the work of an experienced analyst. The report goes down to every invoice, so reading it is enough to see how each one was taken into account.
What about the quality of the ERP data?
The system does not fix the data in the ERP.
It handles it: an unknown label stops the chain, an odd value is flagged, and a case outside the rules comes out as a question.
This month that meant a provisional report first. Then came a short round of questions to the team, drafted by the agent and sent by me. The same agent received their answers and integrated them. Then came the final report, really final. None of it weighs on me.
Because those cases land in the living context, they feed back into how the processes are adjusted and how the team is trained. Next time, the same case is handled upstream.
Excel is dead, long live Excel
Excel is no longer the working medium, nor the vehicle of the information. The pass produces two outputs. The main one is the agent-ready data, ready for whatever comes next: the report, an analysis, a presentation, a question. The second one is generated by the same pass, with no one touching it: a spreadsheet where every amount is a live formula pointing to the source data, and every line links back to its invoice.
Excel stays as a side tool: the spreadsheet is the simplest interface for finance professionals to see the data flow, the formulas and the results when a deep audit is needed. As with an experienced analyst, I ask the agent first, and open the spreadsheet only when I am not convinced.
Testing the rule itself
This month, as a transition, the team ran their own calculation in parallel. From now on the system takes it all on. The parallel run showed, line by line, where hand calculation naturally drifts: an amount taken from the bank instead of the invoice, a commission split in two instead of paid at once, a transposed digit. Even a good analyst makes these slips after a long day in Excel.
The point of the comparison is not to check the calculation: the controls already do that. It is to catch a field rule that never made it into the master. Early in the build, it caught one: the rank was counted on the ground in a way we had not written down. No internal check could see it, because every check applies the rule as written. Only a calculation kept by someone else shows you a rule you don't have.
The same goes for an exception decided orally and never passed on: nobody, agent or person, can apply what was never written down.
The structure you can reuse
Building this took tens of hours. Someone will say: "I build it in Excel in two hours and run it in four hours a month, so tens of hours pay back in two years." My answer: the hours built a method so that agents now build the next workflows more autonomously.
In broad lines, the structure is always the same:
- Extract the source into audited, agent-ready data, with controls.
- Write the rules in a plain-language master.
- Let scripts decide which lines, and in which order.
- Let formulas compute the amounts, with nothing typed by hand.
- Let controls stop the chain.
- Produce a report traced to the source.
- Run in parallel against a calculation kept by someone else, to test the rule itself.
What I really transposed is not this list. It is a meta-skill: a set of instructions the agent follows to create these workflows. A new flow is no longer designed from scratch. It starts from one design and adds its own specifics. The more I refine the meta-skill, the faster new flows get built.
In a next, more technical post I will cover the standard workflow for extracting structured data to feed the living context architecture.