Scheduled Invocations with EventBridge
Learn to run Lambda functions on a recurring schedule using Amazon EventBridge rules with cron and rate expressions.
Scheduled Invocations with EventBridge is a free Serverless AWS Lambda Development lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Serverless AWS Lambda Development learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Scheduled Functions?
Many tasks need to run on a timer: nightly reports, cache warming, cleanup jobs. EventBridge Scheduler triggers Lambda without any always-on server.
Rate vs Cron
EventBridge supports two schedule syntaxes:
- rate() for simple intervals.
- cron() for precise calendar times.
A Rate Expression
A rate expression runs every fixed interval. For example rate(5 minutes) fires every five minutes.
rate(1 hour)
rate(5 minutes)
rate(7 days)A Cron Expression
Cron gives calendar precision. AWS cron has six fields: minute, hour, day-of-month, month, day-of-week, year.
cron(0 8 * * ? *)
cron(0 0 1 * ? *)
cron(0/15 * * * ? *)The Scheduled Event Payload
The Lambda receives a JSON event describing the trigger. Scheduled events have a fixed shape with source aws.events.
{
"source": "aws.events",
"detail-type": "Scheduled Event",
"time": "2026-05-29T08:00:00Z"
}Handling a Scheduled Event
Your handler ignores most of the payload and simply does its periodic work.
def handler(event, context):
print('Running scheduled job at', event.get('time'))
# do cleanup, send report, etc.
return {'status': 'done'}Creating the Rule
You attach a schedule to a Lambda as an EventBridge rule with the Lambda as its target. The CLI shows the core idea.
aws events put-rule \
--name nightly-cleanup \
--schedule-expression 'cron(0 2 * * ? *)'Granting Permission
EventBridge must have permission to invoke your function. Add a resource policy allowing the events.amazonaws.com principal.
aws lambda add-permission \
--function-name cleanup \
--statement-id eb-invoke \
--action lambda:InvokeFunction \
--principal events.amazonaws.comTime Zones
Classic EventBridge rules run in UTC. The newer EventBridge Scheduler supports named time zones, which avoids manual offset math.
Idempotency Matters
A schedule may occasionally fire twice. Make scheduled jobs idempotent so a repeat run causes no harm.
Disabling a Schedule
You can disable a rule without deleting it, which is useful for pausing a job during maintenance windows.
aws events disable-rule --name nightly-cleanupQuick Check
Test your scheduling knowledge.
Recap
You can now schedule Lambda functions with EventBridge using rate and cron expressions, grant invoke permission, mind time zones, and keep jobs idempotent.
Frequently asked questions
Is the “Scheduled Invocations with EventBridge” lesson free?
Yes — the full text of “Scheduled Invocations with EventBridge” is free to read here on the web, and the Serverless AWS Lambda Development course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Serverless AWS Lambda Development course, upgrade to CoddyKit PRO.
What will I learn in “Scheduled Invocations with EventBridge”?
Learn to run Lambda functions on a recurring schedule using Amazon EventBridge rules with cron and rate expressions. You practise Serverless AWS Lambda Development with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Serverless AWS Lambda Development?
No prior experience is required. Serverless AWS Lambda Development on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Scheduled Invocations with EventBridge” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Serverless AWS Lambda Development lesson?
Yes. Every Serverless AWS Lambda Development lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Event-Driven Architecture Basics
- Invoking Lambda with API Gateway
- S3 and SQS Event Triggers
- Scheduled Invocations with EventBridge