← All posts
· 4 min read

Integrating WHOOP with Notion using Make

Rebuilding my WHOOP-to-Notion sync as a no-code Make scenario: a custom app with OAuth, a shared webhook, and a workout lookup that drops each workout into a Notion database.

Health & FitnessAutomationNotionWHOOPMake
Photo by Team Nocoloco on Unsplash
Photo by Team Nocoloco on Unsplash

Introduction

Over a year ago, I created software that would allow me to sync data from my WHOOP strap with Notion (post linked here). While this was a fun project and helpful for me, it did not scale well, and AWS infrastructure is not free. It also does not unlock the ability for others to use what I have learned unless they have a background in coding. This led me to investigate if there was an easier way to do it and gain the ability to share with others.

What is the goal of the project?

I use Notion to track daily health and fitness data. I want to automate entering my WHOOP data, as I previously manually entered all the information. I wanted to scale this project down initially as a POC, so I decided on:

I want a row in a Notion database for each workout with its details.

Before we jump into the solution, let me give a brief intoduction to Make. I am surely not doing it justice, so please go over to their website if you are curious for more information!

Make

Make is a software platform that allows you to connect different services using a no-code approach. They have plenty of examples of automations you can create, like automating lead generation, invoicing, and billing. While at the surface, that does not seem anything like a tool to import workout and sleep data into Notion, it has all the building blocks:

This should be everything needed to create an automation that can add an entry to a Notion database when a workout is completed in WHOOP.

Solution

Custom App Creation

The first step was to add the ability to work with WHOOP in Make. This is where custom apps come in. The three main components of a custom app that are needed for it to work are:

Connection

WHOOP uses OAuth 2.0 for API access. Make has out of the box support for OAuth 2.0, so I added a connection to the custom app and updated the configuration for WHOOP specific urls and added all available scopes for the API. This was all very easy using the web editor for Make, as you can just update the configurations using JSON, and by choosing one of their connection options, most of the boilerplate was already added. There is also a VSCode extension to help with this, but I did not use that at this time.

Webhooks

WHOOP has webhook support for event notifications and can be used to trigger a Make scenario. WHOOP sends all events for all users to the same URL, so you must use the shared webhook functionality in Make. A shared webhook allows you to have one URL that can distribute events to the correct user’s Make Scenarios.

Modules

These is the final building blocks for my custom app. The 2 modules needed for my scenario are:

These were both very easy to create. For the trigger, I just needed to provide the webhook created for the custom app and the interface (the definition of the webhook payload). The interface can then be used in the next steps of the scenario. For the action, I needed to specify the inputs (what workout to fetch), what API to call (the getWorkoutById endpoint), and what the response looks like from the API call (the interface). The interface can then be used in later steps on the scenario.

Make Scenario

Now that the custom app was created, I could build the Scenario to add a row to a database in Notion when a workout in Whoop was detected. The scenario went like this:

  1. Trigger on WHOOP webhook
  2. Filter for workout webhook types
  3. Fetch workout data
  4. Save workout data to Notion as a new database item

Once everything was set up, all I had to do was test it. I created a workout in the WHOOP app and waited about a minute (the time it takes to receive a WHOOP webhook) and voila! The workout was added to a Notion database.

Final Outcome and Next Steps

Overall this was a success! Make made this whole process very easy, and more importantly, required no code. There are just a couple of things left to make it a complete solution. Those are:

I’m always excited to learn new technologies and share them with others, so if you’re interested in trying this out for yourself or chatting about other cool health and fitness tools, feel free to reach out to me through gw3tech.com.

Also published on Medium. This page is the original.