Orchestrating Data Pipelines on AWS: Step Functions, MWAA, and Glue Workflows
Pipeline orchestration on AWS means coordinating the order, timing, retries, and failure handling of your ETL steps — and the exam expects you to pick the right coordinator for the job. AWS Step Functions is the serverless state machine for chaining AWS service calls with built-in retries and error branching. Amazon MWAA runs Apache Airflow for teams that need Python-defined DAGs and open-source portability. AWS Glue workflows orchestrate Glue-only pipelines of crawlers, jobs, and triggers with zero extra infrastructure. Amazon EventBridge starts pipelines on schedules or events, AWS Lambda glues small steps together, and Amazon SNS and SQS deliver alerts and decouple stages. DEA-C01 tests whether you can match these services to requirements for performance, availability, scalability, resiliency, and fault tolerance — usually framed as the MOST cost-effective option or the one with the LEAST operational overhead. This lesson covers each orchestrator, when to choose it, and how to build serverless workflows that fail gracefully and alert you when they do.
On this page8 sections
- Why data pipelines need an orchestrator
- AWS Step Functions: serverless state machines for ETL
- Amazon MWAA: managed Apache Airflow
- AWS Glue workflows: orchestration inside Glue
- Triggering pipelines: Amazon EventBridge and AWS Lambda
- Choosing an orchestrator: decision table
- Designing for resiliency, fault tolerance, and scale
- Alerts and notifications: Amazon SNS and Amazon SQS
- Choose between AWS Step Functions, Amazon MWAA, and AWS Glue workflows for a given ETL orchestration requirement
- Trigger pipelines with Amazon EventBridge schedules and event patterns, and connect steps with AWS Lambda
- Design pipelines for resiliency and fault tolerance using retries, error catching, idempotency, and dead-letter queues
- Implement and maintain serverless workflows with Step Functions Standard and Express modes
- Configure Amazon SNS and Amazon SQS to alert on pipeline failures and decouple pipeline stages
Why data pipelines need an orchestrator
An orchestrator exists because real pipelines are multi-step, interdependent, and failure-prone: a raw file lands in Amazon S3, a crawler updates the schema, a transform job runs, a load into Amazon Redshift follows, and a data-quality check gates the whole thing. Without orchestration, you glue these together with cron jobs and hope — no retries, no dependency ordering, no visibility into which step failed.
An orchestration service gives you four things the exam repeatedly probes. Dependency management: step B runs only after step A succeeds, and parallel branches run concurrently to cut wall-clock time. Failure handling: automatic retries with backoff, error-specific catch paths, and fallback logic. State: the orchestrator remembers where a run is, so a resumed or replayed run does not redo completed work. Observability: a visual or logged execution history that shows exactly which step failed and why.
On AWS, the orchestration candidates are AWS Step Functions (serverless state machines), Amazon MWAA (managed Apache Airflow), and AWS Glue workflows (Glue-native orchestration), with Amazon EventBridge supplying schedules and event triggers and AWS Lambda handling small custom steps. Amazon SNS and Amazon SQS handle notifications and decoupling. The exam rarely asks you to define these services — it asks you to pick one under constraints such as least operational overhead, existing Airflow DAGs, or a Glue-only pipeline. Learn the selection logic, not just the feature lists.
AWS Step Functions: serverless state machines for ETL
AWS Step Functions is the default serverless orchestrator for ETL on AWS: you define a state machine in Amazon States Language (JSON), and Step Functions runs it with no infrastructure to manage, per-state retry policies, and direct integrations with over two hundred AWS services — including AWS Glue, Amazon EMR, AWS Lambda, Amazon Athena, and Amazon ECS — so most steps need no wrapper code at all.
Three state-machine features matter most for data engineering. Service integration patterns: the .sync (run-a-job) pattern starts a Glue job or EMR step and waits for it to finish before moving on, which is exactly what sequential ETL needs; the wait-for-callback pattern (task token) pauses the workflow until an external system calls back, useful for human approval or long-running external processes. Error handling: every task state supports Retry (with interval, backoff rate, and max attempts) and Catch (route specific error types to a cleanup or alert branch). Fan-out: a Map state iterates over a collection — in distributed mode it can process very large datasets, such as iterating over every object in an S3 prefix, with massive parallelism.
Choose between the two workflow types deliberately. Standard workflows support long-running executions (up to a year), exactly-once state transitions, and full execution history — the right choice for nightly ETL that runs Glue or EMR jobs. Express workflows are for high-volume, short-lived executions (up to five minutes) with at-least-once semantics and lower cost per execution — the right choice for streaming-adjacent event processing. Picking Express for a two-hour Glue pipeline is a classic exam trap: it will time out.
Amazon MWAA: managed Apache Airflow
Amazon MWAA (Managed Workflows for Apache Airflow) is the choice when the requirement mentions Apache Airflow, existing DAGs, Python-defined workflows, or portability across clouds. AWS manages the Airflow web server, scheduler, and workers — patching, scaling workers within the range you configure, and integrating with IAM and CloudWatch — while you supply DAG files, plugins, and a requirements.txt via an S3 bucket.
Airflow's strength is expressiveness: DAGs are Python code, so dynamic pipeline generation, complex branching, backfills, and a huge ecosystem of community operators (for AWS services, databases, SaaS APIs, and other clouds) come naturally. Teams migrating an on-premises Airflow deployment or orchestrating steps that span non-AWS systems land here. The scheduler-based model also gives you rich calendar semantics — data intervals, catchup runs, and per-task SLAs — that Step Functions does not provide natively.
The trade-offs are the exam's favorite angle. MWAA is not serverless: an environment runs continuously and bills per hour whether or not any DAG is running, so for a handful of simple pipelines it is neither the most cost-effective option nor the least operational overhead — Step Functions wins both. You still own DAG code quality, dependency conflicts in requirements.txt, and Airflow version upgrades. Workers scale within configured bounds rather than instantly to any level. The selection rule to memorize: existing Airflow investment or need for Airflow's ecosystem → MWAA; greenfield AWS-native serverless orchestration → Step Functions.
AWS Glue workflows: orchestration inside Glue
AWS Glue workflows orchestrate pipelines whose every step is a Glue component — crawlers, Glue ETL jobs, and triggers — from within the Glue console, with no additional service to configure. A workflow is a graph of triggers: a schedule or on-demand trigger starts it, event triggers fire the next crawler or job when predecessors complete, and conditional triggers can require all (or any) of several predecessors to succeed. Workflow run properties let jobs in the same run share key-value state.
The typical pattern is exactly the exam's typical scenario: crawl a raw S3 prefix to update the AWS Glue Data Catalog, run an ETL job that converts CSV to Parquet and partitions the output, then crawl the curated prefix so downstream Amazon Athena queries see fresh partitions. If that is the whole pipeline, a Glue workflow is the answer with the least operational overhead — everything stays in one service, one console, one set of IAM permissions.
Know the boundary, because it is where questions pivot to Step Functions. Glue workflows can only orchestrate Glue crawlers and Glue jobs. The moment the pipeline must also invoke a Lambda function, wait for a Redshift load, branch on custom logic, call Amazon EMR, or pause for approval, Glue workflows cannot express it — Step Functions (which has native Glue integrations) takes over as the orchestrator and treats each Glue job as one task state. Also distinguish workflows from Glue job triggers used alone: triggers chain a couple of jobs, while a workflow gives you the full graph view and run-level monitoring.
Triggering pipelines: Amazon EventBridge and AWS Lambda
Amazon EventBridge is how pipelines start. It covers both trigger styles the guide names: time-based schedules — cron or rate expressions that start a Step Functions execution, Glue workflow, or Lambda function at fixed times (EventBridge Scheduler is the newer, more scalable scheduling capability) — and event-driven triggers, where a rule matches an event pattern and routes it to a target. The canonical data-engineering pattern: enable EventBridge notifications on an S3 bucket, write a rule matching Object Created for a specific prefix, and target a Step Functions state machine so the pipeline runs the moment data arrives instead of polling on a schedule.
Event-driven beats schedule-driven when arrival times vary: a schedule either runs before the data lands (wasted run, or worse, processing yesterday's data) or long after (latency). When a question contrasts "process files as soon as they arrive" with a cron-style design, the event-driven answer is almost always correct.
AWS Lambda plays two orchestration roles. As a step, it handles lightweight custom logic inside a workflow — validating a manifest, calling an external API, transforming a small payload — cheaper and faster to start than a Glue job for small work. As a glue trigger, a Lambda invoked by an event can start or signal a larger workflow. But chaining many Lambdas directly into each other as an orchestration mechanism is an anti-pattern: you lose central retry policy, state visibility, and timeout control. If the question describes Lambda-calls-Lambda spaghetti, the fix is to refactor into a Step Functions state machine.
Choosing an orchestrator: decision table
Choose by matching the pipeline's shape and constraints to each service's sweet spot — the table below is the comparison the exam draws on.
| Dimension | AWS Step Functions | Amazon MWAA | AWS Glue workflows |
|---|---|---|---|
| Model | Serverless state machine (Amazon States Language) | Managed Apache Airflow; DAGs in Python | Graph of Glue triggers, crawlers, and jobs |
| Infrastructure | None; pay per state transition (Standard) or per request/duration (Express) | Always-on environment billed hourly, plus worker scaling | None beyond Glue itself |
| Can orchestrate | 200+ AWS services directly (Glue, EMR, Lambda, Athena, ECS, SNS, SQS...) | Anything reachable from Python operators, including non-AWS systems | Glue crawlers and Glue jobs only |
| Error handling | Built-in per-state Retry and Catch with backoff | Airflow task retries, callbacks, SLAs defined in code | Conditional triggers on job success or failure |
| Best fit | Serverless AWS-native ETL; mixed-service pipelines; least operational overhead | Existing Airflow DAGs; complex Python-defined dependencies; cross-platform steps | Pipelines composed entirely of Glue crawlers and jobs |
| Avoid when | Team is standardized on Airflow and needs its ecosystem | A few simple pipelines (idle cost) or a strict serverless requirement | Any non-Glue step is required |
Exam heuristics: least operational overhead or serverless → Step Functions (or a Glue workflow if the pipeline is Glue-only); existing Airflow / open-source portability → MWAA; Glue crawlers and jobs only → Glue workflows; most cost-effective for infrequent runs → never MWAA, because the environment bills while idle.
Designing for resiliency, fault tolerance, and scale
A resilient pipeline assumes every step can fail and makes failure cheap. Build that in four layers.
Retries with exponential backoff. Transient failures — throttling, brief service errors — should be retried automatically, with growing intervals and a capped attempt count. In Step Functions this is the Retry field per state, and you can retry different error types differently (retry a throttle, fail fast on a permissions error). In Airflow it is per-task retries and delay settings.
Idempotency and replayability. Retries and replays are only safe if reprocessing the same input does not duplicate output. Design steps so reruns overwrite or upsert rather than append blindly — write to deterministic S3 keys, use staging-table merge patterns for Redshift loads, and key streaming writes so duplicates collapse. The exam frames this as replayability of ingestion pipelines: you should be able to rerun yesterday's partition without corrupting the dataset.
Decoupling with queues. Placing Amazon SQS between a producer and a processing stage buffers bursts, lets each side scale independently, and adds durability — if the consumer is down, messages wait. Configure a dead-letter queue so messages that repeatedly fail processing are set aside for inspection instead of poisoning the pipeline with endless retries. Lambda event sources and SNS subscriptions support DLQs too.
Failure isolation. Use Catch branches to route errors to cleanup and alert states so one bad file fails its branch, not the whole run; a Map state can continue processing other items with a tolerated failure threshold. Together these deliver the performance, availability, scalability, and fault-tolerance requirements Task 1.3 names.
Alerts and notifications: Amazon SNS and Amazon SQS
Use Amazon SNS to tell humans and systems that something happened, and Amazon SQS to hand work between pipeline stages — they are complementary, not interchangeable. SNS is push-based publish/subscribe: one published message fans out to every subscriber (email, SMS, Lambda, SQS queues, HTTPS endpoints). SQS is pull-based queuing: one consumer processes each message, with durability and retry semantics. The classic combined pattern is fan-out — publish once to an SNS topic subscribed by multiple SQS queues, so several downstream systems each get their own durable copy.
For pipeline alerting, the standard wiring is: the orchestrator emits failure signals, and SNS delivers them. Concretely, a Step Functions Catch branch ends in an SNS publish task with the error detail; or an EventBridge rule matches Step Functions execution-status-change events (FAILED, TIMED_OUT) and targets an SNS topic — which also catches executions that die without reaching a catch state. Glue job state changes and MWAA task callbacks can raise alerts the same way, and CloudWatch alarms on metrics (failed executions, job duration, queue depth) publish to SNS for threshold-based alerting.
Scenario. A retailer lands supplier CSVs in S3 at unpredictable times. Requirements: process each file on arrival, convert to Parquet with a Glue job, load to Redshift, alert the data team on any failure — with the least operational overhead. Answer: S3 EventBridge notifications trigger a Step Functions Standard workflow; it runs the Glue job with the run-a-job pattern, then the Redshift load; every state has retries with backoff; a Catch branch publishes the error to an SNS topic that emails the team. No servers, no polling, no idle cost — and each requirement maps to one native feature.
Tip. DEA-C01 tests orchestration as service selection under constraints: given a pipeline description, pick Step Functions, MWAA, or a Glue workflow — with 'least operational overhead' pointing serverless and 'existing Airflow' pointing to MWAA. Expect scenarios on event-driven triggering with S3 and EventBridge versus schedules, on Standard versus Express workflows, and on fault-tolerance mechanics: retries with backoff, Catch branches, idempotent replays, and SQS dead-letter queues. Alerting questions almost always resolve to publishing failures to an SNS topic.
- AWS Step Functions is the default serverless orchestrator: direct integrations with Glue, EMR, Lambda and more, per-state Retry/Catch, and no infrastructure — Standard for long-running ETL, Express for short high-volume work.
- Amazon MWAA is for Apache Airflow: Python DAGs, the operator ecosystem, and migrations of existing Airflow deployments — but its environment bills while idle, so it is never the answer to a cost or least-overhead question for simple pipelines.
- AWS Glue workflows orchestrate only Glue crawlers and Glue jobs; the moment any non-Glue step appears, Step Functions takes over as the orchestrator.
- Amazon EventBridge supplies both trigger styles: cron/rate schedules and event patterns such as S3 Object Created — event-driven wins whenever data arrival times vary.
- Fault tolerance is layered: retries with exponential backoff for transient errors, idempotent steps so replays are safe, SQS with dead-letter queues to buffer and isolate failures, and Catch branches to contain errors.
- Amazon SNS pushes one message to many subscribers (alerts, fan-out); Amazon SQS queues work for one consumer (decoupling, buffering) — SNS-to-multiple-SQS is the fan-out pattern.
- Chaining Lambda functions into each other for orchestration is an anti-pattern; the fix is a Step Functions state machine that provides central state, retries, and visibility.
Frequently asked questions
When should I choose AWS Step Functions over Amazon MWAA for a new pipeline?
Choose Step Functions for a new, AWS-native pipeline: it is serverless (no idle cost), integrates directly with Glue, EMR, Lambda, and Athena, and has built-in retries and error catching — the least-operational-overhead answer. Choose MWAA only when the team already runs Apache Airflow, needs Airflow's Python DAG expressiveness and operator ecosystem, or must orchestrate steps outside AWS.
What is the difference between Step Functions Standard and Express workflows?
Standard workflows run for up to a year, guarantee exactly-once state transitions, keep full execution history, and bill per state transition — right for long ETL jobs. Express workflows run for at most five minutes, offer at-least-once semantics, and bill by request count and duration — right for high-volume, short event-processing work. A long Glue or EMR pipeline on Express will time out.
Can an AWS Glue workflow invoke a Lambda function or an EMR step?
No. Glue workflows orchestrate only Glue components: crawlers, Glue ETL jobs, and triggers. If a pipeline needs Lambda, EMR, Redshift operations, branching logic, or approvals alongside Glue jobs, orchestrate it with AWS Step Functions, which invokes Glue jobs natively with its run-a-job (.sync) integration.
How do I get alerted when a pipeline fails?
Publish failures to an Amazon SNS topic and subscribe the team (email, SMS, chat webhook via Lambda). Wire it either inside the workflow — a Step Functions Catch branch ending in an SNS publish task — or outside it, with an EventBridge rule matching execution-status-change events like FAILED or TIMED_OUT targeting the topic. CloudWatch alarms on failure metrics can publish to the same topic.
Why put Amazon SQS between pipeline stages instead of calling the next stage directly?
A queue decouples producer and consumer: bursts are buffered instead of overwhelming the consumer, each side scales independently, and messages persist if the consumer is down. A dead-letter queue captures messages that repeatedly fail so they can be inspected and replayed rather than blocking or being lost — core resiliency and fault-tolerance behavior the exam expects.
What makes a data pipeline replayable, and why does it matter?
A pipeline is replayable when rerunning it over the same input produces the same correct result — no duplicates, no corruption. That requires idempotent steps: deterministic output paths that overwrite, merge/upsert loads instead of blind appends, and de-duplication keys for streams. Replayability matters because retries, backfills, and failure recovery all depend on being able to run a step twice safely.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.