# apache/airflow architecture

> Architecture diagram of the GitHub repository apache/airflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apache/airflow
- Repository: https://github.com/apache/airflow
- Video tour (about a minute): https://gitdiagram.com/apache/airflow/video

## Overview

Apache Airflow is a platform for authoring, scheduling, executing, and monitoring code-defined workflows (DAGs). The main path is workflow authoring through task scheduling and worker execution, followed by status inspection and troubleshooting in the UI or CLI. The tree also exposes public and execution APIs, authentication, provider discovery, and task-runtime serialization. README statements support the broad workflow links; sampled source and the limited index do not establish detailed scheduler-to-database or API routing, so those links are omitted or marked unverified.

Main entry points: [`airflow-core/src/airflow/api_fastapi/app.py`](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/app.py) (API application), [`airflow-core/src/airflow`](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow) (Task workers), [`task-sdk/src/airflow/sdk`](https://github.com/apache/airflow/tree/main/task-sdk/src/airflow/sdk) (Task SDK), [`airflow-core/src/airflow/ui`](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/ui) (Airflow UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Workflow authoring"]
  node_task_sdk["Task SDK"]
  node_dag_processor["DAG processing"]
end

subgraph group_runtime["Scheduling and execution"]
  node_scheduler["Scheduler"]
  node_workers["Task workers"]
  node_execution_api["Execution API"]
  node_serde["Task serialization<br/>[datetime.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_ui["Airflow UI"]
  node_cli["Command-line tools<br/>[cli_config.py]"]
end

subgraph group_platform["API and platform services"]
  node_api_app["API application<br/>[app.py]"]
  node_core_api["Core API"]
  node_auth["Authentication"]
  node_provider_runtime["Provider runtime"]
  node_metadata_db[("Metadata database")]
end

node_user(("Workflow author"))

node_user -->|"authors DAGs"| node_task_sdk
node_task_sdk -.->|"defines workflows"| node_dag_processor
node_dag_processor -.->|"provides DAGs"| node_scheduler
node_scheduler -->|"dispatches tasks"| node_workers
node_workers -.->|"uses task endpoints"| node_execution_api
node_workers -.->|"serializes values"| node_serde
node_user -->|"monitors workflows"| node_ui
node_user -->|"manages DAGs"| node_cli
node_ui -.->|"requests data"| node_api_app
node_cli -.->|"invokes API"| node_api_app
node_api_app -.->|"routes requests"| node_core_api
node_api_app -.->|"registers auth"| node_auth
node_core_api -.->|"reads workflow state"| node_metadata_db
node_provider_runtime -->|"loads SDK interfaces"| node_task_sdk

click node_task_sdk "https://github.com/apache/airflow/tree/main/task-sdk/src/airflow/sdk"
click node_dag_processor "https://github.com/apache/airflow/tree/main/airflow-core/src/airflow"
click node_scheduler "https://github.com/apache/airflow/tree/main/airflow-core/src/airflow"
click node_workers "https://github.com/apache/airflow/tree/main/airflow-core/src/airflow"
click node_execution_api "https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/api_fastapi/execution_api"
click node_serde "https://github.com/apache/airflow/blob/main/task-sdk/src/airflow/sdk/serde/serializers/datetime.py"
click node_ui "https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/ui"
click node_cli "https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/cli/cli_config.py"
click node_api_app "https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/app.py"
click node_core_api "https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/api_fastapi/core_api"
click node_auth "https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py"
click node_provider_runtime "https://github.com/apache/airflow/blob/main/task-sdk/src/airflow/sdk/providers_manager_runtime.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_task_sdk,node_dag_processor toneBlue
class node_scheduler,node_workers,node_execution_api,node_serde toneAmber
class node_ui,node_cli toneMint
class node_api_app,node_core_api,node_auth,node_provider_runtime,node_metadata_db toneRose
class node_user toneIndigo
```

## Components

### Workflow authoring

- [Task SDK](https://github.com/apache/airflow/tree/main/task-sdk/src/airflow/sdk): `task-sdk/src/airflow/sdk`
- [DAG processing](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow): `airflow-core/src/airflow`

### Scheduling and execution

- [Scheduler](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow): `airflow-core/src/airflow`
- [Task workers](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow): `airflow-core/src/airflow`
- [Execution API](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/api_fastapi/execution_api): `airflow-core/src/airflow/api_fastapi/execution_api`
- [Task serialization](https://github.com/apache/airflow/blob/main/task-sdk/src/airflow/sdk/serde/serializers/datetime.py): `task-sdk/src/airflow/sdk/serde/serializers/datetime.py`

### User interfaces

- [Airflow UI](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/ui): `airflow-core/src/airflow/ui`
- [Command-line tools](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/cli/cli_config.py): `airflow-core/src/airflow/cli/cli_config.py`

### API and platform services

- [API application](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/app.py): `airflow-core/src/airflow/api_fastapi/app.py`
- [Core API](https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/api_fastapi/core_api): `airflow-core/src/airflow/api_fastapi/core_api`
- [Authentication](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py): `airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py`
- [Provider runtime](https://github.com/apache/airflow/blob/main/task-sdk/src/airflow/sdk/providers_manager_runtime.py): `task-sdk/src/airflow/sdk/providers_manager_runtime.py`
- **Metadata database**

### Other components

- **Workflow author**

## Connections

- Workflow author → Task SDK: authors DAGs
- Task SDK → DAG processing: defines workflows (evidence: `airflow-core/src/airflow/exceptions.py`)
- DAG processing → Scheduler: provides DAGs
- Scheduler → Task workers: dispatches tasks
- Task workers → Execution API: uses task endpoints (evidence: `airflow-core/src/airflow/api_fastapi/app.py`)
- Task workers → Task serialization: serializes values (evidence: `airflow-core/src/airflow/api_fastapi/common/types.py`)
- Workflow author → Airflow UI: monitors workflows
- Workflow author → Command-line tools: manages DAGs
- Airflow UI → API application: requests data
- Command-line tools → API application: invokes API
- API application → Core API: routes requests (evidence: `airflow-core/src/airflow/api_fastapi/app.py`)
- API application → Authentication: registers auth (evidence: `airflow-core/src/airflow/api_fastapi/app.py`)
- Core API → Metadata database: reads workflow state
- Provider runtime → Task SDK: loads SDK interfaces (evidence: `task-sdk/src/airflow/sdk/providers_manager_runtime.py`)
