The Problem
Whenever a deal goes legal, the team is required to compile a complete documentation package for each investor involved. This means combining three items per investor: their discounting agreement, their signed page with the DigiO audit trail, and any supporting back pages.
Across 100–150 investors per active legal case, this was entirely manual. The process involved individually downloading agreements, locating the correct signature page for each investor, sourcing audit trails, and then manually assembling the final PDF — each one done by hand. Two to three days per asset, every single time.
The Solution — A Two-Phase Pipeline
I designed and built a two-phase Python automation pipeline to handle this end-to-end. Each phase handles a distinct part of the problem.
The audit trail download step from DigiO remains manual due to reCAPTCHA restrictions that prevent browser automation. But the pipeline is designed around this constraint — the manual effort is minimal and unambiguous, and the rest of the workflow is fully automated.
How It Works
The prepare.py script connects to the Bubble.io CDN to retrieve every discounting agreement associated with the active legal case. For each agreement PDF, it uses text parsing to identify the investor's name from the signature page. It then creates a Drive folder for that investor — named and numbered in sequence — and uploads the correct signature page automatically.
Once prepare.py has run and the team has uploaded the DigiO audit trails into each investor's folder, merge.py takes over. It iterates through every investor folder, assembles the final document in the correct legal order, and outputs a single consolidated PDF per investor — labelled, organized, and ready to hand to the legal team without any additional sorting or formatting work.
Tools Used
An SOP was prepared and shared with the team to ensure the pipeline can be run independently without any technical knowledge. The entire process — from triggering prepare.py to receiving the final assembled PDFs — is documented step by step so any team member can run it.
From days to minutes — reliably
What previously took two to three days of manual effort per asset now runs as a structured, repeatable pipeline. The output is a complete, correctly assembled legal documentation package for each investor, organized in Drive and ready for the legal team — with no additional formatting or sorting required. The constraint isn't time anymore. It's just the DigiO upload.