Skip to content

Prefect Examples

Progressive Prefect 3 examples -- from hello-world to production patterns.

What you will learn

This project walks through 134 self-contained flows that cover the full spectrum of Prefect 3 capabilities:

  • Basics -- flows, tasks, parameters, return values
  • Control flow -- branching, state hooks, parameterisation
  • Composition -- subflows, dynamic task mapping
  • Operational -- polling, retries, error handling, caching
  • Reuse and events -- shared task libraries, custom events
  • Data processing -- file I/O, quality rules, incremental processing
  • Analytics -- correlation, regression, dimensional modeling
  • DHIS2 integration -- custom credentials block, API client, metadata and analytics pipelines
  • Deployments -- flow.serve(), flow.deploy(), prefect.yaml, work pools
  • Advanced -- concurrency limits, variables, transactions, async patterns, circuit breakers, and end-to-end pipelines

Every example notes its Airflow equivalent so you can map existing knowledge directly.

Page Description
Getting Started Prerequisites, installation, first run
Tutorials Step-by-step walkthroughs for common tasks
Core Concepts Prefect fundamentals and Airflow comparison
Flow Reference Detailed walkthrough of all 134 flows
Patterns Common patterns and best practices
Feature Coverage Prefect 3 feature coverage matrix and gaps
Infrastructure Docker Compose stack and local dev setup
CLI Reference Prefect CLI commands used in this project
API Reference Auto-generated docs for Dhis2Client, Dhis2Credentials
Testing How to test Prefect flows