
Weekend Agent Challenge: Weekly Fitness Summary Agent
Built an Always-On AI Fitness Summary Agent using AWS Lambda, EventBridge Scheduler, DynamoDB, Amazon Bedrock Nova Lite, and Amazon SES. Every Monday at 6 AM, it automatically analyzes the previous week's workout data and emails a personalized fitness report with insights, trends, and next-week recommendations—completely serverless and hands-free.
Weekend Agent Challenge: Weekly Fitness Summary Agent
I work out almost every day. Some days it's a run, other days it's strength training or yoga. But every weekend, I'd sit down and try to figure out: How did my week actually go? Did I hit enough steps? Am I burning fewer calories than last week? What should I focus on next?
It became repetitive.
So I thought—what if I never had to do that again? What if something could automatically analyze my workouts and send me a personalized fitness report every Monday morning before I even woke up?
That's exactly what I built this weekend.
What My Agent Does
I built a Weekly Fitness Summary Agent using AWS serverless services.
Every Monday at 6:00 AM IST, the agent automatically starts running. It retrieves my previous seven days of fitness data from an Amazon DynamoDB table, including:
- Workout type
- Duration
- Steps
- Calories burned
- Personal workout notes
The data is then sent to Amazon Bedrock's Nova Lite model with a prompt that instructs it to behave like a supportive fitness coach.
The AI analyzes the week's activities and generates a personalized report containing:
- Weekly workout statistics
- Activity trends
- Performance insights
- Areas for improvement
- A motivational challenge for the upcoming week
Finally, the report is converted into a clean HTML email and delivered directly to my inbox using Amazon Simple Email Service (SES).
By the time I check my phone on Monday morning, my weekly fitness summary is already waiting for me—without opening an app or clicking a single button.
Architecture
Amazon EventBridge Scheduler (Every Monday – 6 AM IST) │ ▼ AWS Lambda (Python 3.12) │ ┌──────────┼──────────┐ │ │ │ ▼ ▼ ▼ DynamoDB Amazon Amazon Fitness Bedrock SES Logs Nova Lite Email
Everything is fully serverless. The agent wakes up, performs its work in a few seconds, sends the report, and shuts down automatically.
How I Built It
The complete solution was built entirely through the AWS Management Console without using the AWS CLI.
Step 1 – Create DynamoDB Table
I created a table named FitnessLog1.
Partition Key:
user_id Sort Key:
date I manually inserted seven days of realistic workout data, including running, strength training, HIIT, yoga, and rest days.
Step 2 – Enable Amazon Bedrock
Next, I enabled access to the Nova Lite foundation model in Amazon Bedrock.
Once access was approved, the model was ready to use for inference.
Step 3 – Develop the Lambda Function
The Lambda function was written in Python 3.12.
It performs three tasks:
- Query the previous seven days of fitness logs from DynamoDB.
- Send the structured data to Bedrock with a coaching prompt.
- Generate and email the HTML report using Amazon SES.
Step 4 – Configure IAM Permissions
The biggest challenge during development was configuring IAM permissions correctly.
Initially, Lambda returned:
AccessDeniedException
while querying DynamoDB.
The issue was caused by using wildcard values in the DynamoDB resource ARN.
After replacing the wildcard with the exact AWS Account ID and the precise table ARN, the function worked correctly.
Lesson learned: Always use exact ARNs during development.
Step 5 – Increase Lambda Timeout
The default timeout of three seconds wasn't enough because the first Bedrock invocation occasionally required more time.
I increased the timeout to 90 seconds, which resolved the issue.
Step 6 – Schedule Automatic Execution
Finally, I configured Amazon EventBridge Scheduler using the following cron expression:
cron(30 0 ? * MON *)
Timezone:
Asia/Kolkata
Every Monday morning, EventBridge invokes the Lambda function automatically.
No manual trigger is required.
AWS Services Used
Amazon EventBridge Scheduler
Triggers the workflow automatically every Monday at 6:00 AM IST.
AWS Lambda
Acts as the central orchestration layer.
Responsible for:
- Reading DynamoDB
- Invoking Bedrock
- Sending emails via SES
Amazon DynamoDB
Stores daily workout information including:
- user_id
- date
- workout_type
- duration
- calories
- steps
- notes
Configured using On-Demand Capacity Mode.
Amazon Bedrock (Nova Lite)
Generates intelligent weekly fitness summaries using a carefully designed coaching prompt.
Amazon Simple Email Service (SES)
Delivers professional HTML email reports directly to Gmail.
AWS IAM
Provides least-privilege access.
The Lambda execution role is permitted to:
- Query one DynamoDB table
- Invoke one Bedrock model
- Send emails through SES
- Write logs to CloudWatch
Amazon CloudWatch
Automatically captures logs for every execution, making debugging and monitoring straightforward.
What I Learned
This project taught me several valuable lessons.
1. EventBridge Scheduler is Extremely Simple
I initially expected scheduling to require multiple services and complex event rules.
Instead, EventBridge Scheduler only required selecting a cron expression and choosing the Lambda function as the target.
Setup took only a few minutes.
2. Prompt Engineering Matters
My first prompt simply asked Bedrock to summarize workout data.
The output was technically correct but lacked motivation.
After rewriting the prompt to position the model as a supportive fitness coach that should include statistics, trends, encouragement, and a weekly challenge, the quality improved dramatically.
Small prompt changes produced significantly better AI responses.
3. Serverless is Ideal for Personal Agents
The agent executes only four times each month.
There are no servers to maintain, no background processes, and almost no operational overhead.
Yet it consistently delivers useful value every week.
4. IAM Requires Precision
Most of the debugging time was spent resolving IAM permission errors.
Using explicit resource ARNs with the correct AWS Account ID solved the problem immediately.
5. The Output is the Product
Unlike traditional applications, this project has no graphical user interface.
The email itself is the entire user experience.
Designing an always-on agent changed the way I think about software.
Instead of building screens and buttons, I focused entirely on delivering meaningful results automatically.
Repository
GitHub Repository:
The repository includes:
-
lambda_function.py– Main Lambda function
-
seed_data.py– Sample DynamoDB data
-
iam-permissions-policy.json– IAM permissions
-
eventbridge-scheduler-config.json– Scheduler configuration
- Complete README with deployment instructions
Conclusion
This project took less than a day to build, costs virtually nothing to run under the AWS Free Tier, and automatically provides a personalized fitness report every Monday morning.
It demonstrates how combining Amazon EventBridge Scheduler, AWS Lambda, Amazon DynamoDB, Amazon Bedrock, Amazon SES, CloudWatch, and IAM can create a practical always-on AI agent with minimal operational effort.
Sometimes the best applications aren't the ones you interact with—they're the ones that quietly work in the background and deliver value exactly when you need it.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article