← All case studies
Python Automation
Custom Python pipelines and services for teams whose integrations need more than a no-code platform can offer.
All 10 case studies in this section follow in full.
Contents
Python Automation
Case studies in full
Automated Biological Age Engine
A health and wellbeing company sells a biological ageing assessment. It does not give one “body age”. It shows how each of 16 body systems, from heart and brain to sleep, digestion and skin, seems to be ageing…
Section: n8n Automations, Python Automation
Overview
A health and wellbeing company sells a biological ageing assessment. It does not give one “body age”. It shows how each of 16 body systems, from heart and brain to sleep, digestion and skin, seems to be ageing compared with the person’s real age, and what is driving each one.
Each client answers a 150-question form in JotForm and takes a short camera face scan in Upvio. The company had a locked scoring method written up as a specification, but nothing to run it: no way to join each form to its scan, turn the answers into system ages, or produce the personal report it promises.
Now an engine built by Growlyze, with three n8n workflows around it, matches each form to its scan, scores both in code exactly as the specification says, has AI write the report around those numbers, checks every part, and emails the client a private link to their PDF.
The Problem
Clients pay for a detailed, personal picture of their health. A wrong number or a careless sentence about their body would cost the company their trust.
Two tools, no shared ID. The form and the scan arrive separately, at different times and in either order, and the form carries no assessment number. Someone would have to pair every form with its scan by hand.
The maths has to be exact. The 150 answers feed 16 body systems, 58 clusters, 28 interaction rules and several indices, with weights that shift when a layer is missing. The same answers must always give the same ages, which an AI model cannot guarantee on its own.
The scan has to be handled honestly. A camera reading from one sitting is an estimate. Impossible readings must be left out, not scored, and the report must never name a medical condition.
The words have to be safe, and every client needs a report. The text must be in plain British English, must never change or invent a number, and must never make a diagnosis. A weak AI draft cannot be allowed to leave a paying client with nothing.
How It Works
- The form comes in. An n8n workflow maps the JotForm fields to the engine’s format and sends them on. Each answer must match one of the question’s exact options; an unknown answer stops that assessment and raises an alert instead of guessing. Repeats of the same submission are ignored.
- The scan comes in. A second n8n workflow keeps only completed scans from this assessment’s Upvio link, looks up the client’s email through Upvio’s patient API, and sends the scan to the engine.
- Form and scan are matched by email. Whichever arrives first is stored and waits for the other. When both exist, the engine links them under one assessment ID and queues the report. A scan is never reused for a second report.
- Code does the scoring. The answers and the usable scan readings (blood pressure, resting heart rate, breathing rate and waist-to-height ratio) are scored by the locked method into 16 system ages, burdens and directions. Missing answers are left out, never counted against the client, and readings outside what is physically possible are listed and excluded.
- AI writes the words. The AI gets a pseudonymised summary with no name or contact details and writes the report in parts. It never calculates: the tables and charts are filled by code, and any figure the AI mentions must be one the code already worked out.
- Every part is checked. Checks look for structure, changed or invented numbers, diagnosis claims and hard-to-read sentences. A failing part goes back for repair; minor issues that remain become internal warnings, and any unsafe sentence still there is removed by code, with an alert.
- The PDF is built. The engine adds the client’s first name, builds a branded report of around 45 pages, stores it and creates a private, unguessable link.
- The client is emailed. The engine tells n8n the report is ready, and a third workflow emails the client their link through Gmail, checking first that the event has not already been handled.
All of this runs as its own service, with its own database and four workers, beside the company’s live ADHD assessment without touching it. If the AI service fails, the job is retried and finished parts are kept. The scoring method and the scan mapping are fixed, fingerprinted files, so any change is a new, recorded version rather than a quiet edit.
Results & Metrics
A form and a scan now find each other by email and become a scored, written, checked report without anyone stepping in. The numbers come only from code, so the same answers always give the same ages, and every accepted assessment ends in a report.
| Metric | Observed Output |
|---|
| Test reports with the live AI model | 19 |
| Processing time per report (current version) | 3 to 3½ minutes (5 of 5 runs) |
| Report length | 16 body systems, about 45 pages |
| AI drafts checked before publishing | 293 |
| Reports sent with banned or unsafe wording | 0 |
| Deliberate wrong answer and repeated webhook | Stopped with an alert; ignored, no second report |
| Automated tests | 887 passing (100%) |
💡
Metrics come from development and test runs on made-up participants, timed from scored answers to stored PDF. Runs that were restarted after a fix are left out of the timing. Figures from live client traffic may vary.
Image: Workflow: the form intake in n8n.
Image: Workflow: the scan intake in n8n, with the email lookup in Upvio.
Image: Output: the job log of one test assessment with the live AI model, from form to notification in 3½ minutes. IDs shortened.
Image: Workflow: the report email in n8n, sent once per client.
Image: End result: two pages of the PDF report for a made-up test participant. Company name blurred.
Tech Stack
| Technology | Role in the solution |
|---|
| JotForm | The 150-question assessment form clients fill in |
| Upvio | The camera face scan, and the patient lookup that supplies the email |
| n8n | Three workflows: form intake, scan intake, and the report email |
| Python engine (FastAPI) | Matching, scoring, AI calls, checks, the job queue and the private report links |
| MySQL / MariaDB | Its own database for assessments, scans, scores and the job queue |
| OpenAI | Writes the report text around numbers set by code |
| WeasyPrint | Turns the finished report into a branded PDF |
| Gmail | Sends the client their report link |
The engine runs on the company’s own server, next to its existing ADHD assessment but fully separate from it. Clients use the same kind of form and scan they already know.
Where This Pattern Applies
This isn’t really about ageing.
Worked example: a corporate wellness provider. Employees answer a lifestyle questionnaire and wear a fitness tracker for a week. The two are matched by email, a fixed scoring model turns them into risk areas in code, AI writes each person’s summary around those scores, the text is checked for medical claims, and a private report goes to each employee.
- Clinics: intake form plus device readings
- Insurance: health questionnaire plus checks
- Fitness coaching: check-in plus wearable data
- Property: survey answers plus inspection data
- Education: assessment plus coursework
- Engineering: equipment log plus sensor data
The shape: separate inputs are matched to one person, a fixed method scores them in code, AI writes within strict limits, and checks decide what gets sent. What changes from case to case is the questions, the scoring method, the second data source and the list of claims that must never appear.
Page · Plain text
Automated Health Assessment Engine
A health and wellbeing company sells an ADHD profile assessment. It is not a diagnosis and not a single “mild to severe” score. It shows how a person’s attention, drive, ideas, order, recovery and body work together,…
Section: n8n Automations, Python Automation
Overview
A health and wellbeing company sells an ADHD profile assessment. It is not a diagnosis and not a single “mild to severe” score. It shows how a person’s attention, drive, ideas, order, recovery and body work together, and it gives strengths and difficulties equal weight.
Each client completes a 72-question form in JotForm and a short camera body scan in Upvio. Before, the answers and the scan sat in those two tools with nothing joining them and nothing turning them into the personal report the company promises.
Now an assessment engine built by Growlyze, with three n8n workflows around it, matches each form to its scan, scores the answers in code, has AI write the report within strict limits, checks every part before publishing, and emails the client a private link to their PDF.
The Problem
People taking an ADHD assessment are often anxious about what it will say. They have paid for something personal, and a careless report can hurt them.
Two tools, no shared ID. The form and the scan arrive separately, at different times and in either order. Upvio’s scan notification does not even include the client’s email, so someone would have to pair every form with its scan by hand.
The scoring has to be exact. The 72 answers feed 11 dimensions, scoring bands, nine operating profiles, a seven-day experiment and product-suitability rules. The same answers must always give the same result, which an AI model cannot guarantee on its own.
The words have to be safe. The report must use the client’s own words in British English, but never claim a diagnosis or a cause, never mention brain chemicals or medication changes, and never show raw scores or question numbers. A short scan shows how the body was working at that moment; it must not be read as “how much ADHD” someone has.
Nothing can be lost or mixed up. Webhooks get sent twice, the AI service can be slow or down, and many clients can finish at once. Every accepted assessment still has to end in one report, sent once, to the right person.
How It Works
- The form comes in. When a client submits the form, an n8n workflow maps the JotForm fields to the engine’s format, checks it is complete and sends it to the engine. Repeats of the same submission are ignored, and unusable ones (missing answers, no consent) are rejected.
- The scan comes in. A second n8n workflow keeps only completed remote scans, looks up the client’s email through Upvio’s patient API, and sends the scan to the engine.
- Form and scan are matched by email. The engine stores whichever arrives first and waits for the other, with no time limit. When both exist, it links them and queues the report. If someone submits twice, the newest wins, and a scan is never reused for a second report.
- Code does the scoring. The answers are scored against the company’s rules into dimensions, bands, profiles, an experiment and suitability flags. Each scan reading (heart rate variability, recovery, stress, breathing, heart rate, blood pressure and a wellness score) becomes a plain finding and is compared with the questionnaire.
- AI writes the words. The AI gets a pseudonymised summary, with no name or contact details, and is told exactly which findings and which of the client’s own reflections it may use. It writes the questionnaire sections first and the scan section last.
- Every part is checked. The checks look for correct structure, evidence that points to real findings, use of the client’s words, and anything banned: question numbers, raw values, diagnosis or cause claims, medication advice, hype or US spelling. A failing part gets up to two targeted repairs; if it still fails, safe text built from the scores is used, so every client gets a report.
- The PDF is built. The engine adds the client’s name, builds a branded PDF, stores it and creates a private, unguessable link.
- The client is emailed. The engine tells n8n the report is ready, and a third workflow emails the client their link through Gmail, checking first that they have not already been sent it.
All of this runs in a database-backed job queue with several workers. If the AI service fails, the job is retried, and parts that already passed are kept, not written again. The questions, scoring rules and scan ranges live in one versioned configuration file, so a method change, or a whole new assessment, is a configuration edit rather than new code.
Results & Metrics
The team no longer pairs forms and scans by hand. Each client’s form and scan find each other by email, and a report is scored, written, checked and emailed without anyone stepping in. Nothing reaches a client until it passes the checks, and a temporary AI failure no longer means a missing report.
| Metric | Observed Output |
|---|
| Test runs with the live AI model | 14 |
| Typical processing time per report | About 1 minute (median) |
| Processing time range | 39 seconds to just over 2 minutes (13 of 14 runs) |
| AI drafts checked before publishing | 66 |
| Reports sent with banned or unsafe wording | 0 |
| Load test | 1,000 submissions, none lost, duplicated or mixed up |
| Automated tests | 110 passing (100%) |
💡
Metrics come from development and test runs, measured from validated input to stored PDF. The one run outside the range waited on automatic retries. Figures from live client traffic may vary.
Image: Workflow: the form intake in n8n.
Image: Workflow: the scan intake in n8n, with the email lookup in Upvio.
Image: Output: one engine run for a test participant, from matched form and scan to “ready”.
Image: Workflow: the report email in n8n, sent once per client.
Image: End result: two pages of the PDF report for a fictional test participant. Logo and company name blurred.
Tech Stack
| Technology | Role in the solution |
|---|
| JotForm | The 72-question assessment form clients fill in |
| Upvio | The camera-based body scan, and the patient lookup that supplies the email |
| n8n | Three workflows: form intake, scan intake, and the report email |
| Python engine (FastAPI) | Matching, scoring, AI calls, checks, the job queue and the private report links |
| MySQL / MariaDB | Stores assessments, scans, results and the job queue |
| OpenAI | Writes the report narrative from pre-selected findings |
| WeasyPrint | Turns the finished report into a branded PDF |
| Gmail | Sends the client their report link |
The engine runs on the company’s own server next to its database. Clients keep using the same form and scan, and the team keeps working in the tools it already has.
Where This Pattern Applies
This isn’t really about ADHD.
Worked example: a recruitment firm. A candidate fills in a skills questionnaire and records a task on another platform. The two are matched by email, the questionnaire is scored against the firm’s rubric in code, AI writes a candidate summary from the scores only, the summary is checked for banned claims, and a PDF goes to the hiring manager.
- Clinics: intake form plus test results
- Fitness coaching: check-in plus wearable data
- Education: assessment plus coursework
- Insurance: application plus documents
- HR: engagement survey to team report
- Financial advice: fact-find to review pack
The shape: separate inputs are matched to one person, code scores them, AI writes within fixed limits, and checks decide what gets sent. What changes from case to case is the questions, the scoring rules, the second data source and the list of claims that must never appear.
Page · Plain text
Monday.com Workflow Synchronization
A centralized dashboard for managing one-way and two-way synchronization across Monday.com boards
Section: Python Automation
Overview
The platform synchronizes project and deal information from the PM board to Media Buyer and Account Strategist boards, while keeping the Master CRM and individual closer boards aligned through separate two-way workflows. Each workflow maintains its own configuration, field mappings, and execution logs.
The Problem
Teams working across multiple Monday.com boards may need to repeat updates manually. This can leave records inconsistent and makes it harder to manage changes from both sides, prevent repeated updates, and identify synchronization errors or skipped records.
How It Works
- Identify records: The workflow checks configured Monday.com boards through automatic polling or a supported manual run.
- Match destination items: Board relationships, role mappings, and linked item identifiers are used to find the corresponding record.
- Apply field mappings: Configured rules determine which fields are synchronized and in which direction.
- Create or update records: Missing items are created where configured; existing matching items are updated.
- Apply safeguards: Two-way workflows use conflict policies and loop-prevention rules to avoid repeatedly processing their own updates.
- Record the outcome: Each workflow logs successful updates, skipped records, errors, and execution detail.
The Result
The platform brings multiple board synchronization workflows into one dashboard. Teams can keep configured records aligned, manage one-way and two-way updates separately, and review execution logs to understand what was synchronized, skipped, or unsuccessful.
Results & Performance Metrics
| Metric | Observed Result |
|---|
| Records synchronized | 295 |
| Errors encountered | 4 |
| Records skipped | 2 |
| Records dropped | 0 |
| Monitoring availability | 24/7 |
| Synchronization interval | 18 seconds |
Tech Stack
- Python: Core application and synchronization logic.
- Flask: Web application and dashboard backend.
- SQLite: Stores synchronization state and execution records.
- Monday.com API / Monday SDK: Accesses board data and applies updates.
- HTML, CSS and JavaScript: Provide the dashboard interface and frontend interactions.
Where This Pattern Applies
This solution helps businesses keep information consistent across multiple Monday.com boards and teams.
The same approach can be used in:
- Sales & CRM: Synchronize client records, deals, and ownership.
- Project Management: Keep project details, deadlines, and statuses aligned.
- Media Buying: Share campaign and client information across teams.
- Account Management: Maintain consistent client records and responsibilities.
- Marketing: Coordinate campaigns and team activities.
- Business Operations: Synchronize operational records across departments.
The underlying pattern remains the same: identify matching records, apply configured field mappings, create or update items, handle conflicting changes, and log synchronization results.
Page · Plain text
Enterprise Ticketing & Revenue Data Pipeline
An automated reporting system that collects ticket sales data from multiple vendors, calculates festival revenue and attendance, and updates a central dashboard using Python and Google Cloud.
Section: Python Automation
Overview
Palm Tree Crew, a live music festival organizer, needed a reliable way to track ticket sales, revenue, and attendance across multiple festival locations. We developed a Python-based automation pipeline on Google Cloud that collects daily reports from Ticketmaster, Front Gate Tickets, and Posh through Gmail. The system processes the reports, applies the required business rules, stores the results in BigQuery, and updates a Google Sheets dashboard for the management team.
The Problem
The operations team had to download daily ticket reports from different vendors, extract the information from PDFs and emails, and manually enter the numbers into Google Sheets. They also had to calculate multi-day attendance and track revenue from separate VIP and sponsorship spreadsheets. This process took hours, increased the risk of errors, and made it difficult for management to view total revenue and remaining ticket capacity in one place.
How It Works
- Start the Automation: Google Cloud Scheduler triggers the Python service on Cloud Run at the scheduled reporting time.
- Collect Vendor Reports: The system uses the Gmail API to retrieve daily audit emails from Ticketmaster, Front Gate Tickets, and Posh.
- Extract Ticket Data: Custom Python parsers process Ticketmaster PDF reports and Front Gate HTML email tables to extract ticket sales information.
- Apply Business Rules: The system calculates daily attendance, 24-hour sales rates, and remaining capacity. It also splits two-day passes across the correct festival days.
- Store Data in BigQuery: Processed information is saved in three tables: raw reports, parsed report lines, and daily snapshots.
- Update the Dashboard: The Google Sheets API rebuilds the executive dashboard with ticket sales, revenue, attendance, sales rates, and remaining capacity.
- Include Offline Revenue: VIP table and sponsorship data from external spreadsheets is connected through Google Sheets IMPORTRANGE, bringing online and offline revenue into one view.
Result
The system brings ticket sales collection, revenue calculations, and reporting into one automated pipeline.
- Replaces hours of manual report collection and data entry with scheduled automation.
- Combines ticket sales data from multiple vendors in one dashboard.
- Reduces manual calculation errors and duplicate ticket counting.
- Provides a combined view of online ticket sales, VIP tables, and sponsorship revenue.
- Displays daily attendance, sales rates, and remaining ticket capacity.
- Allows new festival shows and ticketing platforms to be added through a standard onboarding template.
Tech Stack
- Python: Handles report extraction, data processing, and business calculations.
- Google Cloud Run: Hosts and runs the Python automation service.
- Google Cloud Scheduler: Triggers the pipeline at scheduled intervals.
- BigQuery: Stores original reports, parsed ticket data, and calculated daily snapshots.
- Gmail API: Retrieves daily ticketing reports from vendors.
- Google Sheets API: Builds and updates the executive dashboard.
- IMPORTRANGE: Connects external VIP table and sponsorship revenue spreadsheets.
Where This Pattern Applies
The same approach can help organizations that collect operational and financial data from multiple external sources.
- Event Organizers: Combine ticket sales and attendance data across different events.
- Music Festivals: Track revenue, ticket sales, and venue capacity across multiple locations.
- Ticketing Companies: Process reports from different ticketing platforms.
- Hospitality Businesses: Combine revenue and booking data from multiple systems.
- Finance Teams: Automate daily reporting and bring information from separate spreadsheets into one dashboard.
The general approach is to collect reports from different sources, extract and process the data, apply business rules, and deliver updated results through a centralized dashboard.
Page · Plain text
Event-Driven Quote Triage for a Freight Brokerage
An event-driven Python service (FastAPI, Celery, Playwright and Claude) that answers load quote requests from a shared inbox with three ranked carriers. Median first reply: 48 seconds, down from 7 minutes 40.
Section: Python Automation
Overview
This case study focuses on an event-driven Python automation system that processes freight quote requests from a shared Gmail inbox. It checks carrier availability through browser automation, compares rates using Airtable data, and uses Claude to rank the top three carriers before sending a response through Gmail and Slack.
The system uses FastAPI, Celery, Redis, PostgreSQL, Browserbase, Playwright, and Claude. It replaces slow, unreliable polling with Gmail push notifications, uses database-based deduplication to prevent duplicate replies, and includes retries, recovery checks, and Slack alerts for failures.
Key results reported in the case study:
- Median first reply reduced from 7 minutes 40 seconds to 48 seconds.
- Cost per request reduced from $0.42 to $0.06.
- Reported success rate increased from 71% to 98.6%.
- Duplicate replies reduced from 4–6 per week to zero.
The problem
Load quote requests landed in a shared quotes@ inbox, around 40 a day. A dispatcher would read the request, log into the carrier portal (no public API for what they needed), check which trucks were available on that lane, cross-reference an internal rate sheet, and reply with three carriers and a price. Six to nine minutes each, every time.
Their first automation attempt was a Python script on a five-minute cron driving a hosted agent platform. It worked about 70% of the time, cost roughly $0.42 per request, and failed silently. They usually found out from a customer, not a log.
Three root causes, and all three shaped the rebuild:
- Polling. A 0–5 minute delay before anything started, and the cron had no idea what the previous run had done.
- Re-planning on every run. The agent asked an LLM to navigate the portal from scratch each time, so any UI jitter became a fresh failure mode, and every run paid full navigation token cost.
- No durable state. Nothing recorded which requests had been handled, so retries either duplicated replies or never happened.
The architecture
Everything runs as a small Python service on a single Fly.io machine, a FastAPI app that receives Gmail push notifications, and a Celery worker pool that does the actual work.
Image: Event-driven quote triage pipeline: a FastAPI webhook verifies and acknowledges the push, the request is de-duplicated and queued (Postgres key, Redis queue), Browserbase and Playwright check portal availability while an Airtable rate sheet supplies lanes, margins and exclusions, Claude ranks the top 3 carriers, and a threaded reply goes out on Gmail and Slack.
Key engineering decisions
Real-time trigger, not a cron. Gmail's users.watch publishes to a Google Pub/Sub topic, which pushes to a FastAPI endpoint. The handler does three things and nothing else: verify the JWT on the push request, write the message ID to Postgres, and return 204. Pub/Sub redelivers anything not acked within 10 seconds, so all real work is handed to Celery and the endpoint stays under 50 ms.
@app.post("/gmail/push")
async def gmail_push(req: Request, claims=Depends(verify_pubsub_jwt)):
envelope = await req.json()
history_id = decode_message(envelope["message"])["historyId"]
for msg in gmail.list_since(history_id):
if requests_repo.claim(msg.thread_id): # INSERT ... ON CONFLICT DO NOTHING
process_quote.delay(msg.thread_id)
return Response(status_code=204)
Idempotency lives in the database, not in memory. claim() is an INSERT ... ON CONFLICT DO NOTHING on the Gmail thread ID. If Pub/Sub redelivers, or the safety net and a live webhook race each other, exactly one worker wins the row. This is the piece that eliminated duplicate replies outright.
Cached navigation instead of per-run LLM planning. Playwright drives a Browserbase session with stored credentials and a persistent context. The first time the portal layout is seen, an LLM produces a navigation plan, a sequence of selectors and actions, which is hashed against the page structure and cached in Postgres. Every subsequent run replays the cached plan with plain Playwright calls: no LLM, no tokens, sub-second steps. Only when a replay step fails does the code fall back to re-planning, write the new plan, and post a Slack notice that the portal changed. That's the same idea as Skyvern's Route Memorization, built explicitly so the failure path is visible rather than silent.
Prompt caching on the ranking call. The system prompt, the scoring rubric, and the serialised carrier roster are static across requests and sit in a cached block; only the parsed request and the fresh availability data go in the user turn. Roughly 11k stable input tokens moved to cache reads.
system=[{
"type": "text",
"text": RUBRIC + roster_block,
"cache_control": {"type": "ephemeral"},
}]
Concurrency capped deliberately. The Celery pool runs three workers. The portal rate-limits aggressively and had previously locked the shared account twice, so throughput was traded for account safety.
State machine and the safety net
Every request row moves through an explicit status column. The hourly sweep is the belt-and-braces layer for the rare case where a Pub/Sub push is lost or a worker dies mid-run.
Image: Request states and recovery: a request is processing (row claimed, timestamp set), then done (reply sent, thread id) on success or failed (alert posted to Slack) on error. An hourly sweep re-runs rows stuck for more than 15 minutes.
The sweep is a Celery Beat task, about 30 lines: select rows in processing with claimed_at < now() - interval '15 minutes', reset the attempt counter, re-enqueue. After three attempts it moves to failed and posts a Slack alert with the thread link and the last exception, so a dispatcher can handle it manually and an engineer can see exactly where it broke.
Errors are handled in three tiers rather than one generic retry: transient network and portal timeouts retry with exponential backoff inside the task; a failed selector replay triggers re-planning and a "portal layout changed" notice; anything else fails the row loudly.
Results
| Before | After |
|---|
| Time to first reply (median) | 7 min 40 s | 48 s |
| Cost per request | $0.42 | $0.06 |
| Success rate (30-day) | 71% | 98.6% |
| Duplicate replies / week | 4–6 | 0 |
| Silent failures | routine | none, every failure alerts |
The cost drop came from two places roughly equally: cached navigation removed the per-run planning tokens, and prompt caching cut input cost on the ranking call.
Delivered
Dockerised FastAPI + Celery service with a one-command deploy; Postgres schema and migrations; the Browserbase automation module with cached-plan replay and fallback; the Claude ranking module with the rubric prompt; Slack alerting; a runbook covering the four common failure modes and how to re-run a request by thread ID; and a 45-minute handoff call testing a live request end to end.
Page · Plain text
Ingredient Quoting Across 22 Supplier Portals
A Python pipeline (Prefect, Skyvern and GPT-4.1) that quotes all 22 approved suppliers for every ingredient reorder and delivers a ranked comparison in about four hours instead of 3.5 days.
Section: Python Automation
At a glance
Mid-size generic drug manufacturer, ~40 SKUs in production. Five weeks. Python 3.12, Prefect, Skyvern Cloud, OpenAI GPT-4.1, Postgres, S3, Slack. Went from quoting a fifth of their supplier base per order to quoting all of it.
The 6% nobody could see
Production planning flags a reorder for an active ingredient. A procurement officer opens a portal, searches the CAS number, pulls a price, downloads the spec sheet, pastes it into Excel. Then the next portal. Then the next.
Twenty-two suppliers were on the approved list. In practice the officer got through five or six before the purchase order had to go out, and the same five or six every time, the ones with the least annoying logins.
The waste wasn't the officer's afternoon. It was the sixteen vendors nobody had time to ask. When the full list was finally quoted, the cheapest compliant supplier turned out not to be one of the usual five surprisingly often.
Why this wasn't a scraping job
Three things ruled out the obvious approach, and a hand-written Playwright suite had already been abandoned for exactly these reasons.
Vendors don't agree on what anything is called. Metformin HCl USP, metformin hydrochloride BP/EP, or a bare product code, same molecule, three listings, no shared key except the CAS number buried somewhere on the page.
Quotes don't arrive in one shape. Some portals render a price table. Some hand back a PDF. Some won't tell you anything until you've submitted an RFQ form and waited for an email.
And it's a regulated purchase. Pharmacopoeia grade, GMP status, and whether the supplier holds a DMF or CEP are pass/fail gates, not preferences. A cheap quote from a vendor without the right filing isn't a cheap quote. It's not a quote at all. Every choice has to survive an audit two years later.
Following one RFQ through
Image: Multi-vendor ingredient quoting pipeline: RFQ intake (CAS number, grade, quantity), a Skyvern browser handles login, 2FA and CAPTCHA, prices come from an in-page table or from a downloaded and parsed PDF or emailed quote, GPT-4.1 normalises and validates them, and the ranked comparison goes to a Slack thread with an audit log.
A reorder request arrives as a CAS number, a grade, and a quantity. Before anything opens a browser, that gets resolved against an internal ingredient register, deterministically, on the CAS number, never on the product name.
Prefect then fans the request out to twenty-two isolated subflows, one per vendor. Each launches its own Skyvern cloud browser and logs in. Nine of these portals want 2FA and two sit behind CAPTCHAs; that's handled inside the login step rather than being a per-vendor engineering problem.
From there the paths diverge by portal. Where the price sits in the page, it's read straight off the page against a schema. Where it only exists as a PDF or an emailed quote sheet, the file is downloaded and parsed separately.
Everything then funnels back into a single normalisation pass, one model call, one strict schema, twenty-two vendors reduced to comparable rows: unit price, currency, unit of measure, MOQ, lead time, incoterm, grade, GMP status, DMF reference.
The ranked comparison lands in Slack about four hours later, with every row linking to the evidence behind it.
Four forks in the road
Skyvern rather than raw Playwright
The rejected option was writing and maintaining twenty-two scripts. That's what had already failed. At this many portals somebody is always redesigning something, and the maintenance load quietly exceeded the hours the automation was saving. Buying the resilience rather than building it was the entire reason the project was viable a second time.
1Password rather than a second vault
Skyvern can read credentials from several providers, and the client was already on 1Password. The alternative, standing up a dedicated secrets store, would have meant twenty-two sets of credentials living in two places, which is worse security dressed up as better engineering.
Selectors first, model second
Every stable element on a page gets a selector and a prompt. The selector runs, costs nothing, and usually works; the model only engages when it misses. Going model-first on everything would have been simpler to write and roughly ten times the running cost.
The model never decides what an ingredient is
It was tempting to let a model reconcile vendor product names. It isn't allowed to. Where a listing has no CAS field, the model may suggest a match, and that suggestion goes to a human. Misidentifying an ingredient in this industry isn't a data quality issue, and no accuracy figure would have made that trade acceptable.
When it breaks
Image: Route Memorization in practice: a memorized route replays deterministically. If the replay works the quote is captured with its evidence hash; if the route breaks it is regenerated by AI with a diff alert; if it keeps failing it goes to a review queue with the session recording attached.
Skyvern's Route Memorization compiles a successful run into a deterministic script and replays it. When a portal changes and the replay fails, it re-plans with AI, finds the new path, and regenerates the script. That mechanism does the heavy lifting here.
What it doesn't do is announce itself. A regenerated route is a silent event, and silent events don't belong in a regulated purchasing process.
So the wrapper watches for it. Each subflow records its action count and wall-clock duration; a memorised replay sits in a tight, predictable band, and an AI re-plan blows straight through it. That signal tags the run as a regeneration, diffs the new route against the old one, and drops a summary into Slack so someone can see what the portal changed before the next cycle.
If a regenerated route produces a quote that can't be evidence-checked, that vendor goes to a review queue with its session recording attached instead of into the comparison. About 4% of quotes land there, mostly from two portals that render prices as images.
The result is that failure is local. One portal breaking means twenty-one quotes still land and the RFQ is still useful.
Impact
| Before | After |
|---|
| Vendors quoted per RFQ | 5–6 | 22 |
| Time to full comparison | 3.5 days | ~4 hours |
| Procurement hours per month | ~26 | ~3 |
Page · Plain text
Python MCP Server Connecting Claude to a Field-Service CRM
A hosted, OAuth-protected MCP server in Python that lets a home-services business ask Claude about customers, jobs, invoices and leads, with write actions hidden unless allowed.
Section: Python Automation
Project Overview
This project connects Claude to Housecall Pro, enabling a home-services business to ask questions about customers, jobs, invoices, and leads through an MCP server built with Python and FastMCP.
Technology: Python, FastMCP, OAuth 2.0, REST API, Railway, Claude
01. The Problem
The business wanted to interact with its field-service data through Claude and perform permitted actions without giving the AI direct access to the raw database.
02. The Solution
A Python MCP server was developed to expose the Housecall Pro REST API through approximately 20 domain modules, covering customers, jobs, estimates, invoices, leads, employees, scheduling, webhooks, and more.
The server is hosted on Railway and connects to claude.ai.
03. Key Features
- OAuth 2.0 Authentication: Uses GitHub as the OAuth provider, with authentication redirecting back to claude.ai.
- Domain-Specific Tools: Organizes tools into namespaces such as
customers_*, jobs_*, and invoices_*. - Read-Only Enforcement: Middleware hides tools containing
create, update, delete, send, void, or dispatch in their names unless explicitly allowed. - REST API Integration: Exposes field-service functionality through a unified FastMCP application.
- Hosted Deployment: Runs on Railway for connection to Claude.
04. How It Works
- The user authenticates through the OAuth login flow.
- Claude connects to the hosted MCP server.
- FastMCP exposes the available CRM tools through domain-specific modules.
- Permission middleware determines which tools are visible to the agent.
- Claude uses the available tools to interact with the field-service CRM API.
Image: The server entry point: GitHub OAuth in front, one FastMCP app, and each domain module (customers, jobs, estimates, invoices, leads, employees) mounted under its own namespace.
05. Workflow
06. Implementation
The server entry point mounts the CRM domain modules under one FastMCP application. Each module handles a specific area of the field-service API, while OAuth authentication and permission middleware control access to the available tools.
Image: The repository: one Python module for each area of the field-service API, plus a Procfile for deployment on Railway. The commit messages are blurred.
The repository contains separate Python modules for the different API domains and a Procfile for Railway deployment.
07. Outcome
The solution provides Claude with a structured interface to field-service CRM data, with OAuth authentication, domain-specific tool namespaces, and protocol-level controls over which actions are exposed to each agent.
Built with
Python, FastMCP, OAuth 2.0, REST and Railway.
Page · Plain text
Daily Ticket-Count Automation: Gmail PDFs to BigQuery and Google Sheets
A Python job that reads daily Ticketmaster audit PDFs from email, stores every figure in BigQuery and publishes a Google Sheet that mirrors the team’s existing workbook.
Section: Python Automation
Project Overview
A Python job reads daily Ticketmaster audit PDFs received by email, stores the extracted figures in BigQuery, and publishes a Google Sheet that mirrors the team's existing workbook.
Technology: Python, Gmail API, BigQuery, Google Sheets API, PDF parsing, pytest
01. The Problem
An events company received daily Ticketmaster audit PDFs by email and manually re-entered the reported figures into a workbook. This repetitive process required daily manual effort.
02. The Solution
A scheduled Python job uses the Gmail API and an OAuth refresh token to retrieve report emails, download and parse PDF attachments, store the figures in BigQuery, and publish the results to Google Sheets.
03. How It Works
- Retrieve report emails using the Gmail API.
- Download the attached Ticketmaster audit PDFs.
- Parse the PDFs and extract ticket-count figures.
- Store the extracted figures in BigQuery.
- Publish a Google Sheet that mirrors the existing workbook.
- Record each job run in the Run Log tab.
04. Workflow
05. Google Sheets Output
The published spreadsheet tracks:
- General Admission (GA) tickets
- VIP tickets
- Total tickets
- Tickets sold against capacity
- Percentage sold
Image: The Google Sheet the job publishes: tickets sold per day against capacity, split into GA and VIP, with the percentage sold. Event names and some tab names are hidden.
The workbook includes a Top Sheet, Raw Data, and Run Log tabs.
06. Testing and Implementation
The project followed a specification-first process: design specification, implementation plan, tests using fixture PDFs, and then the pipeline implementation.
Image: The project repository, with the ticket-count source code, tests, scripts and design documents.
The repository includes the ticket-count source code, scripts, tests, and design documents.
07. Outcome
The job automates the transfer of ticket figures from daily email attachments into BigQuery and Google Sheets, reducing manual data entry and providing a run log for tracking executions.
Image: The Run Log tab, with one row for each run of the job and its time.
Page · Plain text
Production Linux Server Audit and Repair for a Data Subscription Site
An audit of the single Ubuntu server behind a financial-data subscription site, a fix for its silently failed social-posting pipeline, and a documented setup so it can be maintained safely.
Section: Python Automation
Project Overview
A financial-data subscription site ran its Python backend, data pipelines, scheduled jobs, publishing automation, and social-posting pipeline on a single Ubuntu VPS. The project focused on auditing the server, repairing a silently failed social-posting pipeline, and documenting the setup for safer maintenance.
Technology: Python, Flask, SQLite, systemd, cron, Nginx, Gunicorn, Cloudflare Tunnel, Stripe, WordPress, Brevo
01. The Problem
The server supported several interconnected services and automated workflows. The social-posting pipeline had silently stopped working, and the client needed a server audit, a repair, and a clear maintenance roadmap.
02. What Was Done
- Audited systemd units, cron jobs, logs, Nginx, Gunicorn, the SQLite database, and the backup job.
- Prepared a plain-English client report with a health score and prioritized fixes.
- Repaired the social-posting pipeline with two targeted changes and stabilized its scheduling.
- Set up a Git mirror of
/opt and added a CLAUDE.md file documenting the architecture to support safer maintenance with Claude Code.
03. How the System Runs
- Nightly pipeline — 20:00 ET: Ingests OHLC data, runs scanners, builds JSON outputs, backs up the database to Google Drive using rclone, builds the newsletter and blog post, publishes through the WordPress REST API, and sends the daily email through Brevo.
- Live pipeline — 15:45 ET: Runs
live_pipeline.py for real-time signals and options pricing. - Always-on API: Runs the Gunicorn-hosted Flask API on port 5500 behind Nginx and Cloudflare Tunnel.
- Content engine: Scheduled through cron at 08:15, 08:45, every 15 minutes during market hours, and 21:00 to render PNG/MP4 content cards and post to Instagram, X, and TikTok.
04. Workflow
Nightly Data Pipeline
Scheduled systemd Timer → nightly_pipeline.sh → Ingest OHLC Data → Run Scanners → Build JSON → Back Up Database to Google Drive → Build Newsletter and Blog Post → Publish via WordPress REST API → Send Daily Email via Brevo
Live Data Pipeline
Scheduled systemd Timer → live_pipeline.py → Real-Time Signals and Options Pricing
API Service
Flask API → Gunicorn on Port 5500 → Nginx → Cloudflare Tunnel
Social Content Pipeline
Cron Schedule → Content Engine → Render PNG/MP4 Cards → Publish to Instagram, X, and TikTok
20:00 ET systemd timer → nightly_pipeline.sh
ingest OHLC → run scanners → build JSON → DB backup to Drive (rclone)
→ build newsletter + blog post (publish via WP REST API)
→ send daily email (Brevo)
15:45 ET systemd timer → live_pipeline.py (real-time signals + options pricing)
always systemd service → gunicorn Flask API :5500 behind nginx + Cloudflare Tunnel
cron 08:15 / 08:45 / every 15 min market hours / 21:00 → content engine renders PNG/MP4 cards and posts to IG / X / TikTok
05. Technology and Integrations
Python, Flask, SQLite, systemd, cron, Bash, Nginx, Gunicorn, Cloudflare Tunnel, rclone, JWT authentication, Stripe, WordPress REST API, Brevo, and the Post for Me API.
06. Outcome
The server was audited, the failed social-posting pipeline was repaired, scheduling was stabilized, and the architecture was documented to support safer ongoing maintenance.
Page · Plain text
Cold Email Copy Generation with Automatic Quality Checks
An AI tool that writes five cold email sequences in spintax format in minutes and checks each one against eight quality rules, rewriting any that fail.
Section: Python Automation
Overview
Cold email copy generation and quality control. Instead of spending hours writing email variations by hand in spintax format and checking each line against banned phrases and formatting rules, teams now get five production-ready email sequences in minutes.
The Problem
Creating cold email variations meant hours of manual work. Writers had to draft email sequences by hand, then apply spintax format line by line, a tedious process where every variation had to be written and formatted separately. Quality control was completely manual: each line had to be checked against banned phrases and banned words, word counts verified, spintax coverage confirmed, and offer rotation rules checked. With no automated checklist, mistakes slipped through before emails went into the sending tool. Creating five email sequences took 5 to 10 hours of work, was error-prone, and depended entirely on someone being available to do it correctly.
What the Automation Does
Image: The team interface: a chat assistant on the left, a button to generate the week’s strategy, and Copy Variations and History at the top.
Step 1: Email sequences are generated
The automation takes the email parameters and requirements, then uses AI to generate five complete cold email sequences in full spintax format, with multiple variations per email step (A/B variants) so testing options are built in.
Step 2: Automatic quality checks run
Every generated copy is automatically checked against eight quality rules: word count, spintax coverage on every line, banned phrases, banned words, offer accuracy, hook uniqueness, offer rotation compliance, and more. If a copy passes all checks, it is flagged as production-ready. If it fails, the system automatically rewrites it (up to three retries) to meet the requirements.
Step 3: Ready-to-send copies are delivered
The team receives five email sequences with a pass or fail verdict on each. Every copy is either production-ready or clearly flagged as needing manual revision, so there are no surprises or quality issues after the copy goes into the sending tool.
Main Work Flow
Tools and Integrations Used
- Custom code automation (AI-powered email generation and quality control)
- Anthropic Claude (copywriting and analysis)
- Python and FastAPI (backend automation)
- TypeScript, React and Next.js (team interface)
The Result
Teams no longer spend 5 to 10 hours writing and quality-checking email sequences by hand. Five production-ready sequences now generate automatically in minutes. Quality control shifted from a manual checklist to an automated pipeline that catches banned phrases, spintax gaps, word count violations and formatting mistakes instantly. Every copy follows the same proven structure with consistent formatting. What used to take hours of manual writing and QA now happens automatically, freeing the team to focus on strategy and testing instead of production work.
Summary
The tool automates the full cycle from email copy generation to quality-checked delivery. Teams provide their email requirements, the automation generates five complete sequences in spintax format, automatic quality checks verify everything, and production-ready emails are delivered in minutes instead of hours. The team stays in control, since they review and approve the output, while the repetitive writing and quality-checking work is handled automatically.
Page · Plain text