Sitemap
Adukwudavid

Adukwudavid

How I Automated Malaria M&E Reporting with n8n and AI

4 min read1 day ago

--

Two workflows that check data quality, block duplicates and send a weekly report, built by a data analyst learning AI automation

I’m a data analyst with a background in public health and microbiology, and I’ve recently started building AI automations with a tool called n8n. For my second project, I wanted to solve a problem I know well from health programmes: the hours spent every week cleaning, totalling and reporting field data by hand.

This article walks through what I built, how it works and what I learned. All the data in this project is made-up practice data, because real health data is sensitive.

The problem

In many health programmes, health workers send in daily figures, such as how many clients they saw and how many malaria tests came back positive. Then an M&E officer copies the data, adds up the totals and writes a weekly report for the programme manager.

This takes hours, and mistakes slip through. A typo can record more positive results than tests done, or the same report can be sent twice. By the time anyone notices, the weekly figures are already wrong.

Workflow 1: Checking every daily report

The first workflow starts when a health worker fills in a simple online form with the date, their name, facility, clients seen, malaria tests and positive results.

Before anything is saved, the workflow checks the report against four data quality rules:

  • Clients seen must be 0 or more
  • Malaria tests cannot be more than clients seen
  • Positive results cannot be more than tests done
  • Positive results must be 0 or more

A report must pass all four. If it fails, it isn’t saved, and the M&E officer gets an email with the report details so it can be corrected.

Get Adukwudavid’s stories in your inbox

Join Medium for free to get updates from this writer.

It also checks for duplicates. If the same health worker has already sent a report for the same date, the new one is blocked and flagged. Only clean, new reports are saved to a Google Sheet.

Press enter or click to view image in full size
Workflow 1. Every daily report passes data quality and duplicate checks before it is saved.

Workflow 2: The Monday report

The second workflow runs on its own every Monday at 8 AM. It reads the sheet and keeps only the last 7 days of reports, so each report covers one week, not every week since the start.

It then adds up the figures for each facility and calculates the malaria positivity rate: positive results divided by tests done, times 100. I let the workflow do all the maths, and only then pass the figures to an AI model (OpenAI’s GPT-4o-mini), which writes a short, plain-text summary for the programme manager. The prompt tells it to use only these figures and never invent numbers.

At the same time, it checks whether any facility has a positivity rate of 30% or more. If so, an urgent alert is sent alongside the weekly report. I chose “30% or more” rather than “above 30%” so borderline cases are not missed.

Press enter or click to view image in full size
Workflow 2. Weekly totals by facility, an AI-written summary and an urgent alert for high positivity.

Results

In testing, a report with 15 positives from 12 tests was blocked and flagged, and a second report from the same health worker on the same day was stopped. The weekly report correctly showed 78 clients seen, 60 tests and 15 positive results, a positivity rate of 25.0%, and named Karu PHC as the highest at 30.0%, which also triggered the urgent alert.

A separate error workflow watches both automations, so if anything breaks, I get an email naming the failed step.

What I learned

  • Check the data before you trust it. My own robot once reported 0 positive results because of one mismatched column name. I only caught it because I compared the total with the raw data.
  • Think about next month, not just today. Without the 7-day filter, the report would have quietly added up every week since the start.
  • Let the workflow do the maths and the AI do the writing. It keeps the numbers accurate.
  • Small samples need care. A facility with 5 positives from 10 tests has a high rate, but it is less reliable than one with 40 tests.

What’s next

I’d like to add reminders for health workers who haven’t submitted a report, a simple trend dashboard by facility, and alerts by SMS or WhatsApp.

If you work in health data, M&E or automation, I’d love to hear your feedback. You can find me on LinkedIn as David Adukwu.

--

--