Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · DEA-C01

Automating data processing

DEA-C01 · Lesson 14 of 23 · 1:58:48

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the DEA-C01 exam (AWS Certified Data Engineer – Associate). In this lesson: troubleshooting Step Functions executions and Amazon MWAA with its Airflow logs, redriving failed Standard executions, Boto3 paginators, waiters, and retries, data APIs with deployments, stages, and throttling, processing with EMR steps, Redshift stored procedures, Glue jobs, and Lambda functions, and EventBridge rules and EventBridge Scheduler. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Rerun from the start

Every night at AnyCompany Games, a Step Functions workflow fails halfway, and someone runs everything again from the start. An Airflow DAG never shows up in Amazon MWAA, and a script loads only the first thousand files of a bucket. This lesson covers troubleshooting workflows, SDKs and data APIs, service features, and events and schedules.

Troubleshooting workflows

Step Functions and Amazon MWAA both orchestrate pipelines, and to troubleshoot a failed run, you start with the history of that run. For a Standard workflow, the execution history lists every event, with the failed state, its input, and the error, while an Express workflow keeps a history only if it sends logs to CloudWatch Logs. Once the cause is fixed, redrive a failed Standard execution within fourteen days: it continues from the failed step with the same input, and the steps that succeeded do not run again. Amazon MWAA takes its DAGs and a requirements file from an S3 bucket, and sends Airflow logs to CloudWatch Logs, in one log group per type: DAG processing, scheduler, task, web server, and worker. So a DAG that never appears points to the DAG processing logs, while a task that fails points to the task logs, at the INFO level or above.

SDKs and data APIs

Code calls AWS services through the SDKs, like Boto3 for Python, with credentials from the role of the function or the instance, never with keys in the code. Many calls return results one page at a time, like up to one thousand objects for an S3 listing, so a paginator walks through every page for you. Waiters poll a resource until it reaches a state, like a cluster that is running, and Boto3 retries throttled calls with backoff, up to three attempts in all by default, in standard mode. Data APIs let other teams consume data over HTTPS, like the Redshift Data API for SQL without drivers, or an API Gateway API in front of a Lambda function. Maintaining an API means versions and stages: each deployment is a snapshot of the API, a stage points to one deployment, and throttling and usage plans protect the backend.

Service features

Each processing service has its own way to run work: on Amazon EMR, you add steps, like a Spark application, to a cluster, and recent releases can run several steps in parallel. Amazon Redshift runs stored procedures, written in PL/pgSQL, with loops, conditions, and DDL and DML statements, and query editor v2 can schedule queries to run at set times. AWS Glue runs three kinds of jobs: Spark for large ETL, Spark Streaming for streams, and Python shell for small Python scripts. And Lambda automates the small steps between them: an S3 event starts a function when a file lands, and the function can start a Glue job or a Step Functions workflow. For asynchronous events, Lambda retries a failed invocation twice by default, and a destination or a dead-letter queue keeps the events that still fail.

Events and schedules

Amazon EventBridge connects events to targets: a rule with an event pattern matches events, like an object created in a bucket or a Glue job that failed, and sends them on. A single rule can send an event to several targets, which then run in parallel, like a Lambda function and an SNS topic. For time-based work, EventBridge Scheduler runs cron or rate schedules, or a single run at a set time, in the time zone that you choose. Scheduled rules still exist in EventBridge, but they are a legacy feature, and AWS recommends EventBridge Scheduler for new schedules. Scheduler adds flexible time windows and retries, and it can call thousands of AWS API operations directly, like starting a Glue job, without a function in between.

Automation at AnyCompany Games

Here is the automation at AnyCompany Games: an EventBridge rule matches each new file of match events, and starts a Step Functions workflow. The workflow runs Glue jobs and an EMR step, then calls a Redshift stored procedure through the Data API. EventBridge Scheduler starts the weekly cleanup job at two in the morning, in the team's time zone, with retries. And when something breaks, the team checks the execution history and the Airflow logs first, then redrives the failed run once it is fixed.

Recap

Let's recap. To troubleshoot, check the execution history of Step Functions or the Airflow logs of Amazon MWAA, and redrive failed Standard executions. In code, Boto3 paginators walk through every page, waiters poll for states, and retries handle throttling. Data APIs serve data over HTTPS, and deployments, stages, and throttling keep them maintainable. EMR steps, Redshift stored procedures, Glue jobs, and Lambda functions each run part of the processing. And EventBridge rules react to events, while EventBridge Scheduler runs work on a schedule.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. A Python script lists a bucket with Boto3 and loads every new file into Redshift, but it never processes more than 1,000 files, although the bucket holds 50,000. What should the data engineer fix?

    • More memory for the host that runs the script
    • The adaptive retry mode in the Boto3 config
    • A paginator that reads every page of results
    • A waiter before each call that lists objects
    Show the answer

    A paginator that reads every page of results

    An S3 listing returns up to 1,000 objects per call, and a paginator requests the following pages until the end. “More memory for the host that runs the script” would not change how many objects each call returns. “The adaptive retry mode in the Boto3 config” is for throttled calls, which would fail rather than stop at 1,000. And “A waiter before each call that lists objects” would wait for a resource state, without fetching the next page.

  2. Every night, a Standard workflow in Step Functions runs five Glue jobs. Last night, job four failed on a permissions error, now fixed. The team wants to finish the run without running jobs one to three again. What should the data engineer do?

    • Redrive the failed execution of the workflow
    • Start a new execution with the same input
    • Switch the state machine to an Express workflow
    • Add a Retry field with ten attempts to each state
    Show the answer

    Redrive the failed execution of the workflow

    Redrive continues the failed execution from the unsuccessful step, with the same input, and does not run the steps that succeeded again. “Start a new execution with the same input” would run jobs one to three again. “Switch the state machine to an Express workflow” would change the type of the workflow, and Express executions cannot be redriven. And “Add a Retry field with ten attempts to each state” would retry future failures, but last night's run would still start over.

  3. Each time a Glue job fails, the on-call engineer must get an email within a minute, without polling and without custom code that checks job status. What should the data engineer configure?

    • A schedule that runs a Lambda check every hour
    • A Boto3 script with a waiter on each job run
    • A job bookmark on each of the nightly jobs
    • An EventBridge rule on failed jobs, to SNS
    Show the answer

    An EventBridge rule on failed jobs, to SNS

    Glue sends job state changes to EventBridge, and a rule with a pattern for failed jobs sends them to an SNS topic, which emails the engineer. “A schedule that runs a Lambda check every hour” would check only once an hour, with code to write. “A Boto3 script with a waiter on each job run” would poll each job run, which the team wants to avoid. And “A job bookmark on each of the nightly jobs” is for tracking processed data, not failures.