All posts

Rebuilding payroll: validating the run before it goes out

Payroll is a high-frequency process where manual data assembly produces a recurring, measurable error rate with compliance and retention costs. Here is the redesigned validation workflow and what it catches before the run leaves.

Javier Leguina

Javier Leguina

Co-founder & CTO of flowscope, previously a founding engineer at ModelML (YC W24).

· Automation in practice

Payroll runs more often than almost any other finance process, which means whatever error rate it carries is paid again every two weeks. A December 2022 survey of 508 people who work with payroll at US companies of 250 to 10,000 employees, conducted by Ernst & Young and released by the payroll provider Paycom, found an average payroll accuracy of eighty percent, with each error costing an average of $291 to remedy. The reason payroll is worth walking step by step is that almost none of that error comes from the part a payroll administrator is actually paid to judge.

Where payroll errors come from

Sit behind a payroll administrator for a cycle and the run divides into two phases. The first is assembly: pulling time records from the clock system, applying the right pay rates, layering in overtime, shift differentials, paid time off, garnishments, benefit deductions, and tax withholding driven by each employee's W-4. The second is the run itself, where the engine multiplies hours by rates and produces net pay. The arithmetic in the second phase is reliable. The errors live in the first, in the handoffs between systems that do not talk to each other and in records that a person typed, copied, or forgot.

The EY survey makes the shape of this concrete. The costliest single error type was sick time not entered, at $705 to correct, followed by an employee not entered in time at $635, a visa-status update error at $615, and a W-4 setup error at $539. None of those is a calculation mistake. Each is a missing or wrong input that the run processed faithfully. The engine did what it was told, and it was told the wrong thing. That distinction is the basis for the redesign, because an input error is catchable before the run if something is checking the inputs against what they should be.

Validating the inputs before the run

The redesigned workflow puts a layer between assembly and the run. Before payroll executes, an agent reads the assembled inputs for the period and checks them against rules and against history. Did every active employee receive hours, and does anyone with zero hours have an approved leave record to explain it? Does each new hire from the period appear with a start date, a pay rate, and a completed W-4, or is someone present in the headcount but absent from the run? Do the garnishment and benefit deductions match the standing instructions on file? These are mechanical checks, and they catch precisely the error types the EY survey priced highest, because those errors are absences and mismatches that a rule can see.

The validation that matters most is comparison against prior periods. Most of any payroll run looks like the last one, so the cases worth a human's attention are the ones that do not. Consider an employee whose gross pay jumps forty percent with no recorded promotion or overtime, a deduction that vanished, a tax jurisdiction that changed without an address update, or a worker reclassified from salaried to hourly. Each is an anomaly against a stable baseline, and each is where the expensive mistakes sit. The agent ranks these by deviation and dollar impact and presents the short list. This is the same anomaly-against-baseline logic that drives the reconciliation step in rebuilding the month-end close, applied to a process that runs far more often.

What stays with a person

What the agent does not do is decide. When sick time is missing, the agent flags that an employee with an approved absence has no leave hours entered; a person confirms whether the absence was paid or unpaid and corrects the record. When a new hire is missing a W-4, the agent surfaces the gap and a person chases the form. Classification is the clearest case for keeping judgment human, because whether a worker is exempt or non-exempt, employee or contractor, is a legal determination with real consequences. The agent's role there is to flag a classification that changed or that conflicts with the hours pattern, not to settle the question.

The controller or payroll manager stays responsible for sign-off, the same way they always have. The difference is what they are signing. Today they approve a run they have largely had to trust, because checking five hundred employees by hand is not feasible inside a payroll window. In the redesign they approve a run where every record was checked and the handful that deviate are in front of them with the supporting detail attached. The accountability is unchanged; the basis for it is no longer a sample. This separation of mechanical validation from human authority is the same principle that governs an aligned AI engagement more broadly.

Why the errors compound

Payroll error is not only an internal labor cost. The EY survey found that an average organization of 1,000 employees spends roughly twenty-nine workweeks a year correcting common payroll errors, which is most of a full-time role spent on rework that better inputs would have prevented. Beyond the labor there is compliance exposure. The IRS assesses information-return penalties for incorrect W-2 and 1099 filings, up to about $330 per form for 2025, and a misclassification or a withholding error that survives the run becomes a filing error at year end. The errors that the validation layer catches in one month are the same errors that generate penalty notices the following winter.

There is a retention cost as well, and it is the one operators tend to underweight. Employees notice when their pay is wrong, and they notice repeatedly, which means corrections that recur every period are an accounting line to the company and a steady source of mistrust to the people they affect. A late or short paycheck is one of the few operational failures an employee experiences directly and personally, and it lands on the same people every cycle until the inputs that caused it are fixed.

A reasonable counter

A reasonable counter is that much of the EY error rate reflects bad upstream data, time clocks that are wrong and managers who approve timesheets carelessly, and that a validation layer cannot fix a garbage input it has nothing to compare against. There is real truth in this. An agent cannot know that an approved timesheet is fictional. But the most expensive error types the survey identified were not bad data, they were missing data and changed data: an employee not entered, sick time not recorded, a W-4 not set up, a status that shifted without its dependent fields following. Those are absences and inconsistencies a rule can see against the prior period and the employee roster, which is why the validation step reaches most of the cost even when it cannot reach all of the cause. The same logic that makes three-way match tractable, checking a new record against records you already trust, is what makes payroll validation tractable too, and it is why the redesign starts by writing the checks rather than rebuilding the systems beneath them. Where the existing system has no clean way to accept corrections, the harder engineering is writing back into a system with no usable API, but the validation that decides what to write back is the same either way.

Common questions

Where do most payroll errors actually come from?
Payroll splits into two phases: assembly, where time records, pay rates, overtime, paid time off, garnishments, deductions, and tax withholding are pulled together, and the run itself, where the engine multiplies hours by rates. The arithmetic in the run is reliable, so almost all error lives in the first phase, in handoffs between systems that do not talk to each other and in records a person typed, copied, or forgot. The EY survey found the costliest error types were sick time not entered, an employee not entered in time, a visa-status update error, and a W-4 setup error, none of which is a calculation mistake. Each was a missing or wrong input that the run processed faithfully.
How does an input-validation layer catch errors before payroll goes out?
The redesign puts an agent between assembly and the run that reads the assembled inputs for the period and checks them against rules and against history before payroll executes. It confirms whether every active employee received hours, whether anyone with zero hours has an approved leave record, whether each new hire appears with a start date, pay rate, and completed W-4, and whether garnishment and benefit deductions match the standing instructions on file. The validation that matters most is comparison against prior periods, since most of a run looks like the last one, so the agent flags anomalies such as a forty percent gross pay jump with no recorded promotion, a deduction that vanished, or a worker reclassified from salaried to hourly. It ranks these by deviation and dollar impact and presents a short list for review.
Does this replace the controller or payroll manager's sign-off?
No. The agent flags gaps and anomalies but does not decide, and classification stays with a person because whether a worker is exempt or non-exempt, employee or contractor, is a legal determination with real consequences. The controller or payroll manager remains responsible for sign-off exactly as before. What changes is the basis for the approval: instead of trusting a run they could only sample by hand inside a payroll window, they approve a run where every record was checked and the handful that deviate are in front of them with supporting detail attached.