Apache Airflow Fundamentals
Apache Airflow is a platform for authoring, scheduling, and monitoring batch data pipelines as directed acyclic graphs defined in Python. It manages task dependencies, retries failures, and provides a web interface for observing pipeline execution.
itData engineering and analytics | OpenSkills.info
Intro
Apache Airflow Fundamentals
Apache Airflow develops, schedules, and monitors batch-oriented workflows. You define a workflow in Python. Airflow turns that definition into scheduled task instances, tracks their state, and exposes their history through a user interface and API.
The central mental model is a control plane for repeatable work.
Python Dag -> parsed definition -> Dag run -> task instances -> external systems
| | |
metadata database scheduler executor
Airflow coordinates work. It does not need to perform every computation itself. A task can submit SQL, start a container, call an API, run Python, or invoke another system through a provider.
Why workflow orchestration exists
A data pipeline rarely consists of one operation. You might wait for an input, validate it, transform it, publish a table, and notify an owner. Each step has dependencies, retries, credentials, logs, and an operating schedule.
A collection of scripts can run those steps. It becomes difficult to answer basic operational questions as the collection grows:
- Which step is ready to run?
- Which input period does this run cover?
- What failed, and how many times did it retry?
- Can you rerun one step without repeating every step?
- What happened on a past date?
- How many workflows may use a scarce service at once?
Airflow records this control state. It schedules eligible work and gives operators one place to inspect it.
A Dag describes the workflow
A Dag is the Airflow model for a workflow. The name comes from directed acyclic graph. Directed edges express dependency order. Acyclic means a task cannot eventually depend on itself.
The Dag definition contains tasks, dependencies, schedule information, and operational settings. It describes the workflow. It is not one execution of that workflow.
extract -> validate -> transform -> publish
| |
+------> quarantine +-> notify
Each node is a task. Each edge says which task is upstream and which is downstream. By default, a task waits for its upstream tasks to succeed. Trigger rules can change that condition for branching, cleanup, and other control-flow needs.
Keep the graph focused on orchestration. The Dag should reveal the major units of work and their dependencies. Business computation belongs inside tasks or in the external systems that tasks invoke.
Airflow parses Dag files repeatedly. Top-level code therefore runs during parsing, not only during a scheduled run. Network calls, database queries, and expensive imports at the top level slow parsing and can overload dependencies. Put runtime work inside tasks.
A Dag run is one execution in time
A Dag run is one instance of a Dag. Several Dag runs can exist for the same Dag. Each run has its own task instances and state.
For a time-based schedule, a Dag run usually represents a data interval. A daily run might represent data from one midnight to the next. The scheduler normally creates the run after that interval ends, when the complete interval is available.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://airflow.apache.org/docs/apache-airflow/stable/
Supports
- Airflow as a platform for developing, scheduling, and monitoring batch-oriented workflows
- Python-defined workflows, extensibility, user-interface capabilities, and deployment range
- Dag attributes including schedules, tasks, dependencies, callbacks, and parameters
- https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/overview.html
Supports
- Dag and task dependency model
- Scheduler, executor, Dag processor, Dag bundle, API server, metadata database, worker, and triggerer responsibilities
- Airflow 3 component separation and task communication through the API server
- Operator, sensor, and TaskFlow task forms
- XCom for small metadata and external storage for large data
- User-interface visibility into Dags, runs, task state, and logs
- https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dags.html
Supports
- Dag as a workflow model containing tasks, schedules, dependencies, callbacks, and operating details
- Dependency notation, trigger rules, branching, TaskGroups, Dag loading, and Dag testing
- Repeated parsing of top-level Dag code and the cost of expensive top-level work
- Stable topology guidance for dynamically generated Dags
- https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/dag-run.html
Supports
- Dag runs as independent workflow instances with their own task instances
- Data interval and logical date semantics
- Run creation after a represented interval ends
- Catchup behavior and Dag run terminal state derived from leaf tasks
- Risk from permissive trigger rules on leaf tasks
- https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/backfill.html
Supports
- Backfill as explicit Dag run creation across a historical date range
- Reprocessing and concurrency controls for backfill runs
- https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/tasks.html
Supports
- Task as the basic execution unit and task instance as a task in a Dag run
- Operator, sensor, and TaskFlow task categories
- Task dependencies, trigger rules, retries, timeouts, and task states
- https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/taskflow.html
Supports
- TaskFlow authoring through decorated Python functions
- XComArg results, automatic dependencies, and implicit XCom movement
- Interoperation between TaskFlow tasks and traditional operators
- https://airflow.apache.org/docs/task-sdk/stable/
Supports
- The Task SDK and airflow.sdk namespace as the current Dag-authoring interface
- Separation of task execution from Airflow internals through the execution API
- Task runtime access to connections, variables, XComs, metrics, and logs
- https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/xcoms.html
Supports
- XCom identity, serialization, push and pull behavior, and TaskFlow return values
- XCom design for small values rather than dataframes or other large payloads
- Difference between per-task-instance XCom and global Variables
- https://airflow.apache.org/docs/apache-airflow/stable/best-practices.html
Supports
- Transaction-like task design and complete outputs
- Repeatable outcomes under retries, stable partition selection, upsert, and avoidance of current time in critical computation
- Dag loader tests, unit tests, self-checks, staging, dependency isolation, and upgrade preparation
- Reduction of top-level parsing work and Dag complexity
- https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/deferring.html
Supports
- Worker-capacity behavior of deferrable operators and triggerer-managed waits
- Resumption after an asynchronous trigger and the role of timeouts
- Difference between sensor reschedule mode and deferral
- https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/assets.html
Supports
- Asset as a logical grouping of data identified by a URI
- Producer asset updates and downstream consumer scheduling
- Airflow treatment of an asset URI as an identifier rather than inspected data
- Time-based, asset-aware, and combined scheduling concepts
- https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/pools.html
Supports
- Pools as limits on parallel execution for tasks that use shared constrained systems
- Pool slots, priority, and queued-task capacity decisions
- https://airflow.apache.org/docs/apache-airflow/stable/installation/dependencies.html
Supports
- Separate Airflow core, Task SDK, provider, extras, and external dependency packages
- Independent installation and upgrade of providers
- Limited integration set in a default installation
- https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/production-deployment.html
Supports
- SQLite as a testing backend and PostgreSQL or MySQL for production
- Distributed executor choices, Dag bundle delivery, durable logging, and component uptime
- Official container images, Helm-based deployment, and live upgrade concerns
- Restriction of sensitive configuration to components that require it
- https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/logging-monitoring/index.html
Supports
- Task and component logs, metrics, traces, callbacks, health checks, and error tracking
- Remote logging choices for distributed and disposable workers
- Component health and operational monitoring scope
- https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html
Supports
- Deployment manager, Dag author, and operations user roles
- Dag author code execution and trust boundaries
- Component isolation, credential restrictions, API protection, and workload security responsibilities
- Current multi-team isolation limitations
