Learn · Guide · DuffBeauty's platform
How the accounting agent is built, step by step
This page follows the data from the source systems to the bookkeeper. At each step it shows what runs, why we chose it, and what keeps it safe.
← The case: an accounting agent on Google Cloud
- Runs
- every night
- Last run
- about 10 minutes
- Cost per run
- about $0.11
Measured on 28 October 2026 on one nightly run; the cost is at Google Cloud list prices.
Step 1
What comes in
Every night the platform reads the inventory and ERP system, the webshops, the accounting system, the card payments, the bank and the day's exchange rates. A pay-later source is built and waits to join the nightly run.
Why this choice
Each system has one shared client, so every pipeline talks to a source the same way, and a change in a source's API is fixed in one place.
What keeps it safe
Access to the sources is read-only, and the code enforces it: a pipeline can never write back into a system of record. When a source changes, the pipeline reports it instead of guessing.
Inventory · Rackbeat
stock, orders, invoices
Webshops · Shopify
orders, payouts
Accounting · e-conomic
ledger, drafts, documents
Card payments · AltaPay
card settlements
Bank
statement export via a drive
Exchange rates · ECB
daily rates
Pay later · Klarna
built · not nightly yet
pulled every night
Step 2
The nightly run
A scheduler starts one workflow each night. Small jobs pull each source and load it. Then the transform step rebuilds the tables and runs its checks. The daily mail goes out only when every check has passed.
Why this choice
It is the smallest set of services that runs a nightly pipeline reliably, with no orchestrator to operate.
What keeps it safe
The checks stand between the data and anyone who reads it. A failed check stops the mail, and every run leaves a receipt.
Scheduler · Cloud Scheduler
starts the run at night
starts
Extract and load
small jobs · Cloud Run · raw files kept as evidence
then
Transform · Dataform
tables, views and checks
only if the checks pass
Daily mail job
reads one prepared view
loaded and copied
Step 3
Where the data lives
Every raw response is copied to a file store exactly as it arrived. The warehouse keeps the data in layers: raw as received, staging cleaned and typed, intermediate with the business rules and matches, and core and marts with the tables finance reports and books from. A separate ops area holds the run receipts and the audit log.
Why this choice
Every finance-ready figure traces back through the layers to the raw file it came from.
What keeps it safe
The raw files are the evidence: when a figure is questioned, the file it came from is still there. All of it stays in the EU, in the company's own Google Cloud project.
File store · Cloud Storage
every raw response, kept
Warehouse · BigQuery, EU
raw
as received
staging
cleaned and typed
intermediate
business rules, matches, checks
core · marts
tables for reporting and bookkeeping
ops
run receipts · audit log
read through the ways in
Step 4
The ways in
Nobody reads the warehouse directly. People and agents come in one of three ways: a data connection for questions, a drafts connection for the bookkeeping agent, and the daily mail. Both connections are MCP servers. An MCP server is a program that gives an AI assistant a defined way to read your data and, where allowed, act in a system. They run in the company's own cloud.
Why this choice
Each person signs in as themselves, so access is per person and can be withdrawn in one place.
What keeps it safe
Each role gets a tier with its own datasets and limits. Every call is logged, and if the log entry cannot be written, no answer goes out. The drafts connection can only write drafts. It can never book.
Data connection · MCP
own cloud · Cloud Run
- sign-in per person
- a tier per role, with limits
- query and export
- every call logged
Drafts connection · MCP
- writes drafts only
- never books
- every call logged
Daily mail
webshop vs inventory gaps
used by
Step 5
Who does what
The operator runs and changes the platform. The finance team asks questions in their AI assistant. The bookkeeping agent prepares entries and writes them as drafts into the accounting system. The bookkeeper reviews the drafts and books them in the accounting system they already use.
Why this choice
Nothing is posted until a person approves it, in the place where they already work.
What keeps it safe
The only orange line on the map is the one that writes into a business system, and a person stands at the end of it. Each role's card shows what it can see and do, and its limits.
Operator · one account
- Through
- AI tools (Claude Code, Codex) → data connection
- Can see
- all datasets, all companies
- Can do
- queryexportrun
- Limits
- a daily scan limit; source extracts capped per day
Finance team
- Through
- AI assistant (Claude) → data connection
- Can see
- the finance datasets
- Can do
- query
- Limits
- read only; a cap per query and per day
Analytics · no members yet
- Through
- the same connector → data connection
- Can see
- the analytics datasets
- Can do
- query
- Limits
- a daily scan limit
Bookkeeping agent · one writer account
- Through
- AI agent (Claude) → drafts connection
- Can see
- journals and drafts; prepared webshop lines
- Can do
- write draftsimport
- Limits
- a cap per call; imports run as a dry run first; can never book
→ writes drafts intoAccounting · e-conomic · drafts; read back each nightBookkeeper
- Through
- the accounting system (e-conomic)
- Can see
- the agent's drafts
- Can do
- review and book
- Limits
- outside the platform
Finance, by mail
- Through
- a mail each morning
- Can see
- yesterday's webshop–inventory differences
- Can do
- read and follow up
- Limits
- sent only if the checks pass
Step 6
How it was built, and how it changes
A builder agent wrote the pipelines, the checks and the connections, inside the project's own rules: a written scope before any pipeline, checks per table, and a record for every decision. The operator reviews each plan and approves it before anything changes.
Why this choice
The operator approves a plan instead of writing pipelines by hand, and no change reaches the cloud without that approval.
What keeps it safe
Code ships from Git through Cloud Build. There are no service-account keys anywhere, and each pipeline and connection runs as its own identity with only the rights it needs.
Sources
- Google Cloud: Cloud Scheduler documentation
- Google Cloud: Workflows documentation
- Google Cloud: Cloud Run documentation
- Google Cloud: Dataform documentation
- Google Cloud: BigQuery documentation
- Google Cloud: Cloud Storage documentation
- Google Cloud: Cloud Build documentation
- Model Context Protocol specification
Walk-through written 28 October 2026 from the platform as built; the figures were measured the same day.
DuffBeauty has agreed to be named and has accepted the detail and the figures shown here.
If you want to see how this would fit your own systems, we can go through it together, with your IT, in-house or your IT partner.
Book a conversation