Scheduling and Triggering Pipelines with Amazon EventBridge
This lesson explains how Amazon EventBridge starts pipelines at a set time with EventBridge Scheduler or when something happens with event rules that react to changes in AWS services and applications.
Learning outcomes
After completing this lesson, you will be able to:
- Create schedules with EventBridge Scheduler.
- Write event rules that react to service events.
- Choose between scheduled and event-driven starts.
EventBridge Scheduler
Amazon EventBridge Scheduler starts targets at defined times. Schedules can run once or recur, defined with cron expressions, such as 02:00 every weekday, or rate expressions, such as every 15 minutes. Each schedule has a time zone, and daylight saving time is handled automatically, so a pipeline scheduled for 06:00 local time runs at 06:00 all year. Flexible time windows spread invocations over a period when exact timing does not matter.
Failed invocations are retried according to a retry policy and can be sent to a dead-letter queue. Universal targets let a schedule call hundreds of AWS API actions directly, such as starting a Glue job or a Step Functions execution, so no Lambda function is needed just to start a pipeline.
EventBridge Scheduler
Event rules
Many AWS services report what happens to them as events, and EventBridge rules turn those events into pipeline actions. Amazon S3 reports objects created in a landing prefix, which can start ingestion as soon as a file arrives. AWS Glue reports job state changes, crawler completion and Data Quality results, which can start the next step or raise an alert when a job fails. Amazon EMR and Step Functions report step and execution status, and the Redshift Data API reports when a statement finishes. Applications can also put their own events on a custom event bus. The following table summarises the common sources.
| Event source | Example events |
|---|---|
| Amazon S3 | Object created in a landing prefix |
| AWS Glue | Job state change, crawler completion, Data Quality results |
| Amazon EMR, Step Functions | Step or execution status changes |
| Amazon Redshift | Data API statement completion |
| Custom applications | Events put on a custom event bus |
The following diagram shows the event pattern and alert path that report failed production Glue jobs without changing them.

Event sources
Scheduled or event-driven?
Whether a pipeline should run on a schedule or on events depends on how data arrives and when results are needed. When processing must happen at a fixed business time, such as 02:00 local time, EventBridge Scheduler runs it, with time zone support. When files arrive irregularly and should be processed promptly, an event rule on S3 object creation starts the pipeline for each file. When many small files arrive, processing each one separately is wasteful, so Glue workflow event batching or a schedule groups them into one run. The following table summarises the choice.
| Situation | Trigger |
|---|---|
| Data must be processed at a fixed business time, such as 02:00 local time | EventBridge Scheduler |
| Files arrive irregularly and should be processed promptly | Event rule on S3 object creation |
| Many small files arrive and should be processed together | Event rule with Glue workflow batching, or a schedule |
Schedule or event?
Alerting on a failed Glue job
The data team wants a message whenever any production Glue job fails, without changing the jobs. An EventBridge rule with the following event pattern matches the failures.
{
"source": ["aws.glue"],
"detail-type": ["Glue Job State Change"],
"detail": { "state": ["FAILED", "TIMEOUT"], "jobName": [{ "prefix": "prod-" }] }
}The rule targets an SNS topic connected to chat through Amazon Q Developer in chat applications. Because Glue publishes these events itself, no job code changes, and every new job named prod-... is covered automatically. The jobs themselves are started at 02:00 London time by an EventBridge Scheduler schedule with a time zone, so daylight saving time is handled.
Which service runs a pipeline every night at a set time in a particular time zone?
Show answer
EventBridge Scheduler, which supports time zones and can start a Glue job directly through a universal target.
Exam Tips
Remember for the exam
- For a nightly schedule in a particular time zone, use EventBridge Scheduler.
- To start a pipeline when a file lands, use an EventBridge rule on S3 events.
- EventBridge Scheduler can start a Glue job directly through a universal target.
- To react to Glue job failures, use an EventBridge rule on Glue job state changes.
- Scheduler retries failed invocations and can send them to a dead-letter queue.