Health automations with VitalTrends
Use VitalTrends as the data layer for automated health workflows: a readiness brief every morning, a weekly training review, a weight trend nudge, or a digest for your coach.
This page covers the three ways to automate, setup notes for each platform, seven workflow recipes and downloadable templates.
Three ways to automate
| Approach | Good for | How it reads VitalTrends | Examples |
|---|---|---|---|
| Scheduled AI assistants | A written brief or review with no setup beyond a prompt | Hosted MCP server, https://mcp.vitaltrends.net/mcp, through the assistant's connector | Grok, ChatGPT, Claude |
| No-code platforms | Sending results to Telegram, Slack, email, Notion, a calendar or smart home | MCP client nodes (MCP server) or HTTP steps (REST API) | n8n, Zapier, Make, Home Assistant |
| Plain REST calls | Exact numbers, no AI in the loop, full control | REST API, https://vitaltrends.net/api/v1, with Authorization: Bearer <API key> | Apple Shortcuts, cron scripts, GitHub Actions |
MCP tool names and REST endpoints map one to one. See the MCP tool reference and the REST API reference.
Before you start: safety
- Your API key. Each VitalTrends account has one API key, in Settings → Developer. It needs an active subscription and a synced data source. The key is read-only unless Allow workout write access is on. Every template on this page only reads data, so leave write access off unless another tool needs it. Regenerating or deleting the key stops every AI connection and automation that uses it, so you will need to update each one with the new key.
- OAuth connections are read-only by default. When a platform connects to the MCP server with OAuth, you paste the key on the "Connect VitalTrends" page and the platform only receives a token. The connection stays read-only unless you tick "Allow changes to my Training Log" and the key also has write access.
- Store the key as a secret. Use the platform's credential store, an environment variable or a repository secret. Never paste the key into a prompt, a shared workflow, a shared shortcut or a public repository.
- Send only what the destination needs. Compute the result first and send the short message (for example "Readiness: YELLOW, sleep 5h 40m"), not raw API responses. Each template on this page does this.
- Data leaves VitalTrends. Anything an automation sends to an AI provider, chat app, email service or automation platform is handled under that service's privacy policy. See AI access and your data.
- Rate limit. The API allows 120 requests per minute per API key, shared by every automation and AI connection that uses it. Poll every 30 minutes or less often.
Scheduled AI assistants
Some AI assistants can run a saved prompt on a schedule. Once the VitalTrends connector is added, a scheduled prompt can read your data and send you the answer. Whether a scheduled run can use a custom connector, and on which plans, differs by app and changes often, so follow the client guide:
Any recipe prompt below works as a scheduled prompt. Start with the morning brief prompt and run it once by hand before you schedule it.
n8n
Not yet tested by VitalTrends Based on n8n's documentation and node source code (n8n 2.48), checked 21 November 2026.
Option A: import the REST template
Download n8n-morning-readiness-brief.json. It runs Schedule Trigger → HTTP Request (WHOOP daily) → HTTP Request (Oura readiness) → Code (green/yellow/red) → Telegram. It uses no AI and sends only the three-line message to Telegram.
In n8n, create a Header Auth credential named VitalTrends API key. Set Name to Authorization and Value to Bearer YOUR_VITALTRENDS_API_KEY.
Create a Telegram credential with your bot token from Telegram's BotFather.
Open a new workflow and import the file (the workflow menu's Import from File option, or paste the JSON onto the canvas).
Select your Header Auth credential on both HTTP Request nodes. Select your Telegram credential on Send to Telegram and replace YOUR_TELEGRAM_CHAT_ID.
In Workflow settings, set the timezone to your VitalTrends profile timezone so "today" matches your local day.
Run the workflow once by hand and check the message. Then activate (publish) it. The label depends on your n8n version.
To send to Slack or email instead, replace the Telegram node with n8n's Slack or Send Email node and map {{ $json.message }} into the message text.
Option B: AI Agent with the MCP Client Tool
- Add an AI Agent node with a chat model, then attach an MCP Client Tool to it.
- Set Endpoint to
https://mcp.vitaltrends.net/mcpand Server Transport to HTTP Streamable. If your n8n version only shows an SSE Endpoint field, usehttps://mcp.vitaltrends.net/sse. - Set Authentication to Bearer Auth and create a Bearer credential with your VitalTrends API key. This is the simplest option.
- Set Tools to Include to Selected and pick only the read tools the workflow needs, for example
get_whoop_dailyandget_oura_daily_readiness. - Put a recipe prompt in the agent's prompt and connect a Schedule Trigger before it and a Telegram, Slack or email node after it.
n8n also offers MCP OAuth2 authentication, with Use Dynamic Client Registration on by default. VitalTrends supports dynamic registration for public clients without a client secret. We have not tested whether n8n's registration matches that; if OAuth fails, use Bearer Auth.
Zapier
Not yet tested by VitalTrends Based on Zapier's help center, checked 21 November 2026.
MCP Client by Zapier (beta)
- On Zapier's Apps page, select + Add connection, search for MCP Client and select Add connection.
- Set Server URL to
https://mcp.vitaltrends.net/mcpand Transport to Streamable HTTP. - Choose one of:
- OAuth: Yes. Select Yes, Continue to MCP Client, then paste your API key on the Connect VitalTrends page. The bearer token field is ignored. This gives a read-only token.
- OAuth: No. Enter your VitalTrends API key as the Bearer Token.
- In a Zap, use the Run Read-Only Tool search with a tool such as
get_whoop_daily, then pass a short summary to Slack, Gmail or another app.
A Zapier Community thread reports bearer-token-only connections failing at the "Yes, Continue" step for some servers. If that happens, try OAuth: Yes.
Webhooks by Zapier (REST)
Webhooks by Zapier is available on Zapier's Professional, Team and Enterprise plans.
- Trigger: Schedule by Zapier, every day at your chosen time.
- Action: Webhooks by Zapier → GET. URL
https://vitaltrends.net/api/v1/whoop/daily, withper_pageset to5in the parameter fields (Zapier recommends parameters there rather than in the URL). Add a headerAuthorizationwith the valueBearer YOUR_VITALTRENDS_API_KEY. - Add a Code by Zapier step to pick the row whose
cycle_start_dateis today and build the message. The JavaScript in the n8n template's Code node is a good starting point. - Send only the message to Slack, Gmail or SMS.
Make
Not yet tested by VitalTrends Based on Make's MCP Client app documentation, checked 21 November 2026.
- In a scenario, add MCP Client → Call a tool. Make's MCP Client app is in open beta.
- Create a connection: choose + New MCP Server, set URL to
https://mcp.vitaltrends.net/mcpand paste your VitalTrends API key into API Key / Access token. Make's documentation does not say which header it sends the token in; VitalTrends expectsAuthorization: Bearer <key>. - Set Tool Name to a read tool such as
get_whoop_dailyand Arguments such as{"per_page": 5}. - Add a router or text step to build the message, then send it with Slack, Telegram, Gmail or another module.
Make also supports OAuth for MCP servers and lists https://www.make.com/oauth/cb/mcp as its redirect URI. VitalTrends registers public clients dynamically; we have not confirmed that Make uses dynamic registration. If the MCP Client connection fails, Make's HTTP app (Make a request) can call the REST API with an Authorization: Bearer YOUR_VITALTRENDS_API_KEY header.
Home Assistant
Not yet tested by VitalTrends Based on Home Assistant's documentation, checked 21 November 2026.
MCP client integration. Home Assistant's Model Context Protocol integration supports Streamable HTTP and SSE servers and exposes their tools to conversation agents. For servers that need sign-in, it asks for an OAuth client ID and client secret through Application Credentials. VitalTrends does not issue client secrets (it only supports dynamically registered public clients), and Home Assistant's documentation does not describe a bearer-header option, so we do not recommend this route for now.
Recommended: a RESTful sensor. Home Assistant can read the REST API directly. This example creates a recovery sensor and dims the lights to a warm tone on a red recovery morning.
secrets.yaml:
vitaltrends_api_authorization: "Bearer YOUR_VITALTRENDS_API_KEY"
configuration.yaml:
sensor:
- platform: rest
name: VitalTrends WHOOP recovery
unique_id: vitaltrends_whoop_recovery
resource: https://vitaltrends.net/api/v1/whoop/daily?per_page=5
headers:
Authorization: !secret vitaltrends_api_authorization
Accept: application/json
scan_interval: 1800
value_template: >
{% set today = now().strftime('%Y-%m-%d') %}
{% set rows = value_json.data
| selectattr('cycle_start_date', 'eq', today)
| selectattr('recovery_score', 'ne', none)
| list %}
{{ rows[0].recovery_score if rows else 'unknown' }}
Automation:
automation:
- alias: Warm, dim lights on a red recovery morning
triggers:
- trigger: time
at: "07:30:00"
conditions:
- condition: numeric_state
entity_id: sensor.vitaltrends_whoop_recovery
below: 34
actions:
- action: light.turn_on
target:
entity_id: light.living_room
data:
color_temp_kelvin: 2700
brightness_pct: 40
scan_interval: 1800 polls every 30 minutes. Home Assistant's default of 30 seconds is far more often than this data changes. Replace light.living_room with your own light.
Apple Shortcuts: "How recovered am I?"
Not yet tested by VitalTrends Based on Apple's Shortcuts User Guide, checked 21 November 2026.
Shortcuts has no MCP support, so it calls the REST API with Get Contents of URL. Name the shortcut "How recovered am I" and you can run it by asking Siri, or add it to your Home Screen as a widget.
Open Shortcuts, tap + and name the shortcut How recovered am I.
Add Format Date. Set the date to Current Date, the format to Custom and the custom format to yyyy-MM-dd.
Add URL with https://vitaltrends.net/api/v1/whoop/daily?per_page=5.
Add Get Contents of URL. Tap Show More, keep the method as GET, and under Headers add a header with key Authorization and value Bearer YOUR_VITALTRENDS_API_KEY.
Add Get Dictionary Value to get the value for data in Contents of URL.
Add Repeat with Each item in that Dictionary Value. Inside the repeat, add Get Dictionary Value for cycle_start_date in Repeat Item. Then add If that value is the Formatted Date from step 2, and inside the If, add Set Variable named Today to Repeat Item.
After the repeat, add If Today has any value. Inside it, add Get Dictionary Value for recovery_score in Today, then Speak Text (or Show Result): "Your WHOOP recovery today is [Dictionary Value] percent." In Otherwise, add Speak Text: "No recovery for today has synced yet."
Run it once from the editor. Shortcuts may ask permission to connect to vitaltrends.net. Allow it.
For Oura, use https://vitaltrends.net/api/v1/oura/daily-readiness?start=[Formatted Date]&end=[Formatted Date] instead, then read score from the first item in data.
Scripts, cron and GitHub Actions
The Python templates below need Python 3.9 or newer and requests (pip install requests). They read the key from the VITALTRENDS_API_KEY environment variable, only send GET requests, never print the key, and refuse to send it to any host other than the VitalTrends API.
| File | What it does |
|---|---|
| morning-brief.py | Today's WHOOP recovery, with Oura readiness as a fallback, as a three-line green/yellow/red brief. Posts to a Slack incoming webhook when SLACK_WEBHOOK_URL is set. Handles days with no data yet. |
| weekly-training-review.py | Markdown review of the last 7 days: volume by muscle group, sessions and exercises, heaviest set per exercise. --prs also checks exercise history for new heaviest loads. -o review.md writes a file. |
| withings-weight-trend.py | Daily average of Withings weigh-ins, 7-day moving average, change over the last two weeks, and a nudge when the trend reverses. Posts the nudge to Slack when SLACK_WEBHOOK_URL is set. --unit lb shows pounds. |
| n8n-morning-readiness-brief.json | Importable n8n workflow for the morning brief (see n8n). |
Set VITALTRENDS_TIMEZONE (for example Europe/Lisbon) to your VitalTrends profile timezone if the machine runs in a different one. Use --dry-run on the brief and weight scripts to print without posting.
cron. Keep the key in a file only you can read (chmod 600 ~/.vitaltrends.env) containing export VITALTRENDS_API_KEY=..., then:
30 7 * * * . "$HOME/.vitaltrends.env" && /usr/bin/python3 "$HOME/vitaltrends/morning-brief.py"
GitHub Actions. Use a private repository, because job logs contain the brief. Store VITALTRENDS_API_KEY and SLACK_WEBHOOK_URL as repository secrets. GitHub runs schedules in UTC and can start them late when it is busy.
name: Morning brief
on:
schedule:
- cron: "30 6 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
brief:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install requests
- run: python morning-brief.py
env:
VITALTRENDS_API_KEY: ${{ secrets.VITALTRENDS_API_KEY }}
VITALTRENDS_TIMEZONE: Europe/Lisbon
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Workflow recipes
Each recipe lists the trigger, the exact data it reads, the steps, a prompt for AI-based setups, and a sample output. All sample numbers are invented. All recipes are read-only.
1. Morning readiness brief
- Trigger: every day, after your usual wake time (for example 07:30). If there is no data yet, run again at 09:00.
- Data: REST
GET /whoop/daily?start=<yesterday>&per_page=5(row wherecycle_start_dateis today, usingrecovery_score,sleep_duration_minutes,hrv_rmssd_milli,resting_heart_rate), falling back toGET /oura/daily-readiness?start=<today>&end=<today>(score,temperature_deviation,contributor_*). MCP:get_whoop_daily,get_oura_daily_readiness. - Steps: fetch WHOOP, pick today's row, map recovery to green (67-100), yellow (34-66) or red (0-33), turn green into yellow after less than 6 hours of sleep, fall back to Oura when WHOOP has no row, then send three lines to Telegram, Slack or email.
- Templates: n8n workflow, morning-brief.py.
Sample output:
Readiness 2026-11-21: YELLOW (WHOOP recovery 72% but short sleep)
Sleep 5h 42m, HRV 61 ms, resting HR 50 bpm
Suggestion: train if you like, but keep the hardest work moderate. Not medical advice.
2. Calendar guard
- Trigger: every day at 06:30, or right after the morning brief.
- Data: REST
GET /whoop/daily(recovery_score,sleep_duration_minutes) orGET /oura/daily-readiness(score). MCP:get_whoop_daily,get_oura_daily_readiness. Calendar events come from your calendar app's own integration (for example n8n's Google Calendar node), not from VitalTrends. - Steps: read today's recovery. If recovery is below 34% or sleep is under 6 hours (360 minutes), find today's events you have marked as hard training (for example titles containing "Intervals" or a "#hard" tag). Send yourself a message proposing an easier option or a later slot. Let the automation flag the event, never move or delete it on its own.
Sample output:
Calendar guard, Fri 21 Nov: recovery 29%, sleep 5h 55m.
"Track intervals" 18:00-19:00 looks hard for today.
Proposal: swap for a 40-minute easy ride, or move intervals to Sunday. Nothing was changed.
3. Weekly training review
- Trigger: Sunday at 19:00.
- Data: REST
GET /training/muscle-groups/usage?start_date=<7 days ago>&end_date=<today>(muscle_groups[].muscle_group,amount,percentage,workout_count,total_amount),GET /workout-logs?start=<ISO start>&end=<ISO end of day>&include=exercises(sessions, exercises, sets withweight_kgandreps),GET /training/exercises/{exerciseKey}for history,GET /whoop/dailyorGET /oura/daily-readinessfor the recovery trend. MCP:get_muscle_group_usage,get_workout_logs,get_exercise_history,get_whoop_daily,get_oura_daily_readiness. - Steps: pull the week's muscle-group volume and sessions, compare each exercise's heaviest set with its history, compare average recovery with the previous week, write a Markdown note and save it to Notion, Obsidian or email.
- Template: weekly-training-review.py (
--prsadds the history check).
Sample output:
# Training review: 2026-11-15 to 2026-11-21
- Sessions: 4, sets: 62, lifted volume: 18,420 kg
- Back 39%, Quadriceps 33%, Chest 18%, Shoulders 10%. No hamstrings volume this week.
- New heaviest load: Lat pulldown 8 x 65 kg (previous 62.5 kg)
- Average recovery 61% vs 66% the week before.
4. Withings weight trend
- Trigger: every day at 09:00, after your usual weigh-in.
- Data: REST
GET /withings/measurements?start=<34 days ago>&end=<today>&per_page=200(measured_at,weight_kg; optionalfat_ratio_pct,muscle_mass_kg). MCP:get_withings_measurements. - Steps: average each day's weigh-ins, compute a 7-day moving average, compare it with 7 and 14 days ago, and send a nudge only when the direction reverses (for example from losing to gaining by more than 0.2 kg a week).
- Template: withings-weight-trend.py.
Sample output:
Weight trend to 2026-11-21: 7-day average 79.4 kg (latest weigh-in 79.5 kg)
Change vs last week: +0.3 kg; week before: -0.3 kg
Nudge: your 7-day average has turned up after trending down. Worth a look at the last week's routine. Not medical advice.
5. Glucose evening review
- Trigger: every day at 21:00. Needs a CGM or glucose app writing to Apple Health and the VitalTrends iOS app syncing it.
- Data: REST
GET /glucose?range=24h(data.config.unit,data.stats.average_glucose.value,data.stats.time_in_range.range_70_180_pct,range_70_140_pct,data.stats.min_max,data.stats.variability.value,data.empty), plusGET /glucose/readings?start=<today>&end=<today>&per_page=200for individual readings. MCP:get_glucosewithrange="24h",get_glucose_readings. - Steps: read the last 24 hours, report time in range and average, list the times readings went above 180 mg/dL (or your own threshold) and for how long, and skip the message when
emptyis true.
Sample output:
Glucose, last 24 h: average 108 mg/dL, 70-180: 97%, 70-140: 84%.
Highest 176 mg/dL at 13:40. No readings above 180 mg/dL.
Variability (CV) 17%.
If you manage diabetes, follow your care team's guidance. This review is not a substitute for it.
6. Workout auto-log summary
- Trigger: every evening at 21:30, or hourly if you want it soon after a Hevy sync.
- Data: REST
GET /workout-logs?start=<last run, ISO>&include=exercises(Hevy, imported and manual Training Log sessions),GET /workouts/unified?start=<today>for device workouts such as runs and rides. MCP:get_workout_logs,get_unified_workouts. - Steps: find sessions that started since the last run, summarize each one (exercises, top sets, volume, duration, average heart rate when a device recorded it) and append the summary to your own training journal in Notion, Obsidian or a Google Doc. The journal lives outside VitalTrends, so the key stays read-only. Writing notes back into the VitalTrends Training Log would need write access; if you do that, preview the change first and confirm it yourself.
Sample output:
Fri 21 Nov, Pull day (Hevy), 52 min, 2,100 kg
Lat pulldown top set 8 x 65 kg, seated row 10 x 55 kg.
Lat pulldown is 2.5 kg heavier than your previous best.
7. Coach weekly digest (opt-in, read-only)
- Trigger: Monday at 08:00. Only set this up with your coach's agreement, and stop it whenever you like.
- Data: REST
GET /summaryfor a cross-source overview,GET /whoop/dailyorGET /oura/daily-readinessfor weekly averages,GET /training/muscle-groups/usagefor training volume. MCP:get_summary,get_whoop_daily,get_oura_daily_readiness,get_muscle_group_usage. - Steps: compute weekly averages and totals, send only those numbers to your coach by email, and send yourself a copy. Your coach never receives your API key or a connection to your account. Leave out anything you don't want to share.
Sample output:
Week of 15-21 Nov
Recovery averaged 61% (previous week 66%). Sleep averaged 6h 48m.
4 strength sessions, 18,420 kg total: back 39%, quads 33%, chest 18%, shoulders 10%.
Unusual: two short-sleep nights (Wed, Fri). Next week is a planned deload.
What you can't automate yet
Lab results, weekly recaps, Control Center, provider connections, billing, account settings, CSV export jobs and share links are not available through the API or MCP server. A "retest this lab marker in 90 days" reminder, for example, has to come from your own notes for now.
FAQ
Can an automation change my data?
Not with these templates. They only send GET requests. Writes need an API key with Allow workout write access, and through MCP OAuth also a connection where you ticked "Allow changes to my Training Log".
Which API key do automations use?
Your account's one API key from Settings → Developer. Every automation and AI connection uses the same key. Regenerating it stops all of them until you update them.
Do the templates send my health data to third parties?
Only the short message you choose to send, to the destination you configure, such as Telegram or Slack. That service then handles it under its privacy policy. If you add an AI step, the data that step reads goes to that AI provider.
Can I automate lab results?
Not yet. Lab results are only available in the VitalTrends website.
How often should an automation poll?
Every 30 minutes at most. The limit is 120 requests per minute per API key, and it is shared by every tool that uses your key.
Is this medical advice?
No. These workflows summarize your own data. Talk to a qualified professional about health decisions.