FP&A Practice Financial planning, models as code, and AI agents — from practice, not marketing.
home / models-code

Your financial model deserves source code

Infrastructure got Terraform. Data got dbt. BI got LookML and TMDL. Planning — the discipline where a wrong number costs the most — is still clicking. It's time for FML.

Farseer is used in this example because it is the platform I build and work with.

The strange exception

Ask a planning team to show you “the model” and watch what happens. Someone opens a tool and starts walking you through screens: a dimension here, a formula behind this cell, a rule someone configured two admins ago. The model unquestionably exists — it computes millions of cells a day — but it exists only as application state. There is no document that is the model. There is only the tool, remembering what everyone clicked.

Finance is the last major modeling discipline where this is still normal. And it’s not normal because the models are simple — a mid-size planning model easily carries hundreds of variables across a dozen dimensions, with more interdependency than most microservices. It’s normal because no vendor ever gave the model a source form.

What state-without-source actually costs

Every pain that planning teams treat as the cost of doing business traces back to this one gap:

You cannot diff it. “What changed in the model since the board pack?” is answered by memory and archaeology, not by a two-second comparison. You cannot review it. A colleague’s change is invisible until a number moves — there is no artifact to read before it lands. You cannot explain it later. The why behind a modeling decision lives in a Slack thread that scrolled away; the model itself records only the end state. You cannot test it. Refactoring a live planning model feels like surgery without imaging — so nobody refactors, and models calcify. And when the one person who holds the model’s mental map leaves, the map leaves with them.

Every other discipline already solved this

The pattern even has a name: as code. It repeats every few years, in category after category — a domain drowning in hand-configured state gets a declarative, human-readable language, and within a few years working any other way looks reckless.

DisciplineIts “as code” momentSince
InfrastructureTerraform — servers and networks declared in text, applied by plan2014
Data transformationdbt — pipelines as versioned SQL, tested in CI2016
BI semanticsLookML — the metric layer as reviewable code2013
BI semantics, mainstreamPower BI TMDL — semantic models as git-diffable text2024
Financial planning— still clicking —?

The planning category has flirted with the idea without committing. IBM’s TM1 keeps rules in text files — versionable, but imperative fragments of a model, not the model. Anaplan’s ALM synchronizes a dev model into production — lifecycle management without a readable source: you can promote a change, but you still can’t read it. Governance tooling grew up around the models; the models themselves never became legible.

Enter FML

FML — a Financial Modeling Language — is the missing source form: the entire model declared as plain, structured text. Variables with their business grain, dimensions and their relationships, formulas, planning sheets. Not an export. Not documentation that drifts. The model itself, round-tripped losslessly with the live platform: pull the model into files, change the files, validate, push.

A revenue module, complete, in four statements
variables/revenue.fsl
# grain declares WHERE a number lives; the FK graph does the roll-ups
link SKUs -> Brands

“Quantity IN” { Clients, SKUs, Versions, Years, Months } “Unit Price IN” { SKUs, Versions, Years, Months } “Revenue OUT” { Clients, SKUs, Versions, Years, Months } = “Quantity IN” * “Unit Price IN” @readonly

The planner’s experience doesn’t change — the grid, the sheets, the drill-downs all remain. What changes is that underneath the clicks there is now a record. And a record changes everything around the model:

A model change, as your team would actually review it
git diff · variables/revenue.fsl
  "Revenue OUT" { Clients, SKUs, Versions, Years, Months }
-     = "Quantity IN" * "Unit Price IN"
+     = "Quantity IN" * "Unit Price IN" * (1 - "Discount % IN")
+ # CR-142: contract discounts move from post-hoc adjustment into the model

That diff is a review, an audit trail, and an explanation — in six lines. Try producing any one of the three from screenshots.

With a source form, planning inherits the entire software toolchain for free: version history with the reason attached to every change; peer review before a formula touches production; dev-to-prod promotion as a diff you can read instead of a sync you must trust; regression tests that pin last quarter’s reconciled totals before a refactor; reusable module templates instead of rebuilding the same P&L logic per entity.

Then there’s the reason this can’t wait: AI

AI agents are already writing production code, reviewing pull requests, and running data pipelines. They will do the same for planning models — but agents operate on text. A model that exists only as UI state is invisible to them: the best an agent can do is puppet the same clicks a human would, with none of the safety.

Give the model a language and the relationship inverts. An agent can read the whole model in seconds, propose a change as a diff, validate it against the dimension graph before anything touches the live system, and hand a human a reviewable artifact to approve. Dry-runs, environments, and per-change confirmation come with the paradigm. That’s the difference between “the AI edited my model” as a horror story and as a Tuesday.

“But finance people don’t write code”

They don’t have to. Nobody retires the UI — planners plan exactly as before. The language is not an interface you must use; it’s a record that finally exists. It’s read far more than written: by the reviewer approving a change, by the auditor asking what moved and when, by the consultant onboarding onto a model in an afternoon instead of a month, and — increasingly — by an AI doing the mechanical work under human review. Declaring Revenue = Quantity × Price at a stated grain is not programming; it’s the discipline finance always wanted, in the notation finance already thinks in.

The inevitable part

Every category on the list above had its holdouts, and every holdout’s argument was the same: our users aren’t developers. It never mattered, because as-code was never about turning users into developers — it was about giving the artifact that runs the business the same accountability we demand of every other system of record. Planning models forecast the company, allocate its capital, and set its targets. They are the last business-critical system still governed by memory.

FML is how that ends.

ZD
Zrinko Dolić

Co-founder of Farseer

15+ years in FP&A and planning platforms. I write about models as code, AI agents, and lessons from enterprise rollouts. Farseer appears in my examples because it is the platform I build and work with.