Starting Pipelines on Data Arrival with S3 Events and EventBridge
This lesson explains how event-driven pipelines start processing as soon as data arrives rather than on a fixed schedule, reducing latency and idle compute.
Learning outcomes
After completing this lesson, you will be able to:
- Choose between S3 Event Notifications and EventBridge.
- Apply common triggering patterns, including batching many small files.
- Design processing that is safe when events are duplicated or out of order.
S3 notifications vs EventBridge
A pipeline can start as soon as a file lands in S3, and S3 can announce the arrival in two ways. S3 Event Notifications are configured on the bucket and send events directly to a Lambda function, an SQS queue or an SNS topic. They filter only by key prefix and suffix, such as incoming/ and .csv, and are simple to set up.
When EventBridge is enabled on the bucket, every S3 event goes to the default event bus, where rules can filter on any field, such as object size or key patterns, and route the event to many kinds of target, including Step Functions state machines, Glue workflows, ECS tasks, API destinations and other accounts. Events can also be archived and replayed, which helps reprocess files after a failure. The following table summarises the differences.
incoming/*.csvThe following diagram compares the two ways of reacting to a new object.

S3 notifications or EventBridge?
Common patterns
Ingestion pipelines are usually triggered and coordinated in one of a few ways. When many small files arrive, starting a job for each one is wasteful, so Glue workflows can start from an EventBridge trigger with batching, which waits for a set number of events or a time window, so a job processes a batch of files in one run.
For multi-step pipelines, EventBridge rules start AWS Step Functions state machines, which coordinate the steps with retries and error handling. When processing must be protected from bursts, an Amazon SQS queue between S3 and the processor absorbs them, lets the processor control its concurrency, retries failed messages, and moves repeated failures to a dead-letter queue for investigation.
Event-driven patterns
Designing for duplicates
Events can be delivered more than once and occasionally out of order, so processing must be safe to repeat: use the object key and version as a deduplication key, or write outputs with deterministic names. Avoid recursive loops where a function writes back to the prefix that triggers it.
The following diagram shows a pipeline that processes each partner file exactly once, and where each kind of failure ends up.

A Lambda that triggers itself
Processing each file exactly once
Partners drop CSV files into s3://landing/incoming/. Each file must be validated and loaded once, even though S3 events can occasionally be delivered more than once and partners sometimes re-upload the same file.
| Concern | Design |
|---|---|
| Trigger | EventBridge rule on Object Created for the prefix, targeting an SQS queue |
| Absorb bursts | The queue feeds a Lambda function with limited concurrency |
| Duplicate events | Record each object key and ETag in DynamoDB with a conditional write; skip if already present |
| Bad files | Move to a quarantine/ prefix and notify the partner |
| Failed processing | Dead-letter queue after three attempts |
The idempotency record makes duplicates harmless: a second event for the same object and ETag is ignored, while a genuinely new version of the file (a new ETag) is processed.
How can a Glue workflow start only after 100 new files have arrived?
Show answer
With an EventBridge trigger configured with a batch size of 100.
Exam Tips
Remember for the exam
- To start a Step Functions pipeline when a file lands, route S3 events through EventBridge to Step Functions.
- To start a Glue workflow after 100 files arrive, use an EventBridge trigger with a batch size.
- To buffer bursts of S3 events and retry them, use SQS with a dead-letter queue.
- To filter on object size or reach many kinds of target, use EventBridge rather than plain S3 notifications.
- Because events may be repeated, make processing idempotent.