Registry / workflow / apache-airflow

apache-airflow

JSON →
library3.3.1pypypi✓ verified 24d ago

Apache Airflow is an open-source platform used to programmatically author, schedule, and monitor workflows, particularly for data pipelines. It defines workflows as Directed Acyclic Graphs (DAGs) in Python, enabling dynamic, scalable, and extensible orchestration. The current stable version is 3.1.8, with releases occurring regularly to introduce new features, improvements, and bug fixes.

pip install "apache-airflow[celery,cncf.kubernetes,http,postgres,amazon]"==3.1.8 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.1.8/constraints-3.10.txt"
INSTALL
IMPORT
SIG · APACHE-AIRFLOW
A
apache-airflow
workflowpythonv3.3.1
Install
38.1s avg
Import
5522ms
Disk
827MB
Pass rate
3/ 10
Env Coverage3 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.1.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
1/2 runs
✓ 41.15s
py 3.11
1/2 runs
✓ 41s
py 3.12
1/2 runs
✓ 32.2s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✕ build_error
827MB installed
● package 827MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DAG
from airflow.models.dag import DAG
BashOperator
from airflow.operators.bash import BashOperator
PythonOperator
from airflow.operators.python import PythonOperator
TaskGroup
from airflow.utils.task_group import TaskGroup
Provider specific operators (e.g., S3Operator)
from airflow.providers.amazon.operators.s3 import S3Operator
from airflow.operators.s3_operator import S3Operator
Operators specific to external systems are now in provider packages (e.g., airflow.providers.<provider_name>.operators). The old top-level `airflow.operators` path is deprecated for these.
XComArg
from airflow.models.xcom_arg import XComArg
from airflow.utils.task_group import XComArg
XComArg moved to airflow.models.xcom_arg in Airflow 3.0.

This quickstart defines a simple DAG with Bash and Python operators. To run this locally after installing Airflow, save the code as a `.py` file (e.g., `dags/quickstart_dag.py`) in your `AIRFLOW_HOME/dags` directory. Then, initialize the database and start the Airflow standalone environment. **To set up and run Airflow locally (assuming `apache-airflow` is installed with `sqlite` support via `pip install "apache-airflow[sqlite]"`):** ```bash # (Optional) Set AIRFLOW_HOME, e.g., to a temporary directory export AIRFLOW_HOME=$(pwd)/airflow_home # Initialize the database and create an admin user (first time only) airflow standalone # Follow prompts to set admin password. This command also starts webserver, scheduler, and triggerer. # You can also start components separately: # airflow db migrate # airflow users create --username admin --firstname Airflow --lastname Admin --role Admin --email admin@example.com -p mypassword # airflow webserver --port 8080 # airflow scheduler # airflow triggerer # After starting, visit http://localhost:8080 to enable the DAG. ``` Remember to define `AIRFLOW_HOME` before running `airflow standalone` or `airflow db init`.

import os from datetime import datetime from airflow.models.dag import DAG from airflow.operators.bash import BashOperator from airflow.operators.python import PythonOperator # Set AIRFLOW_HOME if not already set (e.g., in a local dev setup) # os.environ['AIRFLOW_HOME'] = os.environ.get('AIRFLOW_HOME', '~/airflow') def _greet(name): print(f"Hello, {name} from a Python task!") with DAG( dag_id='simple_airflow_quickstart', start_date=datetime(2023, 1, 1), schedule_interval='@daily', catchup=False, tags=['quickstart'], ) as dag: start_task = BashOperator( task_id='start_workflow', bash_command='echo "Starting the workflow!"', ) greet_task = PythonOperator( task_id='greet_with_python', python_callable=_greet, op_kwargs={'name': 'Airflow User'}, ) end_task = BashOperator( task_id='end_workflow', bash_command='echo "Workflow finished!"', ) start_task >> greet_task >> end_task
airflow --version
Debug
Known issues
breakingDirect metadata database access from task code is restricted in Airflow 3. Tasks can no longer directly import and use Airflow database sessions or models. All runtime interactions (state transitions, heartbeats, XComs, resource fetching) must now use the dedicated Task Execution API or the official Python API Client.
fix
Rewrite task code to use the Task Execution API or the Airflow Python Client for database interactions. Avoid direct SQLAlchemy imports or session usage within task logic. Consider requesting new API endpoints or Task SDK features if required functionality is missing.
affects: 3.0.0+
breakingSubDAGs have been removed in Airflow 3. They are replaced by TaskGroups, Assets, and Data Aware Scheduling.
fix
Migrate existing SubDAGs to use TaskGroups for grouping related tasks, or explore using Assets and Data Aware Scheduling for more advanced scenarios.
affects: 3.0.0+
breakingThe Sequential Executor has been removed in Airflow 3. It is replaced by the LocalExecutor, which can still be used with SQLite for local development.
fix
Update Airflow configuration to use `LocalExecutor` instead of `SequentialExecutor`.
affects: 3.0.0+
deprecatedSLAs (Service Level Agreements) are deprecated and have been removed in Airflow 3. They will be replaced by forthcoming Deadline Alerts.
fix
Remove SLA definitions from DAGs. Monitor for the introduction of 'Deadline Alerts' as a replacement.
affects: 3.0.0+
gotchaAvoid using relative imports in DAG files (e.g., `from . import my_module`). The same DAG file might be parsed in different contexts (scheduler, workers, tests), leading to inconsistent behavior.
fix
Always use full Python package paths for imports within DAGs. Ensure shared code is either installed as a Python package or added to `PYTHONPATH` with a unique top-level name to prevent clashes.
affects: All
gotchaDo not use Airflow Variables or Connections at the top level of DAG files (i.e., outside of task `execute()` methods or Jinja templates). This can cause slow DAG parsing and unexpected behavior, as the values are fetched every time the DAG file is parsed.
fix
Access Airflow Variables and Connections inside operator `execute()` methods, or pass them to operators using Jinja templating, which defers evaluation until task execution. For sensitive data, use Secrets Backend.
affects: All
breakingApache Airflow 3.x requires Python 3.10 or newer. Attempting to install Airflow 3.x on Python 3.9 or older will result in a Python version incompatibility error during package resolution.
fix
Upgrade your Python environment to version 3.10 or a newer compatible version (e.g., Python 3.10, 3.11, 3.12).
affects: 3.0.0+
breakingInstalling Apache Airflow 3.x on Alpine-based Python images (e.g., `python:3.13-alpine`) fails due to missing C/C++ build tools required by dependencies like `grpcio`. Minimal Alpine images do not include these development packages by default.
fix
Add C/C++ build tools to the Dockerfile before installing Python packages (e.g., `apk add --no-cache build-base g++` for Alpine), or use a non-Alpine Python base image (e.g., `python:3.13-slim`).
affects: 3.0.0+
Upgrade
Version history
3.3.1latest on PyPI · released Aug 12, 2026
Audit
Dependencies
apache-airflow-providers-cncf-kubernetesoptionalRequired for KubernetesExecutor or KubernetesPodOperator.
apache-airflow-providers-celeryoptionalRequired for CeleryExecutor.
apache-airflow-providers-amazonoptionalProvides operators and hooks for AWS services.
apache-airflow-providers-postgresoptionalRequired for PostgreSQL backend database.
apache-airflow-providers-httpoptionalProvides HttpOperator and HttpHook for interacting with HTTP APIs.
Agent activity
76 hits · last 30 days
node
64
OpenAI (training)
1
Resources
apache-airflow — pip install apache-airflow · libregistry