Skip to main content
Workflow Automation

How We Automated a 3-Hour Payroll Process into 3 Clicks

Monthly payroll consumed a full business day for a 60-person Vietnamese SME — manual Excel exports, individual email sends, a dozen approval sign-offs. Here's what we built to collapse that into three button presses.

Đỗ Thùy7 min read

Every company has a process that everyone hates. For many Vietnamese SMEs with 30–100 employees, it's payroll day.

At a distribution company in Hanoi — we'll call them [CLIENT_NAME] — the last working day of every month looked like this: the HR manager exported attendance from one system, salary grades from another, and sales commission data from a spreadsheet only she maintained. She merged all three in Excel, manually calculated tax and social insurance contributions for each employee, reformatted everything into individual payslip PDFs, and emailed them one by one.

Three hours minimum. Sometimes five, if anyone had a mid-month contract change.

This is a solved problem. Here's exactly how we solved it.

Why "just use payroll software" isn't the answer

The first thing clients ask when we propose a payroll automation project is: "Why not just buy off-the-shelf payroll software?"

The short answer is: most payroll software solves the calculation problem, not the data-collection problem. You still have to get attendance data in. You still have to reconcile commissions from your CRM. You still have to handle edge cases — advances, late joiners, salary changes mid-month — that don't fit neatly into a vendor's opinionated data model.

The software also assumes your HR team wants to learn a new system. In practice, the HR manager at [CLIENT_NAME] had been maintaining her Excel model for four years. She knew exactly how it worked, and she didn't trust a black-box vendor to handle the nuances of Vietnamese social insurance contribution tiers correctly.

What she needed wasn't a new system to replace her Excel model. She needed the Excel model to run itself.

What we built

We built [CLIENT_NAME]'s payroll automation in three layers.

Layer 1: Data collection pipeline

Instead of the HR manager manually pulling from three different sources, we built a nightly sync that:

  1. Reads attendance records from the time-tracking system via its REST API
  2. Pulls salary grades and contract data from the HR database they already had
  3. Merges sales commission data from a Google Sheet the sales team updates daily

The result lands in a single staging table in their database by 8:00 AM on the last business day of the month. The HR manager sees a clean dashboard showing today's headcount, any employees with missing data flagged in red, and a one-click button to run payroll.

This alone cut her "payroll morning" from data-gathering to spot-checking.

Layer 2: Calculation engine

The calculation logic was already correct — it lived in her Excel formulas, tested and refined over four years. We translated it into a TypeScript function that reads from the staging table, applies the same logic (gross salary → social insurance → personal income tax → net pay → bank transfer amount), and writes the results back to a results table.

The important thing: we didn't rebuild the business logic. We wrapped it. If the rules change (Vietnamese tax law changes frequently in the SME exemption tiers), the HR manager updates a configuration table, not code.

Layer 3: Payslip generation and distribution

This is where Sheldon Sender came in. Sheldon Sender is our payslip automation tool — it takes a dataset, a PDF template, and a recipient list, and sends every employee their personalized payslip via email.

For [CLIENT_NAME], we built a payslip PDF template that matched their existing format exactly. Employees received the same PDF they'd always seen, in the same brand style. The only difference was that it arrived automatically instead of waiting for the HR manager to finish her manual runs.

The distribution step uses Resend for email delivery with full tracking. If an email bounces (common with corporate addresses that IT hasn't updated), it flags the employee for manual follow-up rather than silently failing.

The 3-click flow

After implementation, the HR manager's payroll day works like this:

Click 1 — Review the staging dashboard. All 62 employees loaded, 1 flagged (new hire missing bank account number). Fix the flag in 30 seconds.

Click 2 — Run payroll calculations. The engine processes all 62 employees in under 4 seconds, shows a summary: total payroll amount, average net salary, comparison vs. last month. She reviews the summary and confirms it looks right.

Click 3 — Send payslips. Sheldon Sender queues all 62 emails, sends them over 10 minutes (rate-limited to avoid spam filters), and returns a delivery report.

Total time: 8 minutes on a normal month. 20 minutes if there's an edge case to investigate. From three hours to three clicks.

What made this project succeed

A few things about this project that aren't obvious from the outside:

We started with the existing process, not the ideal process. The HR manager's Excel model was the spec. We didn't ask her to change how she thought about payroll — we asked her to help us understand every formula in her sheet. That respect for domain knowledge made the rollout far smoother than a typical software implementation.

We built incrementally. Layer 1 (data collection) went live two months before Layer 2 (calculations). The HR manager spent two months running both systems in parallel — her Excel model and our automated version — comparing outputs line by line. By the time we switched to the automated calculation, she trusted it completely.

We kept her in control. The three-click design is intentional. Automated payroll that runs entirely in the background sounds efficient, but it terrifies HR managers — reasonably so, because mistakes affect people's rent money. The flow we built requires three explicit approvals before any email is sent. She has a full audit log of every payroll run, exportable as a CSV for the finance team.

We planned for exceptions, not just the happy path. Mid-month salary changes, advances, new joiners, leavers — we mapped every edge case before writing a line of code. The system handles all of them, and each has a clear paper trail that satisfies the auditors [CLIENT_NAME] works with.

What this costs and when it makes sense

For [CLIENT_NAME], the automation paid for itself in the first month — if you value the HR manager's time at the market rate for senior HR professionals in Hanoi (roughly 25–35 million VND/month fully loaded).

More concretely: the right profile for payroll automation is a company with 30+ employees, a monthly payroll run that takes more than 2 hours, and HR data spread across more than one system. Below 30 employees, off-the-shelf payroll software is usually the right call. Above 30, the integration work starts to pay off.

Above 200 employees, you're probably already running dedicated ERP payroll modules — and the question becomes whether your ERP is configured correctly and your data flows are clean, not whether to automate.

What to do next

If your payroll process looks like the one described above, the fastest path to clarity is to map where your data actually lives. Draw it on a whiteboard: every system that contributes a number to the final payslip. Every system your HR manager touches on payroll day.

In our experience, that map usually has 3–5 data sources and 2–3 manual transformation steps. Each transformation step is an automation opportunity. Most of the work is in the first one.

We run a free 30-minute payroll automation scoping call — you describe your current process, we tell you exactly what we'd build, what it would cost, and what you can expect to save. No slides, no sales deck. Just an engineer walking through your setup.

Book a scoping call →


Sheldon Sender is L'inno's payslip automation tool, available as a standalone SaaS subscription or as part of a custom workflow automation engagement. Learn more about Sheldon Sender →

payroll automationworkflow automationHR automationSME VietnamSheldon Sender

Workflow Automation

Interested in a similar project?