Leanpub Header

Skip to main content

Apache Airflow Cookbook

Handy solutions to build, containerize and troubleshoot production ETL, ELT, MLOps and AIOps pipelines

Apache Airflow Cookbook
This book is 100% completeLast updated on 2026-09-11

We'll be working on a platform made up of seventy-nine recipes together. It starts off as a simple task, printing a line, but by the last chapter it covers extraction, warehousing, containers, machine learning and incident response. You can't just throw away examples in your work, and you shouldn't be doing that in your examples either. You don't need to be an Airflow expert to get started. What you're really learning here isn't a tool. It's all about making sure work is repeatable, observable and safe to rerun.

Minimum price

$29.99

$29.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
About

About

About the Book

At some point, every data team hits the same roadblock. Each night, the script that used to run smoothly starts to go wrong at 2 a.m. No one knows what step has gone wrong, and reruns are double-counting the numbers that the finance team has already published. Apache Airflow is great because it's been rebuilt from the ground up to suit the way work teams actually do things today.

This cookbook provides you hundreds of solutions that are independent and will take you from the first installation to a platform that supports ETL, ELT, MLOps, AIOps and business operations all at the same time. Each recipe starts with a real problem, has short and easy-to-read code, and ends by showing how the fix works with real terminal output. We can learn to author DAGs with the Task SDK, schedule pipelines on data rather than on the clock, bind extractions so reruns repair instead of duplicates, and run any task inside its own container. We will be practising to write custom operators, packaging them for other teams, extending Airflow through plugins and secrets backends, orchestrating model training and promotion, provisioning infrastructure that tears itself down, and diagnosing stalls from their symptoms.

To me, this book is best suited for every software engineer, backend developer and every such platform teams who keep on building, running and troubleshooting the workflows every day.

Key Learnings
  • Convert legacy operator DAGs into TaskFlow functions that infer dependencies from ordinary calls
  • Bound every extraction to its data interval so reruns repair rather than duplicate
  • Schedule pipelines on asset updates instead of guessing when upstream work finishes
  • Fan tasks out dynamically over lists discovered at runtime using expand and partial
  • Run any task inside a Kubernetes pod with its own image and resources
  • Write custom operators, hooks and sensors, then package them as installable providers
  • Extend Airflow through plugins, macros, secrets backends and custom XCom storage
  • Orchestrate model training, registry logging and promotion gates without a serving endpoint
  • Provision ephemeral infrastructure with setup and teardown pairs that always release resources
  • Diagnose stuck queues, starved pools and zombie tasks from their distinct symptoms

Table of Content
  1. Getting Airflow 3 Running
  2. Authoring DAGs with Task SDK
  3. Scheduling, Assets and Event-Driven Pipelines
  4. Building ETL Pipelines
  5. ELT and Warehouse Orchestration
  6. Extracting Insights from Batch Processes
  7. Containers and Kubernetes
  8. Custom Operators, Hooks and Sensors
  9. Plugin Interface and Extending Airflow
  10. Managing ML Pipelines
  11. AIOps, Infrastructure and Business Operations
  12. Testing, Monitoring and Troubleshooting

Target Readers

You don't need to be an Airflow pro or an expert to get started with this book. All you need is to be curious, have a Linux machine and be ready to run the commands instead of just reading them. If you're committed to creating a strong, flexible and expandable workflow, you're on the right track.

Author

About the Author

GitforGits | Asian Publishing House

We are the engineer’s publisher, the coder’s mentor, and the content alchemist—meticulously turning dense tech into practical gold. With a growing library of 100+ titles, we don’t just develop technical books, rather we build roadmaps for professionals across Python, MySQL, DevOps, Rust, AI, Kotlin, Arduino, Golang and everything around the massive IT ecosystem. Every chapter, every script, every project is a tool in the hands of developers who want to get things done.

Where others summarize, we construct step-by-step learning blueprints, cutting through clutter, banning the fluff, and ensuring every paragraph delivers hands-on value. Our audience isn’t learning from scratch—they’re leveling up with purpose, and we stand by them with code-first content, consistent project workflows, and a zero-redundancy approach.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub