airflow README

The project's README from github.com/apache/airflow. As one markdown file: README.md.

Apache Airflow

Category Badges
License License
PyPI PyPI version PyPI - Python Version PyPI - Downloads
Containers Docker Pulls Docker Stars Artifact HUB
Community Contributors Slack Status Commit Activity LFX Health Score
Dev tools prek
Version Build Status
Main Tests AMD main Tests ARM main
3.x Tests AMD 3.2 Tests ARM 3.2
Apache Airflow logo

Apache Airflow (or simply Airflow) is a platform to programmatically author, schedule, and monitor workflows.

When workflows are defined as code, they become more maintainable, versionable, testable, and collaborative.

Use Airflow to author workflows (Dags) that orchestrate tasks. The Airflow scheduler executes your tasks on an array of workers while following the specified dependencies. Rich command line utilities make performing complex surgeries on Dags a snap. The rich user interface makes it easy to visualize pipelines running in production, monitor progress, and troubleshoot issues when needed.

Table of contents

Project Focus

Airflow works best with workflows that are mostly static and slowly changing. When the Dag structure is similar from one run to the next, it clarifies the unit of work and continuity. Other similar projects include Luigi, Oozie and Azkaban.

Beyond traditional data pipelines, Airflow is widely used to orchestrate machine learning workflows — training, retraining, evaluation, and deployment — and increasingly to orchestrate agentic and LLM-based workloads, coordinating the steps of an AI pipeline (data prep, tool calls, model invocation, evaluation) rather than acting as the agent itself. This isn't a new direction: teams have run ML and AI workloads on Airflow for years, and the ecosystem of providers supporting these use cases (see the AI & ML section of the Airflow registry) continues to grow.

Airflow is commonly used to process data, but has the opinion that tasks should ideally be idempotent (i.e., results of the task will be the same, and will not create duplicated data in a destination system), and should not pass large quantities of data from one task to the next (though tasks can pass metadata using Airflow's XCom feature). For high-volume, data-intensive tasks, a best practice is to delegate to external services specializing in that type of work.

Airflow is not a streaming solution, but it is often used to process real-time data, pulling data off streams in batches.

Principles

Requirements

Apache Airflow is tested with:

Main version (dev) Stable version (3.3.0) Deprecate version (2.11.2)
Python 3.10, 3.11, 3.12, 3.13, 3.14 3.10, 3.11, 3.12, 3.13, 3.14 3.10, 3.11, 3.12
Platform AMD64/ARM64 AMD64/ARM64 AMD64/ARM64(*)
Kubernetes 1.30, 1.31, 1.32, 1.33, 1.34, 1.35 1.30, 1.31, 1.32, 1.33, 1.34, 1.35 1.26, 1.27, 1.28, 1.29, 1.30
PostgreSQL 14, 15, 16, 17, 18 14, 15, 16, 17, 18 12, 13, 14, 15, 16
MySQL 8.0, 8.4, Innovation 8.0, 8.4, Innovation 8.0, Innovation
SQLite 3.15.0+ 3.15.0+ 3.15.0+

* Experimental

Note: MariaDB is not tested/recommended.

Note: SQLite is used in Airflow tests. Do not use it in production. We recommend using the latest stable version of SQLite for local development.

Note: Airflow currently can be run on POSIX-compliant Operating Systems. For development, it is regularly tested on fairly modern Linux Distros and recent versions of macOS. On Windows you can run it via WSL2 (Windows Subsystem for Linux 2) or via Linux Containers. The work to add Windows support is tracked via #10388, but it is not a high priority. You should only use Linux-based distros as "Production" execution environment as this is the only environment that is supported. The only distro that is used in our CI tests and that is used in the Community managed DockerHub image is Debian Bookworm.

Getting started

Visit the official Airflow website documentation (latest stable release) for help with installing Airflow, getting started, or walking through a more complete tutorial.

Note: If you're looking for documentation for the main branch (latest development branch): you can find it on s.apache.org/airflow-docs.

For more information on Airflow Improvement Proposals (AIPs), visit the Airflow Wiki.

Documentation for dependent projects like provider distributions, Docker image, Helm Chart, you'll find it in the documentation index.

Installing from PyPI

We publish Apache Airflow as apache-airflow package in PyPI. Installing it however might be sometimes tricky because Airflow is a bit of both a library and application. Libraries usually keep their dependencies open, and applications usually pin them, but we should do neither and both simultaneously. We decided to keep our dependencies as open as possible (in pyproject.toml) so users can install different versions of libraries if needed. This means that pip install apache-airflow will not work from time to time or will produce unusable Airflow installation.

To have repeatable installation, however, we keep a set of "known-to-be-working" constraint files in the orphan constraints-main and constraints-2-0 branches. We keep those "known-to-be-working" constraints files separately per major/minor Python version. You can use them as constraint files when installing Airflow from PyPI. Note that you have to specify correct Airflow tag/version/branch and Python versions in the URL.

  1. Installing just Airflow:

Note: Only pip and uv installation is currently officially supported.

While it is possible to install Airflow with tools like Poetry or pip-tools, they do not share the same workflow as pip - especially when it comes to constraint vs. requirements management. Installing via Poetry or pip-tools is not currently supported.

If you wish to install Airflow using those tools, you should use the constraint files and convert them to the appropriate format and workflow that your tool requires.

pip install 'apache-airflow==3.3.0' \
 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.3.0/constraints-3.10.txt"
  1. Installing with extras (i.e., postgres, google)
pip install 'apache-airflow[postgres,google]==3.3.0' \
 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.3.0/constraints-3.10.txt"

For information on installing provider distributions, check providers.

Installation

For comprehensive instructions on setting up your local development environment and installing Apache Airflow, please refer to the INSTALLING.md file.

Official source code

Apache Airflow is an Apache Software Foundation (ASF) project, and our official source code releases:

Following the ASF rules, the source packages released must be sufficient for a user to build and test the release provided they have access to the appropriate platform and tools.

Convenience packages

There are other ways of installing and using Airflow. Those are "convenience" methods - they are not "official releases" as stated by the ASF Release Policy, but they can be used by the users who do not want to build the software themselves.

Those are - in the order of most common ways people install Airflow:

All those artifacts are not official releases, but they are prepared using officially released sources. Some of those artifacts are "development" or "pre-release" ones, and they are clearly marked as such following the ASF Policy.

User Interface

Semantic versioning

As of Airflow 2.0.0, we support a strict SemVer approach for all packages released.

There are few specific rules that we agreed to that define details of versioning of the different packages:

airflow (apache/airflow)

Searching Database…

47.2K ·GitHub
这是什么?Apache Airflow 是一个平台,用于以代码方式编写、调度和监控工作流,工作流使用 Python 定义。
这是一个库还是独立应用?两者都是:Airflow 以 Python 包(PyPI 上的 apache-airflow)形式发布,但运行起来像一个完整的应用,包含调度器、工作进程、数据库和 Web 界面,需要你自行部署和运行。
怎样才能把它跑起来?可以用 pip(或 uv)从 PyPI 安装,并使用官方约束文件以保证安装结果可重复;也可以通过社区提供的 Docker 镜像或 Kubernetes 上的 Helm Chart 运行。INSTALLING.md 文件中有完整的本地安装说明。
安装之前需要准备什么,比如特定的 Python、数据库或操作系统?需要 Python 3.10–3.14、受支持的数据库(PostgreSQL 14-18、MySQL 8.0/8.4,或仅用于本地测试的 SQLite),以及符合 POSIX 标准的操作系统。官方在生产环境中支持 Linux,开发时使用 macOS 也没问题。
安装或平台方面有哪些需要注意的坑?直接运行 pip install apache-airflow 可能导致安装结果损坏,因为依赖版本没有锁定,所以必须使用 Airflow 的约束文件。另外,Windows 不原生支持,需要使用 WSL2 或容器;SQLite 绝对不能用于生产环境。
它是为谁设计的?什么样的工作流最适合用它?它主要面向数据工程师和机器学习工程师,适合运行大多是静态、变化缓慢的数据管道。它也越来越多地被用于编排机器学习的训练与重新训练,以及智能体(agentic)和大语言模型(LLM)流水线中的步骤;但它并不适合流式处理,也不适合在任务之间传递大量数据。
如何可视化并调试正在运行的流水线?Web 界面提供 Dags、Grid 和 Graph 视图,可以查看各次运行随时间变化的状态,以及每次运行的依赖关系图;还有一个 Home 页面,显示环境概要统计信息,以及一个 Backfill 视图,用于重新运行历史日期范围的任务。
任务之间能传递数据吗?任务应当设计为幂等的,且不应直接传递大量数据。Airflow 的 XCom 功能允许任务交换少量元数据,而大量的数据处理则交给外部系统完成。
Airflow 与 Luigi 或 Oozie 相比如何?Airflow 与 Luigi、Oozie 和 Azkaban 同属工作流编排工具。它的特点是 Dags 以代码定义、命令行工具功能丰富,并提供用于监控的 Web 界面。
除了 PyPI,还有哪些发布渠道?除了可以通过 pip 安装的 PyPI 版本,Airflow 还提供便捷的 Docker 镜像(可用于 Kubernetes、Helm、docker-compose 和 docker swarm),以及带标签的 GitHub 源代码;不过只有 ASF 官方的源码包才是正式发布版本。
Creator
apache
Size
745.6 MB
Stars
47.2K
Age
11y
Commits · 90 Days