# 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

Page: https://mburhan.com/case/automated-biological-age-engine

## 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

1. **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.
2. **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.
3. **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.
4. **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.
5. **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.
6. **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.
7. **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.
8. **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. (https://mburhan.com/uploads/35a9fabd2eba1141171348c3.png)

Image: Workflow: the scan intake in n8n, with the email lookup in Upvio. (https://mburhan.com/uploads/113d77a3a273e71e04f70706.png)

Image: Output: the job log of one test assessment with the live AI model, from form to notification in 3½ minutes. IDs shortened. (https://mburhan.com/uploads/115bc8bea36b1529ed37276d.png)

Image: Workflow: the report email in n8n, sent once per client. (https://mburhan.com/uploads/eeb91f90180a1d6cdc9a59dc.png)

Image: End result: two pages of the PDF report for a made-up test participant. Company name blurred. (https://mburhan.com/uploads/1cf6a30ef6b7b99fd7f8dc6f.png)

## 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.
