Implementation Engagement · System Design

Six feeds, one warehouse, fourteen signed definitions, and a close pack that drafts itself

The system design behind the month-end close engagement: a four-part named stack, the nightly pipeline from six sources to one PostgreSQL warehouse, the metric definitions layer that ended the metric wars, a reconciliation agent that flags and never fixes, and the exact scope boundary.

Six sources that never agreed, reconciled by hand every month. The system replaces the hands with a pipeline.

Every night, one service pulls all six sources into one warehouse. One metric layer computes every number from definitions the founder and CFO signed once. A reconciliation agent flags disagreements between sources for human review. The dashboard and the close pack read from the same views, so the month-end pack is a review, not a rebuild. The accounting ledger stays untouched.

6
sources that had to agree and never did: Shopify, Amazon settlements, 3PL WMS, freight invoices, processor payouts, the returns log
38 → 0
manual copy-paste steps per close. A 12-point review checklist replaces them.
3 → 1
versions of "net sales." One signed definition, encoded once, read everywhere.

Three weeks to build. First assisted close in week four.

Weeks 1-3 build the pipeline, the definitions layer, and the reconciliation checks against live data. The first close on the new system runs in week 4, side by side with the CFO. The target the design is built around: 3 days of close work becomes 4 hours.

Weeks 1-3
build: ingest live from all six sources, definitions signed and encoded, flags tested on real loads
Week 4
first assisted close: the pack drafts itself at 7am on day one of the month
~10 min/day
CFO review of reconciliation flags. Nothing auto-corrects, ever.

Four parts. Nothing speculative, nothing replaced that works.

Built code-first: AI-assisted development ships a pipeline like this in days, and code is easier to deploy, version, and test than a no-code chain. Clients who want a visual tool they can self-serve get the same design on n8n instead.

1 · Automation backbone

Nightly ingest service

One small deployable service. Pulls all six sources every night into a PostgreSQL warehouse: Shopify exports, Amazon settlement reports, the 3PL WMS export, freight invoices, payment-processor payouts, and the returns log. Raw loads land as-is; nothing is edited on the way in.

2 · The centerpiece

Metric definitions layer

14 definitions argued once in a two-hour workshop, written down, signed by the founder and the CFO, and encoded as SQL views. Every number on the dashboard and in the close pack is computed here and nowhere else.

3 · Built and supervised

Reconciliation agent

Every night, after the loads finish, it checks the sources against each other and drafts a discrepancy note per flag. The CFO reviews flags in about 10 minutes a day. It flags. It never corrects. Nothing auto-corrects, ever.

4 · The outputs

Daily dashboard + close pack

A 7am ops dashboard every day, and a month-end close pack that assembles itself from the same views on day one of the month. The accounting ledger stays untouched; this is the operating layer above it.

The nightly pipeline, and the human guardrail beside it

The main line runs without anyone touching it: sources in, warehouse, signed definitions, outputs out. The reconciliation rail is where judgment lives. The CFO review node is not a formality; it is the reason the agent can run at all.

Automation AI draft Human guardrail Signed definitions
Six sources

The feeds that never agreed

Shopify · Amazon settlements · 3PL WMS · freight invoices · processor payouts · returns log.

Nightly ingest

One service, every night

All six sources pulled on schedule. No exports, no pasting, no date-range fixes by hand.

Warehouse

PostgreSQL, one schema

Raw loads kept exactly as they arrived. Every number is traceable back to its source row.

Metric layer

14 signed definitions in SQL views

The only place a metric is computed. Signed by founder and CFO. No tab math anywhere.

Outputs

7am dashboard + close pack

The daily dashboard and the month-end pack read the same views. One truth, two speeds.

Side rail · nightly reconciliation, human reviewed
Trigger

Loads complete

The rail fires only after all six nightly loads land in the warehouse.

Reconciliation agent

Cross-source checks, flags drafted

Shipment counts across Shopify and the 3PL, settlements against orders, inventory deltas. One discrepancy note per flag.

Human guardrail

CFO review

About 10 minutes a day. The CFO resolves or assigns every flag. Nothing auto-corrects, ever; the warehouse rows stay exactly as loaded.

Resolution log

Into the close pack

Flags, resolutions, and open items land in the reconciliation appendix, with owners.

The accounting ledger sits beside this pipeline, not inside it. It stays the ledger of record, untouched. The pipeline is the operating layer above it, and the reconciliation rail is why the two agree at the seams.

The argument that ended the metric wars

14 definitions · one two-hour workshop · two signatures · 3 versions of "net sales" reduced to 1. The fix was definitions plus plumbing, not effort.

Before the build, "net sales" meant three different things depending on who built the tab. The founder had one number, the CFO had another, and the master workbook had a third, and every month one full day of the close went to arguing about which was right.

Week one of the build included a two-hour definitions workshop: founder and CFO in the same room, every contested metric argued once, on the record. The output was 14 plain-English definitions, written down and signed by both. Then each one was encoded as a SQL view in the warehouse. Every dashboard tile and every close-pack page reads from those views and nowhere else.

The argument cannot recur, because the number can no longer be rebuilt by hand. Anyone who disputes a figure is disputing a definition they signed, and the change process is a signature, not a spreadsheet.

The lesson of this engagement: the close was never slow because people were slow. It was slow because six sources spoke different languages and nobody had signed a dictionary.

#DefinitionAs signed, in plain EnglishEncoded as
01 Net sales Gross order value minus discounts, refunds, and marketplace fees, recognized on ship date, computed the same way for all three channels. metric_net_sales
02 Landed cost Supplier unit cost plus inbound freight, duties, and prep, averaged per SKU per receiving batch. metric_landed_cost
03 True freight per order Actual carrier invoice cost allocated to each shipped order, not the rate-card estimate and never a monthly guess. metric_freight_per_order
04 Return rate Units received back at the 3PL divided by units shipped in the same period, counted on warehouse receipt, not on customer claim. metric_return_rate
05 Channel margin Net sales minus landed cost, fulfillment cost, and channel fees, per channel per month, so DTC, Amazon, and wholesale are finally comparable. metric_channel_margin
06 Sellable inventory On-hand units at the 3PL minus damaged, reserved, and quarantined units, counted from the WMS, not the storefront. metric_sellable_inventory
07 Weeks of cover Sellable inventory divided by the trailing eight-week average of weekly units shipped, per SKU. metric_weeks_of_cover
08 Fulfillment cost per order 3PL pick, pack, and materials fees plus true freight, divided by orders shipped in the period. metric_fulfillment_cost

Eight of the fourteen signed definitions, shown as they read in the signed document. The remaining six cover the same ground for wholesale terms, refunds, exchanges, ad-spend attribution windows, payout timing, and SKU-level contribution.

The reconciliation agent: flags only, about 10 minutes of human review a day

This is the entire specification the agent operates under. The guardrail row is the design: an agent that only flags can be trusted with the whole pipeline, because the worst it can do is ask a question.

Trigger Nightly source loads complete. The agent never runs against a partial load.
Action Cross-source checks: shipment counts across Shopify and the 3PL WMS, Amazon settlements against Amazon orders, inventory deltas against shipments and returns received. Drafts one discrepancy note per flag, with the two source rows that disagree.
Guardrail Nothing auto-corrects, ever. The agent flags; it does not fix. Warehouse rows stay exactly as loaded, and no metric view is ever adjusted by the agent.
Human role The CFO reviews the flag queue in about 10 minutes a day: resolve, assign an owner, or leave open. Resolutions and open items flow into the close pack's reconciliation appendix.
Failure mode False-positive flags after a source changes format, for example a renamed column in the 3PL export. The flag queue gets noisy; nothing in the warehouse or the pack is ever corrupted, because the agent cannot write.
Rollback Flag rules pause per source, not system-wide. The affected feed reconciles manually until the rule is fixed; the other five sources keep their nightly checks.

Three weeks of build, one assisted close, and a boundary that is part of the design

Weeks 1-3 build against live data. Week 4 is the first close on the new system, run side by side. The scope boundary earns trust the same way the agent does: by refusing to do the things that would make the system dangerous.

Week 1

Sources connected, definitions signed

Ingest live from all six sources into the warehouse. The two-hour definitions workshop runs this week: founder and CFO in the room, 14 definitions argued once and signed.

Week 2

Metric layer encoded

All 14 signed definitions built as SQL views and checked against the old workbook, difference by difference, so the cutover month reconciles to the last manual month.

Week 3

Reconciliation and outputs live

Nightly cross-source checks running on real loads, flag rules tuned, the 7am dashboard live, and the close pack generating in draft.

Week 4

First assisted close

Day one of the month, 7am: the pack drafts itself. The close runs with the CFO on the new checklist: flag review, walkthrough, publish.

Included

  • The four-part stack, built and deployed: nightly ingest service, metric definitions layer, reconciliation agent, dashboard and close pack.
  • The definitions workshop, facilitated, with the signed document as a deliverable.
  • The week-4 assisted close, run together.
  • A written runbook and walkthrough at handoff.

Not included

  • No accounting-system replacement. The ledger stays exactly where it is.
  • No BI platform. The client needed six feeds, 14 definitions, and one pack everyone reads, not a tool license.
  • No auto-corrections. The agent flags; humans decide. That line never moves.

Client inputs

  • Access to the six sources: Shopify, Amazon, the 3PL WMS export, freight invoices, processor payouts, the returns log.
  • The two-hour definitions workshop, with both the founder and the CFO in the room. Not one or the other. Both.
  • One named decision owner for definition disputes after signing.

Definition of done

  • Behavioral, not contractual: two consecutive closes at 4 hours or under, with zero post-publication corrections.
  • The pack drafts itself at 7am on day one of the month, both months.
  • CFO flag review holding at about 10 minutes a day across the period.

Pricing: Scoped per engagement.