How I Built an AI Running Coach Pipeline: From Garmin Webhook to Custom GPT
The Problem I'm a runner who uses Intervals.icu to track training metrics — CTL (Chronic Training Load), ATL (Acute Training Load), TSB (Training Stress Balance), VDOT, HR zones. Great data platfor...

Source: DEV Community
The Problem I'm a runner who uses Intervals.icu to track training metrics — CTL (Chronic Training Load), ATL (Acute Training Load), TSB (Training Stress Balance), VDOT, HR zones. Great data platform, but it doesn't tell you what to do next. ChatGPT can reason about training — but without data, it hallucinates. It'll suggest pace zones for a runner it knows nothing about. I needed a bridge. The Architecture Garmin Watch → Intervals.icu (direct sync, not Strava) → Webhook (ACTIVITY_UPLOADED / CALENDAR_UPDATED) → Next.js API Route → Processing Pipeline → PostgreSQL (Prisma) → Custom GPT (via Actions API) → Plans written back to Intervals.icu calendar Stack: Next.js 16 (App Router), TypeScript strict, Prisma 7, PostgreSQL 16, grammy (Telegram bots), Mistral API + OpenAI fallback, Docker Compose + Caddy. The Webhook Handler When Intervals.icu fires a webhook, the handler needs to: Validate HMAC-SHA256 signature Route by event type (activity uploaded, calendar updated, activity deleted) Retu