Study guide

4.3 Serverless Orchestration with AWS Step Functions

AWS Certified Data Engineer - Associate DEA-C01

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Streaming Data Ingestion

1.1 Kinesis Data Streams vs. Firehose Architecture & Partitioning 1.2 Amazon MSK (Managed Streaming for Apache Kafka) & Serverless Patterns 1.3 Event-Driven Streaming Ingestion with DynamoDB Streams & Lambda 1.4 Streaming Distribution, Replay & Processing State

2 Chapter 2: Batch Data Ingestion & Migration

2.1 AWS DMS (Database Migration Service) & Change Data Capture (CDC) 2.2 S3 Batch Operations & High-Throughput Bulk Data Ingestion 2.3 Hybrid Data Transfer with Snow Family & AWS DataSync 2.4 Application, API & Managed File Ingestion

3 Chapter 3: ETL Transformation with AWS Glue

3.1 AWS Glue Jobs, DynamicFrames & PySpark Transformations 3.2 Glue Crawlers, Data Catalog & Schema Evolution 3.3 Data Preparation & Quality Rules with AWS Glue DataBrew & Data Quality 3.4 Incremental Processing with AWS Glue Job Bookmarks & Partition Processing 3.5 Technical and Business Catalogs, Connections & Lineage

4 Chapter 4: Big Data Processing & Workflow Orchestration

4.1 Amazon EMR Cluster Architecture, Spark & Hadoop Ecosystem 4.2 EMR Serverless & Instance Selection (On-Demand vs. Spot Optimization) 4.3 Serverless Orchestration with AWS Step Functions 4.4 Airflow Pipeline Orchestration with Amazon MWAA 4.5 Containers, Lambda & Distributed Processing Performance 4.6 Data Engineering Code, IaC & CI/CD

5 Chapter 5: Object Storage & Data Lake Architecture

5.1 Amazon S3 Storage Classes, Lifecycle Policies & Cost Optimization 5.2 S3 Data Lake Partitioning, Bucketing & Layout Strategies 5.3 Efficient Columnar Formats: Parquet, ORC, and Avro Schema Design 5.4 S3 Performance Optimization, Multipart Uploads & Transfer Acceleration 5.5 Apache Iceberg, S3 Tables & Open Table Operations

6 Chapter 6: Data Warehousing with Amazon Redshift

6.1 Amazon Redshift Architecture, RA3 Nodes & Managed Storage 6.2 Redshift Data Modeling: Distribution Styles (KEY, EVEN, ALL) & Sort Keys 6.3 Loading & Unloading Data with COPY/UNLOAD & Redshift Spectrum

7 Chapter 7: NoSQL, Relational & Specialty Data Stores

7.1 Amazon DynamoDB Partition Keys, Global Secondary Indexes & Data Modeling 7.2 Amazon RDS & Aurora Operations, Read Replicas & Multi-AZ 7.3 Graph & Analytical Querying with Amazon Neptune, OpenSearch & Athena 7.4 Vector Stores, Indexes & LLM Data Processing

8 Chapter 8: Pipeline Operations, Monitoring & Observability

8.1 Monitoring Pipeline Health with Amazon CloudWatch Metrics & Logs 8.2 Event-Driven Alerting & Automation with EventBridge & CloudWatch Alarms 8.3 Centralized Audit Logging with AWS CloudTrail

9 Chapter 9: Troubleshooting, Data Quality & Performance Tuning

9.1 Diagnosing & Resolving AWS Glue, EMR & Lambda Execution Failures 9.2 Redshift & Athena Query Performance Tuning & Memory Management 9.3 Implementing Data Quality Frameworks & Automated Validation Checks 9.4 Visualization, Notebooks, SQL Analytics, Sampling & Skew

10 Chapter 10: High Availability, Backup & Cost Optimization

10.1 Disaster Recovery, Cross-Region Replication & Backup Strategies 10.2 Designing High Availability Architectures Across AWS Data Services 10.3 Cost Optimization & Resource Utilization across Analytics Workloads

11 Chapter 11: Data Security, Encryption & Identity Management

11.1 Fine-Grained Access Control with AWS IAM Policies, Roles & Conditions 11.2 Data Encryption at Rest & in Transit with AWS KMS & S3 Bucket Policies 11.3 Secure Credentials & Secrets Management with AWS Secrets Manager & Parameter Store 11.4 Private Network Connectivity & Isolation with AWS PrivateLink & VPC Endpoints

12 Chapter 12: Data Governance, Privacy & Compliance

12.1 Centralized Data Lake Governance & Access Control with AWS Lake Formation 12.2 Automated Sensitive Data Discovery & PII Protection with Amazon Macie 12.3 Configuration Auditing & Compliance Enforcement with AWS Config 12.4 Data Privacy, Sovereignty, Sharing & Retention Guardrails 12.5 SageMaker Unified Studio Domains, Projects & Catalog Governance

4.3 Serverless Orchestration with AWS Step Functions

Key Takeaways Explain This Topic AI

AWS Step Functions orchestrates complex, multi-stage data pipelines as declarative state machines using Amazon States Language (ASL) JSON schemas.

Standard Workflows provide exactly-once workflow execution unless retries are introduced and can run for up to one year; Express Workflows trade that durable history for high-throughput, short-duration execution with different delivery semantics.

The '.sync' service integration pattern (Optimized Integrations) pauses state machine execution until asynchronous downstream jobs (Glue, EMR, Athena) complete before moving to subsequent steps.

The Distributed Map state mode allows Step Functions to iterate over datasets in S3 concurrently, launching up to 10,000 parallel child executions for massive parallel processing.

Built-in ASL Retry (with exponential backoff and jitter) and Catch constructs provide resilient error handling without requiring custom error-handling wrapper scripts.

Last updated: August 2026

4.3 Serverless Orchestration with AWS Step Functions

In modern cloud architecture, complex data engineering pipelines consist of multiple decoupled services—extracting raw files from S3, running AWS Glue crawlers, executing EMR Spark jobs, querying Athena, and updating Amazon Redshift tables. Managing these dependencies using custom code, cron jobs, or nested Lambda calls leads to fragile, unmaintainable architectures.

AWS Step Functions solves this by providing a serverless visual orchestration service that manages workflow state, handles retries, and executes complex control flow using declarative Amazon States Language (ASL) JSON definitions.

Standard Workflows vs. Express Workflows

AWS Step Functions supports two workflow types tailored for distinct data engineering use cases:

Comparative Architectural Matrix

  • Feature / Metric Standard Workflows Express Workflows
  • Maximum Execution Duration Up to 1 Year Up to 5 Minutes
  • Execution Rate / Throughput Controlled by Regional quotas High-throughput; controlled by Regional quotas

Execution Guarantees Exactly-once workflow execution unless retries are introduced At-least-once for asynchronous Express; at-most-once for synchronous Express

History & Audit Logging Full execution history visual debugging in console (stored 90 days). Executions logged exclusively to Amazon CloudWatch Logs.

Pricing Model Charged per state transition. Charged per execution count, duration, and memory consumption.

Primary Data Engineering Use Case Long-running ETL pipelines, EMR job orchestration, AWS Glue workflows, cross-service coordination. High-volume streaming event ingestion, IoT payload transformation, real-time API state routing.

Service Integration Patterns: Request-Response vs. .sync vs. Callback

Step Functions provides three distinct execution models when integrating with external AWS services:

Request-Response (Default) : Step Functions waits for the integrated API request to return, but it does not poll an asynchronous job started by that response. Optimized synchronous Lambda invocation waits for the function to return; work that the function launches asynchronously still needs a job-run pattern or callback.

Run a Job ( .sync / Optimized Integration) : Step Functions calls an AWS service API (e.g., glue:startJobRun.sync or elasticmapreduce:addJobFlowSteps.sync ) and pauses state machine execution . Step Functions automatically polls the downstream job status and resumes execution only when the job returns SUCCEEDED , or triggers error handling if it returns FAILED or TIMED_OUT .

Wait for Callback with Task Token ( .waitForTaskToken ) : Pauses the state machine and generates a unique token. The workflow remains paused until an external process calls SendTaskSuccess or SendTaskFailure with the token (ideal for human approval steps or third-party webhooks).

Core ASL State Types for Data Engineering

Amazon States Language (ASL) defines workflow structures using specific state types:

Task : Executes a unit of work (invoking a Lambda function, running a Glue job, starting an EMR step).

Choice : Evaluates JSONPath or JSONata logic predicates to perform conditional branching.

Parallel : Executes static, independent execution branches concurrently.

Map : Iterates over an array of items, executing identical processing steps across array elements.

Inline Map : Runs within the parent workflow history, supports up to 40 concurrent iterations , and is constrained by the 256 KiB state input/output payload limit and the Standard Workflow event-history limit.

Distributed Map : High-scale processing mode that reads manifest files or S3 prefixes directly, spawning up to 10,000 concurrent child workflow executions to process millions of S3 objects simultaneously.

Pass : Passes input to output or injects static JSON data for testing.

Wait : Delays workflow execution for a relative time or until an absolute timestamp.

Fail / Succeed : Terminates state machine execution with explicit error or success status.

Input and Output Payload Transformation Lifecycle

Data engineering pipelines frequently pass JSON state payloads between states. Without transformation, intermediate states risk cluttering or exceeding Step Functions' 256 KB execution payload limit . Step Functions manages data filtering across 5 distinct JSONPath fields:

InputPath : Selects a specific subset of the incoming JSON state input to send to the task execution.

Parameters : Constructs a custom JSON payload passed to the service integration, using JSONPath expressions ( .$ ) to sample dynamic values from the input.

ResultSelector : Filters the raw response returned by the AWS service integration before merging it into the workflow state.

ResultPath : Specifies where in the original workflow state payload to insert the task result. Setting "ResultPath": "$.GlueResult" appends the result without overwriting existing state input data. Setting "ResultPath": null discards task output entirely, passing the original input unaltered.

OutputPath : Filters the final combined JSON state before passing it to the subsequent state.

High-Scale Parallel Processing with Distributed Map States

For large-scale data engineering workflows, processing millions of files stored in Amazon S3 requires dynamic scaling beyond standard Lambda concurrency. Step Functions Distributed Map handles high-throughput batch processing natively:

Direct S3 Inventory & Manifest Readers : Distributed Map configures an ItemReader that directly scans an Amazon S3 bucket prefix or reads an S3 inventory CSV/JSON manifest file, bypassing the need to pre-fetch object lists with a Lambda function.

Concurrent Child Execution Scaling : Spawns up to 10,000 parallel child workflow executions . Each child execution can run as a Standard Workflow (for long steps) or an Express Workflow (for rapid, low-cost processing).

Batching Configurations ( ItemBatcher ) : Groups multiple S3 objects into single worker invocations using MaxItemsPerBatch (e.g., 500 files per worker) or MaxInputBytesPerBatch to optimize worker throughput and reduce overhead.

ResultWriter to Amazon S3 : Exports execution results, child status logs, and failure details directly into a target S3 bucket, preventing payload threshold exhaustion when consolidating results across millions of child items.

Robust Error Handling: Retry & Catch Constructs

Step Functions provides native error handling at the individual state level, avoiding pipeline crashes caused by transient network glitches or temporary AWS service limits. {

  • "Retry": [
  • {
  • "ErrorEquals": ["Glue.ConcurrentRunsExceededException", "States.TaskFailed"],
  • "IntervalSeconds": 15,
  • "MaxAttempts": 3,
  • "BackoffRate": 2.0
  • }
  • ],
  • "Catch": [
  • {
  • "ErrorEquals": ["States.ALL"],
  • "Next": "HandlePipelineFailure"
  • }
  • ]
  • }
  • Key Retry Parameters for Data Engineers

ErrorEquals : Array of specific error codes (e.g., EMR.ThrottlingException , Glue.ConcurrentRunsExceededException ) or wildcards ( States.TaskFailed , States.ALL ).

IntervalSeconds : Initial delay in seconds before performing the first retry attempt.

BackoffRate : Multiplier applied to the retry interval on each subsequent failure (e.g., 2.0 doubles wait time: 15s, 30s, 60s).

MaxAttempts : Maximum number of retry attempts before giving up and transitioning to a Catch block or failing the state.

Production Orchestration Scenarios & Architecture Patterns

Data engineers frequently encounter specific architectural patterns on the AWS Data Engineer (DEA-C01) exam:

1. AWS Glue ETL + Amazon Redshift Data API Pipeline

When orchestrating data warehouse updates, Step Functions can invoke glue:startJobRun.sync . After Glue succeeds, use the Redshift Data API AWS SDK integration to call asynchronous ExecuteStatement , preserve a stable ClientToken across retries, and poll DescribeStatement (or route a completion event) before continuing. Redshift Data API does not expose an executeStatement.sync resource.

2. EMR Serverless Job Submission with Step Functions

For EMR Serverless workloads, Step Functions can submit a job with emr-serverless:startJobRun.sync ; the .sync integration waits for the job to finish. Waiting is not automatic retry behavior. Configure ASL Retry and Catch policies for service errors and, when appropriate, an EMR Serverless job retry policy for failed job attempts.

3. Cross-Account Data Pipeline Orchestration

To orchestrate workflows across separate AWS accounts (e.g., Ingestion Account to Analytics Account), Step Functions tasks assume an IAM role in the target account ( sts:AssumeRole ) or publish execution events to a centralized Amazon EventBridge event bus that triggers a secondary state machine in the target account.

Declarative ASL State Machine Definition

The following ASL JSON document orchestrates an AWS Glue ETL job using .sync , catches errors, and conditionally triggers an Amazon SNS notification: {

  • "Comment": "Production Data Engineering Pipeline Orchestration",
  • "StartAt": "TriggerGlueETLJob",
  • "States": {
  • "TriggerGlueETLJob": {
  • "Type": "Task",
  • "Resource": "arn:aws:states:::glue:startJobRun.sync",
  • "Parameters": {
  • "JobName": "DailySalesAggregationJob",
  • "Arguments": {
  • "--ExecutionDate.$": "$.execution_date"
  • }
  • },
  • "Retry": [
  • {
  • "ErrorEquals": ["Glue.ConcurrentRunsExceededException"],
  • "IntervalSeconds": 30,
  • "MaxAttempts": 3,
  • "BackoffRate": 2.0
  • }
  • ],
  • "Catch": [
  • {
  • "ErrorEquals": ["States.ALL"],
  • "Next": "HandlePipelineFailure"
  • }
  • ],
  • "Next": "VerifyJobStatus"
  • },
  • "VerifyJobStatus": {
  • "Type": "Choice",
  • "Choices": [
  • {
  • "Variable": "$.JobRun.JobRunState",
  • "StringEquals": "SUCCEEDED",
  • "Next": "PipelineSuccess"
  • }
  • ],
  • "Default": "HandlePipelineFailure"
  • },
  • "HandlePipelineFailure": {
  • "Type": "Task",
  • "Resource": "arn:aws:states:::sns:publish",
  • "Parameters": {
  • "TopicArn": "arn:aws:sns:us-east-1:123456789012:PipelineAlerts",
  • "Subject": "ETL Pipeline Failure Alert",
  • "Message.$": "$.Error"
  • },
  • "Next": "PipelineFailed"
  • },
  • "PipelineFailed": {
  • "Type": "Fail",
  • "Error": "ETLJobFailed",
  • "Cause": "Glue ETL job execution failed or timed out."
  • },
  • "PipelineSuccess": {
  • "Type": "Succeed"
  • }
  • }
  • }

Loading diagram... AWS Step Functions ETL Pipeline Orchestration