Apache Airflow Core
Apache Airflow Core (part of the main `apache-airflow` distribution) provides the foundational components for the Apache Airflow platform, a powerful tool for programmatically authoring, scheduling, and monitoring data workflows. It includes the scheduler, API server, DAG file processor, and triggerer. Workflows, known as Directed Acyclic Graphs (DAGs), are defined as Python code, making them maintainable, versionable, and collaborative. Airflow follows semantic versioning, with minor releases typically every 2-3 months and patch releases as needed. Major versions, such as 3.x, introduce backwards-incompatible changes and are released on an irregular schedule. The current version of `apache-airflow` is 3.2.0.
Warnings
- breaking Direct database access from worker nodes and tasks has been removed in Airflow 3.x. Tasks and custom operators must now communicate through the REST API instead of direct database connections. Existing DAGs and custom operators that accessed the metadata database directly will require refactoring.
- breaking SubDAGs have been removed in Airflow 3.x. They are replaced by `TaskGroups`, Assets, and Data Aware Scheduling.
- breaking The `/api/v1` REST API has been replaced by the modern FastAPI-based `/api/v2`.
- breaking The `catchup_by_default` DAG parameter is now `False` by default in Airflow 3.x, changing the default behavior for DAGs scheduled to run for past intervals.
- deprecated Airflow 2.x reaches its end-of-life in April 2026. Staying on Airflow 2.x after this date will introduce security risks as CVEs cannot be patched anymore due to old dependencies.
- gotcha Plain `pip install apache-airflow` might occasionally lead to an unusable installation due to dependency conflicts. Airflow keeps its dependencies open (in `pyproject.toml`) for user flexibility, but this requires careful management.
Install
-
pip install "apache-airflow[standard]==3.2.0" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.2.0/constraints-3.10.txt" -
pip install "apache-airflow[standard]==AIRFLOW_VERSION" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-AIRFLOW_VERSION/constraints-PYTHON_VERSION.txt"
Imports
- DAG
from airflow import DAG
- datetime
from datetime import datetime
- BashOperator
from airflow.operators.bash import BashOperator
- PythonOperator
from airflow.operators.python import PythonOperator
Quickstart
from airflow import DAG
from airflow.operators.bash import BashOperator
from datetime import datetime, timedelta
with DAG(
dag_id='hello_world_dag',
start_date=datetime(2026, 1, 1),
schedule_interval=timedelta(days=1),
catchup=False, # Default in Airflow 3.x is False
tags=['example'],
) as dag:
start_task = BashOperator(
task_id='start',
bash_command='echo "Starting hello_world_dag"',
)
hello_task = BashOperator(
task_id='hello',
bash_command='echo "Hello, Airflow!"',
)
world_task = BashOperator(
task_id='world',
bash_command='echo "This is a simple DAG."',
)
end_task = BashOperator(
task_id='end',
bash_command='echo "Finished hello_world_dag"',
)
start_task >> hello_task >> world_task >> end_task