AWS Builder Center
Weekend Agent Challenge: Morning brief agent

Weekend Agent Challenge: Morning brief agent

An autonomous AI agent that sends a morning report on date, weather and news

Engineer @TCS

Introduction

Every morning we wake up and as we check our phone, we switch between multiple applications - calendar to see today's date, weather app to check weather, news app to stay updated with the latest headline. This repititive routine gave me an idea to build this agent.
The Morning Brief Agent is a serverless AWS-powered automation that runs independently every morning without requiring any manual intervention.

Vision & What the Agent Does

Purpose of Agent

The Morning Brief Agent automates the process of gathering daily essentials by collecting weather updates and top news headlines, then delivering a concise morning summary directly to my inbox.

Problem it solves

Instead of spending time switching between multiple applications to gather information, the agent provides:
  • 🌤️ Current weather conditions
  • 📰 Top news headlines
  • 📧 A neatly formatted morning email
This allows me to start the day with all the important updates in one place.

How it is triggered

It requires no manual intervention rather the agent is automatically triggered every day at 7:00 AM IST using Amazon EventBridge Scheduler.

What the Agent Does

When triggered, the agent performs the following steps:
  1. EventBridge invokes an AWS Lambda function.
  1. Lambda fetches:
  • Current weather information from the Open-Meteo API.
  • Top news headlines using the News API.
  1. The information is combined into a readable morning report.
  1. The report is sent to my email using Amazon SNS. The complete workflow executes in just a few seconds.

How I Built It

Development Process

The project was developed using a completely serverless architecture to keep operational costs minimal while eliminating infrastructure management.
The overall development process consisted of:
  1. Creating an AWS Lambda function using Python.
  1. Integrating external Weather and News APIs.
  1. Configuring Amazon SNS for email delivery.
  1. Creating an EventBridge Scheduler to automate execution every morning.
  1. Testing the entire pipeline using Lambda test events and temporary EventBridge schedules.

Challenges encountered and how I overcame them

Initially, when I was testing the Lambda function, I facedd two errors and that helped me to learn the topics in depth.
Error 1:
"errorMessage": "An error occurred (InvalidParameter) when calling the Publish operation: Invalid parameter: Topic Name", "errorType": "InvalidParameterException",
This was an issue with the environment variable, FOR SNS_TOPIC_ARN field instead of pasting the TOPIC_ARN, I pasted the SUBSCRIPTION_ARN.
Error 2:
"errorMessage": "An error occurred (AuthorizationError) when calling the Publish operation: User: arn:aws:sts::169134209247:assumed-role/MorningBriefAgent-role-yqx14wqg/MorningBriefAgent is not authorized to perform: SNS:Publish on resource: arn:aws:sns:eu-north-1:169134209247:MorningBriefAgent because no identity-based policy allows the SNS:Publish action", "errorType": "AuthorizationErrorException",
This was resolved by attaching the appropriate SNS publish permissions to the Lambda execution role in IAM.
Error 3:
The SNS subscription was showing confirmed but it was getting auto deactivated and the ID in subscriptions list was showing DELETED
I wasn't sure if it was because of browser or for some account setting or because of the region. So I deleted the topic and recreate it along with the subscription and it worked. I have no idea what went wrong!

AWS Services Used

Choosing AWS Lambda

AWS Lambda was selected because it only executes code when needed, making it ideal for workloads that run once per day. This approach eliminates the need for maintaining virtual machines or containers.

Using EventBridge Scheduler

Instead of relying on cron jobs running on local machines, Amazon EventBridge Scheduler provides a reliable cloud-native scheduling solution that guarantees execution every time.

Email Notifications with SNS

Amazon SNS offered the simplest way to deliver the generated report directly to my inbox with minimal setup.

Amazon CloudWatch

Amazon CloudWatch was used to monitor and debug the Lambda function. It provided execution logs, error messages, and performance metrics, helping identify issues with API calls, IAM permissions, and SNS email delivery during development. It also allows monitoring of scheduled executions after deployment.

Architecture Overview

The Morning Brief Agent follows a serverless, event-driven architecture. Every day at 7:00 AM IST, Amazon EventBridge Scheduler triggers an AWS Lambda function. The Lambda function retrieves weather data from the Open-Meteo API and the latest headlines from the News API, compiles them into a morning briefing, and publishes the report to an Amazon SNS topic, which delivers it as an email notification. This architecture eliminates the need for dedicated servers while enabling fully automated daily execution.


What I learned from the challenge

All the AWS services used were new to me so it took time to read, understand and execute. Building this project significantly improved my understanding of AWS serverless services and cloud-native application design.
Some of the key learnings include:

AWS Lambda

  • Creating Python-based serverless applications.
  • Managing environment variables.
  • Handling API integrations.
  • Monitoring execution through CloudWatch Logs.

Amazon SNS

  • Creating SNS topics.
  • Managing email subscriptions.
  • Publishing messages programmatically.
  • Troubleshooting subscription issues.

Amazon EventBridge Scheduler

  • Creating recurring schedules.
  • Understanding cron expressions.
  • Configuring Lambda as a scheduled target.

IAM

This project reinforced the importance of the Principle of Least Privilege. Proper IAM roles and permissions are essential for secure communication between AWS services.

Cloud Debugging

One of the biggest takeaways was learning how to debug distributed cloud applications by combining:
  • CloudWatch Logs
  • Lambda execution results
  • IAM policies
  • SNS delivery status

Resources

GitHub repo

The  github repo  is now available with the source code and the setup guide.

YT link

I have also recorded a video to showcase how this project works, you can watch it  here .

Screenshots

Testing the Lambda function

SNS Topic created

Confirming subscription to Email sent using SNS

CloudWatch

Log streams in CloudWatch

Testing EventBridge

Test email sent by SNS

EventBridge recurring

Next trigger date and time

.
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