Skip to main content

Fitness Refresh

@svendowideit/fitness-refreshv2026.10.12.1· 11d agoWORKFLOWS
01README

Refresh every Garmin and Zwift data source in one ordered run, so a downstream consumer always reads a complete, current local day.

WHAT IT DOES

Garmin and Zwift each publish on their own schedules, so a consumer that runs in between sees a half-populated day. This extension is the single ordered entry point that runs them all, in the one order that matters: it derives the Garmin device capability map first, because a health sync run without it silently drops the device-gated metrics — sleep, stress, body battery and the sleep score — then syncs wellness and weight/body composition for the last few local days through today, the day's activities, your Zwift ride history, and the ranked event calendar. Running hourly, a weigh-in recorded during the day reaches the diary the same day. Every step is idempotent, so it is safe to re-run. It is read-only with respect to your diary: it only writes data, and anything you run afterwards reads it.

INSTALL

swamp extension pull @svendowideit/fitness-refresh

DEPENDENCIES

@svendowideit/garmin and @svendowideit/zwift, pulled automatically by the single install above. This extension ships only a workflow that invokes their sync workflows; it declares no models of its own. Garmin credentials live in the garmin-secrets vault and Zwift credentials in zwift-secrets, exactly as those extensions document.

RUN

# Sync everything for the local day, in order. Idempotent — run it as
# often as you like; each step re-establishes its own auth session.
swamp workflow run @svendowideit/fitness-refresh

# A different timezone than the author's, so "today" and the ride/event
# bucketing match where you are.
swamp workflow run @svendowideit/fitness-refresh \
  --input timezone=Europe/London

# Widen the wellness window when you have been away (capped at 14 days).
swamp workflow run @svendowideit/fitness-refresh --input healthDays=7

CONFIGURE

timezone (default Australia/Brisbane) defines "today" for the syncs and buckets ride and event times; set your own. healthDays (default 3) is the local wellness window through today (capped at 14). bodyDays (default 3) is the local weight/body-composition window through today (capped at 14). forceRefresh (default true) makes the Garmin syncs re-read Garmin rather than serve the day's first cached list — without it a repeat run misses a ride finished since the morning. The remaining inputs are instance names — sessionName, devicesName, healthName, activitiesName, bodyName, riderName, eventsName, recommenderName — for when you renamed a model. Schedule a custom time with the trigger: it fires hourly at :30 while swamp serve runs.

UPGRADE

fitness-refresh installs nothing on the host, so there is no in-place rebuild to run. Upgrade by updating the extension; the new workflow simply takes effect on the next scheduled pass, and because every step is idempotent it re-runs each source cleanly.

swamp extension update @svendowideit/fitness-refresh

WHAT IT INSTALLS

Nothing on the host. It writes swamp data through the Garmin and Zwift models it calls. One cron trigger is registered while swamp serve runs: 30 * * * * (hourly at :30, host-local) — timed a quarter-hour before the diary's own :45 refresh so a consumer always reads a freshly synced day. Remove or disable the trigger if you prefer to invoke it by hand.

02Workflows1
@svendowideit/fitness-refresh089a21d1-7421-4559-9052-7d1f3a7dc243

Refresh every Garmin and Zwift data source in one run, so a downstream consumer (the diary) reads a complete, current local day. Garmin and Zwift each expose their data through several workflows on their own schedules, and a consumer that runs between them sees a half-populated day. This workflow is the single ordered entry point that runs them all for the local calendar day: 1. garmin-devices-sync derive the device capability map — without it the health sync sil

refreshRun every collector in dependency order for the local day.
1.garmin-devices— Derive the device capability map first — the health sync gates sleep, stress and body battery on it, so running it late would drop those metrics (including the sleep score).
2.garmin-health— Fetch wellness for the last few local days through today. The timezone makes "today" the local day, so a morning run picks up last night's sleep and today's steps.
3.garmin-activities— Sync the activity history with the window ending on today-local, so the current day's activities are included.
4.garmin-body— Sync weight and body composition for the last few local days. Runs on every hourly pass so a weigh-in recorded during the day reaches the diary the same day, rather than waiting for the next morning.
5.zwift-sync— Refresh Zwift ride history and the upcoming event calendar, bucketed in the local timezone.
6.zwift-recommend— Rank the freshly synced calendar against the rider profile, so the diary's suggested-rides section is current.
03Previous Versions2
2026.10.09.1
2026.10.04.1
04Stats
A
93 / 100
Downloads
12
Archive size
6.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License1/2partial

    no SPDX license declared

  • Verified public repository2/2earned
05Platforms