Dear Community,
We’re excited to announce two things at once: a new MinIO adaptor, and a ready-to-use template, DHIS2 to MinIO, that puts it to work landing DHIS2 analytics data straight into a data lake.
The OpenFn MinIO adaptor
The new @openfn/language-minio adaptor gives your workflows direct read/write access to a MinIO (or any S3-compatible) bucket. It exposes:
-
createBucket(bucketName, [region], [options]): create a new bucket, optionally with object locking enabled -
putObject(bucketName, objectName, data, [options]):upload an object (JSON, NDJSON, CSV, or raw), with support for custom content types and metadata -
getObject(bucketName, objectName, [options]): retrieve and optionally parse an object as JSON, NDJSON, or CSV -
listObjects(bucketName, [options]): list objects in a bucket, with prefix filtering and recursive listing -
getObjectTags(bucketName, objectName)/setObjectTags(bucketName, objectName, tags, [putOpts]): read and write object tags, useful for marking data as raw vs. processed, tracking source system, etc.
Together these cover the core pattern of a landing zone: write raw extracts in, tag them, list what’s there, and read them back out for downstream processing.
The template: DHIS2 to MinIO
To show the adaptor in action, we’ve published a template that pulls DHIS2 analytics data and writes it into a MinIO bucket as structured JSON snapshots — a real extract-and-load pipeline from a live source system into a data lake.
The example workflow (built against an EPI/immunization use case) does the following:
-
Fetch EPI data elements from DHIS2 — starts with a clearly marked configuration block where you set your own data element group ID(s), org unit ID, and reporting period range (start/end), then looks up data element groups, collects all data element IDs, and chunks them into small batches so each analytics request stays within DHIS2’s limits.
-
Pull analytics data from DHIS2 — sequentially works through each org unit level (facility, district, region, etc.) and each reporting period, pulling analytics values chunk by chunk. Processing levels one at a time (rather than firing them all at once) keeps requests manageable and avoids overwhelming the DHIS2 instance.
-
Upload analytics snapshot to MinIO — writes one JSON object per org unit level and period to the bucket, under a path like
raw/analytics/epi/level_<n>/<period>.json, each tagged with its source, extraction time, and the query that produced it. The result is a raw, well-organized landing zone in MinIO that a downstream ELT tool can pick up and load into a warehouse’s staging tables.
Key features
-
Chunks large data element lists automatically to stay within DHIS2 request limits
-
Processes org unit levels sequentially, so it scales to instances with a lot of analytics data without overwhelming the source system
-
Writes each period/level combination as its own JSON object, with source metadata baked in (source system, extraction timestamp, query parameters)
-
Runs on a schedule (cron trigger, disabled by default so you can configure it first)
Under the hood
-
@openfn/language-dhis2@8.0.13— fetches data element metadata and analytics values from the DHIS2 API -
@openfn/language-minio@1.1.2— writes the resulting JSON snapshots to a MinIO bucket
Getting started
- Log in at app.openfn.org (or register for a free cloud project)
- Click Create Workflow in your project workspace
- Search templates for “
DHIS2 to MinIO” (tags:dhis2, minio, datalake, analytics, warehouse) - Add your DHIS2 credential to the two fetch jobs and your MinIO credential to the upload job
- Set your data element group ID(s), org unit, and period range in the “CONFIGURE ME” block, run manually to check the logs, then enable the trigger
One heads-up: the period generator assumes a 12-month calendar, so if your instance uses a different calendar (e.g. the Ethiopian 13-month calendar), adjust generatePeriods() in the first job.
For the full story, including where OpenFn fits in a data warehouse architecture and why we recommend pairing it with dedicated ELT tools like dbt, read the blog post: OpenFn: New MinIO Adaptor: Land DHIS2 Data in Your Data Lake | OpenFn
Questions about configuring it for your instance? Ask away below. ![]()
Author: @AishaH
Happy automating!
The OpenFn Team