AWS Builder Center

Apache Airflow 3 Meets AWS: Building Smarter, Event-Driven Data Pipelines

A practical guide to using Apache Airflow 3 with AWS services to build scalable, event-driven data pipelines across Amazon S3, EMR Serverless, AWS Batch, and Amazon Redshift.

Devops Engineer at Jio Platforms Ltd
Apache Airflow has long been the standard for orchestrating data workflows, but traditional schedule-based DAGs often wait for a fixed time even when no new data has arrived. Apache Airflow 3 changes that model by making event-driven orchestration a first-class capability. Combined with AWS services such as Amazon S3, Amazon EMR Serverless, AWS Batch, and Amazon Redshift, it enables teams to build pipelines that react to data as soon as it becomes available.
This article outlines a practical AWS architecture for Airflow 3 and explains how its newer orchestration concepts can improve reliability, scalability, and cost efficiency.

Why Airflow 3 matters on AWS

Airflow 3 introduces several improvements that are especially useful for cloud-native data platforms:
  • Event-driven scheduling: DAGs can be triggered by external events instead of relying only on cron-style schedules.
  • Task SDK: A cleaner Python interface for authoring tasks, reducing boilerplate and improving developer experience.
  • Task Execution API: A more flexible execution model that separates task execution from the Airflow scheduler and webserver.
  • Improved modularity: Better separation between orchestration logic and execution infrastructure.
For AWS users, these changes align naturally with event-driven services. A file landing in S3, a message arriving in an SQS queue, or a job completing in AWS Batch can all become triggers for downstream processing.

Reference architecture

A common modern data pipeline follows this flow:
  1. Ingest: Source systems upload raw files to an Amazon S3 landing bucket.
  1. Trigger: An S3 event notification is sent to Amazon EventBridge or Amazon SQS.
  1. Orchestrate: Airflow 3 receives or detects the event and starts the appropriate DAG.
  1. Process: The DAG submits a Spark job to Amazon EMR Serverless or a containerized workload to AWS Batch.
  1. Load: Processed data is written to Amazon S3 and loaded into Amazon Redshift.
  1. Monitor: Airflow tracks task status, retries failed work, and publishes operational metrics.
This design avoids running expensive compute continuously. EMR Serverless and AWS Batch provision resources only when jobs run, while Airflow focuses on coordination, dependencies, retries, and observability.

Example: S3 to Redshift pipeline

Imagine a retail company that receives daily sales files from regional systems. Each file lands in an S3 bucket with a path such as:
s3://company-raw-data/sales/date=2026-11-05/region=ap-south-1/sales.csv
When a new file arrives, an S3 event triggers the pipeline. Airflow then runs a DAG that performs the following steps:
  • Validate the file schema and row counts.
  • Submit a PySpark job to EMR Serverless for cleansing and transformation.
  • Write the curated output to a processed S3 bucket in Parquet format.
  • Run a  COPY  command in Amazon Redshift to load the curated data.
  • Send a success notification through Amazon SNS or Slack.
  • Trigger a downstream reporting DAG once the load is complete.
With Airflow 3, this workflow can be designed around the arrival of data rather than a fixed nightly schedule. That reduces unnecessary processing and helps teams deliver fresher data to analysts.

Sample DAG structure

The following simplified example illustrates the DAG structure using Airflow’s task-based style:
from airflow.decorators import dag, task
from datetime import datetime
@dag(
dag_id="s3_sales_to_redshift",
start_date=datetime(2026, 11, 1),
schedule=None,
catchup=False,
tags=["aws", "s3", "emr-serverless", "redshift"],
)
def s3_sales_to_redshift():
@task
def validate_input(file_key: str):
# Validate schema, file existence, and row count
return {"file_key": file_key, "status": "valid"}
@task
def run_spark_transformation(validation: dict):
# Submit an EMR Serverless Spark job
return {"job_id": "emr-job-123", "output_key": "curated/sales/"}
@task
def load_to_redshift(result: dict):
# Execute COPY command against Amazon Redshift
return {"rows_loaded": 125000}
validation = validate_input("sales/date=2026-11-05/region=ap-south-1/sales.csv")
transformation = run_spark_transformation(validation)
load_to_redshift(transformation)
s3_sales_to_redshift()
In production, the task bodies would use AWS SDKs or Airflow providers to interact with S3, EMR Serverless, Redshift, and notification services. The important point is that each task has a clear responsibility and can be retried independently.

AWS service choices

Need
Recommended AWS service
Why it fits
Raw data storage
Amazon S3
Durable, low-cost, event-enabled object storage
Event routing
Amazon EventBridge
Routes S3 and application events to targets
Queueing and buffering
Amazon SQS
Decouples producers from Airflow consumers
Spark processing
Amazon EMR Serverless
Runs Spark without managing clusters
Container jobs
AWS Batch
Runs batch workloads with managed provisioning
Analytics warehouse
Amazon Redshift
Supports high-performance SQL analytics
Alerts
Amazon SNS
Sends operational notifications
Secrets and credentials
AWS Secrets Manager
Avoids hard-coded credentials

Best practices

  • Use idempotent tasks. A retried task should not create duplicate records or duplicate jobs.
  • Pass small metadata between tasks. Store file paths, job IDs, and status flags in XCom; avoid moving large datasets through Airflow.
  • Separate orchestration from compute. Let Airflow coordinate work, while EMR Serverless or AWS Batch performs heavy processing.
  • Use dead-letter queues. Capture events that cannot be processed so they can be investigated later.
  • Apply least-privilege IAM policies. Give each Airflow environment and task role only the permissions it needs.
  • Monitor end to end. Track DAG success rates, task duration, EMR job cost, Redshift load time, and data freshness.
  • Version your DAGs. Store DAG code in Git and deploy through a controlled CI/CD pipeline.

Migration considerations

Teams moving from Airflow 2 to Airflow 3 should review existing DAGs for deprecated patterns, provider compatibility, and custom plugins. The Task SDK may simplify code, but existing operators and integrations should be tested carefully before production migration.
For Amazon MWAA users, evaluate whether the required Airflow 3 version, provider packages, and execution features are available in your target environment. For teams that need tight control over networking, custom dependencies, or rapid version upgrades, self-managed Airflow on Amazon EKS may be a better fit.

Conclusion

Apache Airflow 3 brings Airflow closer to the event-driven model that modern AWS data platforms already use. By combining Airflow’s orchestration strengths with S3, EventBridge, EMR Serverless, AWS Batch, and Redshift, teams can build pipelines that are more responsive, more cost-efficient, and easier to operate.
The result is not just a scheduled batch process—it is a data platform that reacts to business events in near real time.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article