← All N8N workflows
Messaging & emailAggregateCompare DatasetsDiscordIfNo Op

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.

Workflow preview
Files / mediaGet playlist snapshotSpotifyFiles / mediaGet playlist snapshot1SpotifyRoutingIf different snapshotIfData storeGet all musicsSupabaseData storeUpdate to_delete totrueSupabaseData storeAdd musicSupabaseTransformCompare DatasetsCompare DatasetsFiles / mediaSpotifySpotifyRoutingNo Operation, donothingNo OpData storeGet all musics not inyoutube playlistSupabaseTriggerEvery day at noonSchedule TriggerTriggerEvery day at noon + 1mnSchedule TriggerTriggerEvery hourSchedule TriggerWaitWait 1 hourWaitTransformvariablesEdit FieldsFiles / mediaSearch videoYou TubeFiles / mediaGet video durationYou TubeRoutingLoop Over ItemsLoop Over ItemsRoutingIf video duration ~=music durationIfFiles / mediaAdd music to playlistYou TubeData storeAdd youtube id to rowSupabaseMessagingDiscordDiscordMessagingDiscord1DiscordData storeSet youtube id toNOTFOUND if no matchingSupabaseTransformAggregateAggregateRoutingIf no resultIfTransformdataEdit FieldsTransformvariables2Edit FieldsTransformvariables1Edit FieldsRoutingLoop Over Items1Loop Over ItemsTransformdata1Edit FieldsFiles / mediaGet playlist itemsYou TubeTransformPlaylist items to bedeletedCompare DatasetsData storeGet all musics thatshould be in playlistSupabaseTransformRemove DuplicatesRemove DuplicatesFiles / mediaRemove video fromplaylistYou TubeTransformCheck for deletedvideosCompare DatasetsData storeSet youtube_video_id tonullSupabaseData storeGet all musics to bedeletedSupabaseData storeDelete musicSupabaseTriggerEvery day at midnightSchedule TriggerTransformvariables3Edit FieldsData storeReset NOTFOUND id toNULLSupabaseTransformvariables4Edit FieldsTriggerEvery monthSchedule Trigger

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.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Get playlist snapshotFiles / mediaSpotifyplaylist / get
Get playlist snapshot1Files / mediaSpotifyplaylist / get
If different snapshotRoutingIfSee node parameters
Get all musicsData storeSupabasegetAll
Update to_delete to trueData storeSupabaseupdate
Add musicData storeSupabaseSee node parameters
Compare DatasetsTransformCompare DatasetsSee node parameters
SpotifyFiles / mediaSpotifyplaylist / getTracks
No Operation, do nothingRoutingNo OpSee node parameters
Get all musics not in youtube playlistData storeSupabasegetAll
Every day at noonTriggerSchedule TriggerSee node parameters
Every day at noon + 1mnTriggerSchedule TriggerSee node parameters
Every hourTriggerSchedule TriggerSee node parameters
Wait 1 hourWaitWaitSee node parameters
variablesTransformEdit FieldsSee node parameters
Search videoFiles / mediaYou Tubevideo
Get video durationFiles / mediaYou Tubevideo / get
Loop Over ItemsRoutingLoop Over ItemsSee node parameters
If video duration ~= music durationRoutingIfSee node parameters
Add music to playlistFiles / mediaYou TubeplaylistItem
Add youtube id to rowData storeSupabaseupdate
DiscordMessagingDiscordSee node parameters
Discord1MessagingDiscordSee node parameters
Set youtube id to NOTFOUND if no matchingData storeSupabaseupdate
AggregateTransformAggregateSee node parameters
If no resultRoutingIfSee node parameters
dataTransformEdit FieldsSee node parameters
variables2TransformEdit FieldsSee node parameters
variables1TransformEdit FieldsSee node parameters
Loop Over Items1RoutingLoop Over ItemsSee node parameters
data1TransformEdit FieldsSee node parameters
Get playlist itemsFiles / mediaYou TubeplaylistItem / getAll
Playlist items to be deletedTransformCompare DatasetsSee node parameters
Get all musics that should be in playlistData storeSupabasegetAll
Remove DuplicatesTransformRemove DuplicatesSee node parameters
Remove video from playlistFiles / mediaYou TubeplaylistItem / delete
Check for deleted videosTransformCompare DatasetsSee node parameters
Set youtube_video_id to nullData storeSupabaseupdate
Get all musics to be deletedData storeSupabasegetAll
Delete musicData storeSupabasedelete
Every day at midnightTriggerSchedule TriggerSee node parameters
variables3TransformEdit FieldsSee node parameters
Reset NOTFOUND id to NULLData storeSupabaseupdate
variables4TransformEdit FieldsSee node parameters
Every monthTriggerSchedule TriggerSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. 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

  1. 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
);
  1. Empty YouTube playlist (recommended as duplicates are not handled)
  2. Configured credentials for YouTube, Spotify, and Supabase APIs
  3. Properly set variables in all "variables" nodes (variables, variables1, variables2, variables3, variables4 (all the same))
  4. Activate the workflow !

Workflow Components

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

  • 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)

More in Messaging & email