Match Spotify Tracks to YouTube Videos
Configured with Aggregate, Compare Datasets, Discord, Remove Duplicates, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Files / media
- Routing
- Data store
- Transform
- Trigger
- Wait
- Messaging
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Get playlist snapshot | Files / media | Spotify | playlist / get |
| Get playlist snapshot1 | Files / media | Spotify | playlist / get |
| If different snapshot | Routing | If | See node parameters |
| Get all musics | Data store | Supabase | getAll |
| Update to_delete to true | Data store | Supabase | update |
| Add music | Data store | Supabase | See node parameters |
| Compare Datasets | Transform | Compare Datasets | See node parameters |
| Spotify | Files / media | Spotify | playlist / getTracks |
| No Operation, do nothing | Routing | No Op | See node parameters |
| Get all musics not in youtube playlist | Data store | Supabase | getAll |
| Every day at noon | Trigger | Schedule Trigger | See node parameters |
| Every day at noon + 1mn | Trigger | Schedule Trigger | See node parameters |
| Every hour | Trigger | Schedule Trigger | See node parameters |
| Wait 1 hour | Wait | Wait | See node parameters |
| variables | Transform | Edit Fields | See node parameters |
| Search video | Files / media | You Tube | video |
| Get video duration | Files / media | You Tube | video / get |
| Loop Over Items | Routing | Loop Over Items | See node parameters |
| If video duration ~= music duration | Routing | If | See node parameters |
| Add music to playlist | Files / media | You Tube | playlistItem |
| Add youtube id to row | Data store | Supabase | update |
| Discord | Messaging | Discord | See node parameters |
| Discord1 | Messaging | Discord | See node parameters |
| Set youtube id to NOTFOUND if no matching | Data store | Supabase | update |
| Aggregate | Transform | Aggregate | See node parameters |
| If no result | Routing | If | See node parameters |
| data | Transform | Edit Fields | See node parameters |
| variables2 | Transform | Edit Fields | See node parameters |
| variables1 | Transform | Edit Fields | See node parameters |
| Loop Over Items1 | Routing | Loop Over Items | See node parameters |
| data1 | Transform | Edit Fields | See node parameters |
| Get playlist items | Files / media | You Tube | playlistItem / getAll |
| Playlist items to be deleted | Transform | Compare Datasets | See node parameters |
| Get all musics that should be in playlist | Data store | Supabase | getAll |
| Remove Duplicates | Transform | Remove Duplicates | See node parameters |
| Remove video from playlist | Files / media | You Tube | playlistItem / delete |
| Check for deleted videos | Transform | Compare Datasets | See node parameters |
| Set youtube_video_id to null | Data store | Supabase | update |
| Get all musics to be deleted | Data store | Supabase | getAll |
| Delete music | Data store | Supabase | delete |
| Every day at midnight | Trigger | Schedule Trigger | See node parameters |
| variables3 | Transform | Edit Fields | See node parameters |
| Reset NOTFOUND id to NULL | Data store | Supabase | update |
| variables4 | Transform | Edit Fields | See node parameters |
| Every month | Trigger | Schedule Trigger | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
None declared. HTTP requests and Code nodes may still need configuration.
Workflow notes
Match Spotify Tracks to YouTube Videos
Match Spotify Tracks to YouTube Videos
This part finds the best YouTube video for a Spotify track using the YouTube Data API v3. It searches with the track title and artist, retrieves the top 5 videos, and selects the first one with a duration within ±10% of the Spotify track length. The matched video is added to a YouTube playlist, and its ID is saved in the database.
Operation:
-
Uses Spotify data (title + artist) for search.
-
Ensures duration accuracy (±10% tolerance).
-
Automates playlist updates and database storage.
Spotify to YouTube Playlist Synchronization
Spotify to YouTube Playlist Synchronization
A workflow that maintains a YouTube playlist in sync with a Spotify playlist, featuring smart video matching and persistent synchronization.
Key Features
- One-way Sync: Spotify playlist → YouTube playlist (additions and deletions
- Continuous Monitoring: Automatic synchronization (every hour by default, but you can put any time you want)
- Smart Video Matching: Considers video length and content relevance
- Auto-Recovery: Automatically handles deleted YouTube videos
- Database Backup: Persistent storage using Supabase
Prerequisites
- Supabase project with the following table structure:
CREATE TABLE IF NOT EXISTS musics (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
artist TEXT NOT NULL,
duration INT8 NOT NULL,
youtube_video_id TEXT,
to_delete BOOLEAN DEFAULT FALSE
);
- Empty YouTube playlist (recommended as duplicates are not handled)
- Configured credentials for YouTube, Spotify, and Supabase APIs
- Properly set variables in all "variables" nodes (variables, variables1, variables2, variables3, variables4 (all the same))
- Activate the workflow !
Workflow Components
Workflow 1: Main Sync Process
-
Change Detection
- Monitors Spotify playlist for changes
- Compares database state with current playlist
-
Video Matching
- Searches YouTube based on title, artist, and duration
- Evaluates top 5 results for best match
- Marks unmatched tracks with "NOTFOUND"
- Notifies user of successful matches and failures
Workflow 2: YouTube Maintenance
- Monitors YouTube playlist for removed videos
- Flags removed videos for re-search
- Handles deletion of marked videos
Workflow 3: Recovery Process
- Clears "NOTFOUND" flags periodically to re-search previously unmatched tracks
Implementation Notes
- Workflows can be separated into different files for better monitoring
- Recovery process ensures long-term playlist maintenance
Spotify-Database Synchronization
Spotify-Database Synchronization
Operation:
-
Compares Spotify playlist tracks against database entries
-
Adds missing tracks to database
-
Marks database entries for deletion when removed from Spotify playlist
Daily Force Check
Daily Force Check
Forces daily comparison between Spotify playlist and database state, bypassing playlist modification checks. Essential for:
-
Initial setup of large playlists (manages YouTube API limits)
-
Processing pending tracks when playlist hasn't changed
-
Continuing sync attempts for unmatched tracks
Workflow 1: Main Sync Process
Workflow 1: Main Sync Process
1. Change Detection
-
Monitors Spotify playlist for changes
-
Compares database state with current playlist
2. Video Matching
-
Searches YouTube based on title, artist, and duration
-
Evaluates top 5 results for best match
-
Marks unmatched tracks with "NOTFOUND"
-
Notifies user of successful matches and failures
Workflow 2: YouTube Maintenance
Workflow 2: YouTube Maintenance
-
Monitors YouTube playlist for removed videos
-
Flags removed videos for re-search
-
Handles deletion of marked videos
Workflow 3: Recovery Process
Workflow 3: Recovery Process
-
Clears "NOTFOUND" flags periodically to re-search previously unmatched tracks
Match Spotify Tracks to YouTube Videos
Match Spotify Tracks to YouTube Videos
Purpose and structure
This folder contains the Match Spotify Tracks to YouTube Videos workflow. Its executable nodes use aggregate, compareDatasets, discord, if, noOp, removeDuplicates, scheduleTrigger, set, splitInBatches, spotify, supabase, wait, youTube. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Every day at noon, Every day at noon + 1mn, Every hour, Every day at midnight, Every month
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Wait/0715_Wait_Schedule_Create_Scheduled.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- Check for any modification in the spotify playlist with snapshot_id
- Optional notifications (you can use the chat of your choice)