Quick overview
This scheduled workflow pulls your latest running activities from Strava, classifies them as Zone 2 runs or 5K tests based on pace and distance, and writes the formatted results into specific cells in a Google Sheets training log while tracking processed activity IDs.
How it works
- Runs on a daily schedule.
- Fetches recent activities from the Strava API for the authenticated athlete.
- Processes each activity to calculate pace (min/km) and routes it into “Zone 2” or “Test Run” based on sport type, duration, pace, and distance rules.
- Formats the selected activities into sheet-ready fields (date, pace string, moving time, and distance) and labels them as ZONA 2 or TEST 5KM.
- Reads the target Google Sheets range to find the next available slots and checks an “IDs Registrados” list to avoid reprocessing activities.
- Updates Google Sheets with the activity details in the appropriate cycle columns and appends new Strava activity IDs to the “IDs Registrados” cell.
Setup
- Connect your Strava OAuth2 credentials and ensure the athlete has permission to read activities.
- Connect your Google Sheets OAuth2 credentials and update the spreadsheet URL/ID and sheet (tab) selection used for reading and updating.
- Ensure your Google Sheet matches the expected layout, including columns like “Tirada 1–5”, “Test 5k/5km”, row_number mapping, and an “IDs Registrados” cell (stored on row 2) to track processed Strava IDs.