Automating a recurring pack of per-person documents
Python and browser automation that assemble a set of records, check each against rules, and stop for a person to read the exceptions.
Problem
Some administrative work is too varied for a template and too repetitive to keep doing by hand: assemble a set of records, fill each from a different source, check the lot, and package it for submission.
Objective
Hand the assembly and the checking to automation, and keep the final read with a person.
Technology stack
Python for document generation and verification, browser automation for data capture, and agent tooling for the drafting steps.
Architecture
A capture step gathers the source data. A generation step fills one document per person. A verification step checks every document against a rule set. A packaging step builds the submission and a report of exceptions.
Implementation
The verification step is the point of the system. It refuses to hand over a pack that has not come back clean, and it lists what a person still has to read.
Limitations
It decides nothing a person is accountable for. Every pack ends with a human reading the exceptions before it is submitted. When a source page changes its layout, the capture step needs repair.
Lessons learned
Build the checker before the generator. An automation that produces documents quickly and wrongly costs more than the manual process it replaced.
Not yet written up: costs, results. I add a section when I have measured it, and leave it out until then.