Automatic Strava Activity Synchronization to Google Sheets - n8n Workflow

Use this robust n8n workflow to automatically export your latest Strava activities into Google Sheets every two hours, ensuring no duplicate entries are created. Perfect for data logging.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Fitness enthusiasts or athletes who track data using Strava and require automated logging.

  • Data analysts needing a clean, structured repository for fitness metrics.

  • Users looking for advanced n8n templates that involve complex data filtering and comparison.

  • Developers seeking a practical example of how to use the n8n Code node for cross-reference filtering.

Overview

Manually logging Strava activities into a spreadsheet is time-consuming and prone to duplication errors. This advanced n8n workflow solves this by establishing a reliable, scheduled sync process. Utilizing a scheduled n8n trigger, the workflow runs every two hours, ensuring your sheet is consistently updated with recent activity data.

The core value of this n8n template lies in its duplication prevention mechanism. Before writing new data, the automation checks the Google Sheet for existing activity IDs. This ensures data integrity, making this an essential n8n workflow for anyone serious about activity logging and analysis. It seamlessly combines the Strava n8n node with the Google Sheets n8n node, governed by custom core logic.

How it Works

This comprehensive n8n workflow operates in several distinct stages to ensure efficient data synchronization and duplicate prevention:


  1. Scheduled Execution: The process begins with the Schedule Trigger, acting as the primary n8n trigger, set to run every 2 hours.

  2. Retrieve Saved IDs: The workflow first queries the target Google Sheet (activities) to retrieve a list of previously saved activity IDs. These records are sorted and simplified using a Set n8n node (savedlast).

  3. Fetch New Activities: Simultaneously, the workflow uses the Strava n8n node to fetch the most recent activities (limited to 10). The results are cleaned of any internal duplicates and formatted (distance converted to kilometers, time converted to HH:MM:SS) using the stravalast n8n node.

  4. Filter Duplicates via Code: The crucial filtering step happens in the Code n8n node. This node compares the IDs of the newly fetched Strava activities against the set of IDs already present in the Google Sheet (obtained in Step 2). Only activities whose IDs are not found in the saved list are passed on.

  5. Append to Google Sheets: The filtered, unique activities are sorted again (sort_results) and then appended to the designated Google Sheet using the Google Sheets n8n node. This completes the synchronization loop of the n8n workflow, guaranteeing that only fresh data is added.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON data and paste it directly into your n8n instance via the 'Import from JSON' option.

  2. Strava Credentials: Locate the Strava n8n node. You will need to create or select existing credentials that authorize n8n to access your Strava account data.

  3. Google Sheets Setup: Configure both activities (Read) and Google Sheets (Append) n8n nodes with your Google Sheets credentials.

  4. Sheet Configuration: In both Google Sheets n8n nodes, specify the correct 'Document ID' and 'Sheet Name' (or GID) where your Strava data will be stored.

  5. Review Mappings: In the final Google Sheets n8n node, ensure the column mappings (e.g., Kms, Ref, Fecha, Track) accurately reflect the column headers in your spreadsheet. This n8n workflow uses expressions like ={{ $json.distancia }} to correctly insert formatted data.

  6. Activate: Save and activate the n8n workflow. It will now run on the defined schedule.

Node Details

Schedule Trigger (n8n trigger): Initiates the entire automation every 2 hours.
Strava (n8n node): Fetches the latest 10 activities from the connected Strava account. Used the getAll operation.
activities (Google Sheets n8n node): Reads existing data from the target spreadsheet to identify already saved activity IDs (Ref column).
savedlast / stravalast (Set n8n node): These nodes preprocess the data. savedlast extracts only the 'Ref' ID from Google Sheets data. stravalast formats raw Strava metrics (like distance in meters and time in seconds) into human-readable values (km, date format, HH:MM:SS).
Code (n8n node): The core logic for filtering. It uses JavaScript to compare IDs received from Strava (stravalast) against the IDs retrieved from Google Sheets (savedlast). It only returns items that are genuinely new, making this a highly customized n8n workflow component.
Google Sheets (n8n node): The final action. Configured to append new rows, mapping the filtered Strava data to specific sheet columns including calculated fields like the direct Strava track link.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

Featured*