save_workout_plan_to_dynamodb
Save a workout plan JSON to DynamoDB, creating all related plan, week, session, and exercise records for the specified user.
Instructions
Save a workout plan to DynamoDB
Takes the JSON output from workout_plan_prompt and saves it to DynamoDB
following the schema defined in DYNAMODB_DATA_MODEL.md.
This creates all necessary entities:
- WorkoutPlan (plan metadata)
- WeekTemplate (one per week)
- WorkoutSession (one per workout day)
- PlannedExercise (one per exercise)
Args:
workout_plan_json: JSON string of workout plan (output from workout_plan_prompt)
user_id: User ID who owns this plan
plan_id: Optional plan ID (auto-generated UUID if not provided)
table_name: DynamoDB table name (default: WorkoutPlans)
region: AWS region (default: us-west-2)
Returns:
Dictionary with success status and statistics about created entities
Example:
result = save_workout_plan_to_dynamodb(
workout_plan_json='{"plan_metadata": {...}, "weeks": [...]}',
user_id="user_123"
)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | us-west-2 | |
| plan_id | No | ||
| user_id | Yes | ||
| table_name | No | WorkoutPlans | |
| workout_plan_json | Yes |