AWS Builder Center
Automate Daily Tasks with Amazon EventBridge Scheduler and AWS Lambda

Automate Daily Tasks with Amazon EventBridge Scheduler and AWS Lambda

Learn how to run scheduled background tasks using Amazon EventBridge Scheduler and AWS Lambda. Explore schedule types, time zones, and failure handling through a simple daily study-reminder project.

never give up

Introduction

Many applications need to perform work at a specific time: generate a daily summary, check upcoming deadlines, or send a reminder.
Instead of building your own continuously running scheduling process, you can use Amazon EventBridge Scheduler to invoke an AWS Lambda function. Scheduler supports recurring schedules through rate and cron expressions, as well as one-time invocations. aws.amazon 
In this article, we will design a daily study-reminder workflow. The goal is to understand the architecture and scheduling decisions before building a complete notification application.

1. The Project Idea

Imagine a study-planning application where students save tasks and assignment deadlines.
For our proposed first version, a scheduled job would run every evening and:
  1. Retrieve upcoming study tasks.
  1. Identify unfinished work due soon.
  1. Prepare a short reminder summary.
  1. Pass that summary to a notification component.
The notification delivery and task-storage components are separate parts of the application. Scheduler’s responsibility is to initiate the workflow at the configured time.
The architecture could look like this:
textAmazon EventBridge Scheduler
|
| Scheduled invocation
v
AWS Lambda
|
v
Retrieve study tasks
|
v
Prepare reminder summary
|
v
Notification component
EventBridge Scheduler supports Lambda as a target, allowing the schedule to initiate the function without a user making a request. aws.amazon 

2. Choose the Right Schedule Type

EventBridge Scheduler provides three useful scheduling options. aws.amazon 
Schedule type
Example use
Rate-based
Run a task every hour
Cron-based
Run a task at a particular local time each day
One-time
Run a task once at a chosen date and time
For an interval-based task, a rate expression could be:
textrate(1 hour)
For our daily reminder, a cron-based schedule is a better match because the requirement is a particular time of day rather than simply an elapsed interval. Scheduler supports both expression types. aws.amazon 

3. Set the Time Zone Explicitly

Suppose the reminder should run at 8:00 PM in Sri Lanka.
The proposed configuration would be:
textSchedule expression: cron(0 20 * * ? *)
Time zone: Asia/Colombo
Flexible time window: Off
The expression specifies minute  0  and hour  20 , with the remaining fields configuring a daily schedule.
EventBridge Scheduler can evaluate cron expressions in a specified IANA time zone, so the time zone should be part of the configuration—not an assumption hidden in the application. Schedules have 60-second precision, so this should not be treated as exact-to-the-second execution. aws.amazon 

4. Pass a Small Payload to the Function

The schedule can provide a JSON payload to the target Lambda function. aws.amazon 
For this project, the input might be:
json{
"jobType": "daily-study-reminder",
"reminderWindowHours": 24
}
The payload describes the job. The function would retrieve the current task data when it runs rather than rely on a static list embedded in the schedule.
A simplified Python handler could look like this:
pythondef lambda_handler(event, context):
if event.get("jobType") != "daily-study-reminder":
raise ValueError("Unsupported job type")

window_hours = int(event.get("reminderWindowHours", 24))

return {
"jobType": "daily-study-reminder",
"reminderWindowHours": window_hours,
"message": "Add task lookup and notification logic here."
}
This is a starter structure only. It does not retrieve tasks or send notifications, and returning a message does not deliver it to the user.

5. Configure Permission to Invoke Lambda

A schedule needs an execution role that authorizes EventBridge Scheduler to invoke its target. For this project, that role should grant the required Lambda invocation permission for the intended function. aws.amazon 
Keep these two responsibilities separate:
  • Scheduler’s execution role authorizes invocation of the function.
  • The function’s own application logic performs the reminder workflow.
Creating a schedule is therefore only one part of the setup. The target and its permissions must also be configured correctly. aws.amazon 

6. Distinguish Delivery from Successful Processing

A useful reliability distinction is that invoking a function and completing its business logic are not the same event.
EventBridge Scheduler invokes Lambda asynchronously. Scheduler’s delivery retry settings address failures to invoke the target; they are not a guarantee that the reminder code completed successfully. Function-processing errors need to be handled through Lambda’s asynchronous error-handling configuration and application design. aws.amazon 
For example, these are different situations:
textDelivery failure:
Scheduler cannot successfully invoke the function.

Processing failure:
Lambda accepts the event, but reminder generation fails.
Thinking about both cases helps avoid treating a successfully delivered event as proof of a successfully sent reminder.

7. Add a Dead-Letter Queue for Delivery Failures

EventBridge Scheduler can use an Amazon SQS standard queue as a dead-letter queue, or DLQ, for events it cannot deliver successfully. When a configured retry policy is exhausted, Scheduler can send invocation details to that queue for investigation.aws.amazon+1
A proposed failure path is:
textScheduler cannot deliver the event
|
v
Retry according to policy
|
v
Delivery still unsuccessful
|
v
SQS dead-letter queue
This queue must be created and configured; Scheduler does not automatically provide it. Its permissions also need to allow Scheduler to send messages. aws.amazon 
Remember that this Scheduler DLQ concerns target delivery. It is not a substitute for handling errors inside the Lambda workflow.aws.amazon+1

8. Build the First Version in Small Steps

For a manageable learning project:
  1. Start with the Lambda handler and test its input validation.
  1. Create a one-time schedule to test the invocation path.
  1. Confirm that the scheduled payload reaches the function.
  1. Add task retrieval and reminder-summary logic.
  1. Add notification delivery.
  1. Configure the daily cron schedule and its time zone.
  1. Configure delivery retries and a Scheduler DLQ.
  1. Test function-processing failures separately from delivery failures.
One-time schedules are useful for testing this workflow without waiting for the next daily execution. Scheduler supports both one-time and recurring schedules. aws.amazon 

Conclusion

Amazon EventBridge Scheduler and AWS Lambda provide a practical foundation for time-based automation: Scheduler determines when to initiate work, and Lambda runs the application logic. aws.amazon 
For a study-reminder project, the important design choices go beyond the cron expression. Make the time zone explicit, configure invocation permissions, and distinguish failed delivery from failed processing. Those details turn a simple scheduled task into a workflow you can understand and troubleshoot.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article