Automate Spotify to YouTube Playlist Sync with n8n

This n8n workflow solves the headache of manually syncing a Spotify playlist to a YouTube playlist by automating track matching, additions, and removals precisely using YouTube video data. It ensures your YouTube playlist always reflects your Spotify favorites with minimal effort.
spotify
supabase
youtube
+9
Workflow Identifier: 1138
NODES in Use: spotify, if, supabase, compareDatasets, youtube, splitInBatches, set, wait, noOp, aggregate, removeDuplicates, discord
Automate Spotify to YouTube with n8n

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow copies a Spotify playlist to a YouTube playlist automatically.

It finds songs on Spotify, checks for exact matching YouTube videos by title, artist, and almost the same length.

It adds matching videos to the YouTube playlist and removes videos that are no longer in Spotify.

Notifications about matches or misses are sent to Discord.

This saves time and keeps playlists always matched without manual work.


Who Should Use This Workflow

This is for users with Spotify playlists who want the same music on YouTube.

If manual copying takes too long or causes errors, this workflow helps a lot.

It works best for people with stable API keys and basic knowledge of n8n usage.


Tools and Services Used


Inputs, Processing, and Outputs

Inputs

  • Spotify playlist ID and API credentials.
  • YouTube playlist ID and API credentials.
  • Supabase table storing current playlist track data.
  • Discord webhook URL.

Processing Steps

  1. Detect Spotify playlist changes by comparing snapshot IDs.
  2. Get all Spotify tracks and current database entries.
  3. Compare both datasets to find new or removed tracks.
  4. Add new tracks to the database and mark tracks to delete.
  5. Search YouTube for videos matching new tracks within ±10% duration.
  6. Add matched videos to the YouTube playlist and update database.
  7. Remove old YouTube videos no longer on Spotify.
  8. Send Discord notifications for added and NOTFOUND tracks.
  9. Clear NOTFOUND flags daily/monthly to retry matches.

Outputs

  • Updated YouTube playlist with matching videos.
  • Database synced with Spotify and YouTube data.
  • Notifications for user about sync status.

Beginner Step-by-Step: How to Use This Workflow in n8n

1. Import Workflow

  1. Download the workflow JSON file by clicking the Download button on this page.
  2. In the n8n editor, use “Import from File” option to load the workflow.

2. Configure Credentials and IDs

  1. Add Spotify API credentials in n8n’s credentials manager.
  2. Add YouTube Data API credentials similarly.
  3. Set up Supabase credentials and connection details.
  4. Update variables node with your Spotify playlist ID, YouTube playlist ID, and Supabase table name if different.
  5. Add your Discord webhook URL if notifications are needed.

3. Test Workflow

  1. Run the workflow manually once inside n8n editor.
  2. Check node outputs for errors and ensure data flows as expected.

4. Activate Workflow

  1. Turn on the workflow by toggling it Active in n8n.
  2. The workflow will run on schedule automatically, syncing playlists.

For advanced users running self-host n8n, this workflow can run reliably on private cloud or VPS.


Edge Cases and Failures

1. No Matching YouTube Video Found

If no YouTube video matches 90%-110% of the Spotify track duration, the database marks track as NOTFOUND.

Workflow retries matching daily and monthly by resetting these flags.

2. API Limits Are Reached

YouTube or Spotify API limits may block further requests temporarily.

Batching using SplitInBatches node and adjusting schedule frequency avoids hitting limits.

3. Playlist Snapshot Never Updates

If Spotify snapshot ID never changes, the workflow skips updates.

You can run workflow manually or check that playlist is updated on Spotify side.

4. Removal of Wrong YouTube Videos

Removing playlist videos uses database flags carefully with exact ID matching to avoid accidents.

Check field mappings in removal nodes to prevent deleting unrelated videos.


Customization Ideas

  • Change YouTube search query to include album names or genres for better matches.
  • Replace Discord notifications with Slack or email by updating webhook URLs.
  • Adjust schedule trigger frequency to match playlist update rates or API quota.
  • Add extra columns in Supabase to track metadata like track popularity.
  • Insert a Code node for error logging and custom metrics between key steps.

Summary

✓ This workflow syncs Spotify playlists to YouTube playlists automatically.

✓ It matches videos using song title, artist, and duration checks within ±10%.

✓ Tracks are added or removed in YouTube, and data stays updated in Supabase.

✓ Notifications alert about new additions or unmatched tracks.

→ Saves hours every week by removing manual syncing tasks.

→ Keeps playlists accurate and up-to-date without errors.


Automate Spotify to YouTube with n8n

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Frequently Asked Questions

The workflow searches YouTube using track title and artist. Then it checks video duration within plus or minus 10 percent of the Spotify track length before selecting a match.
The workflow marks the track with a NOTFOUND flag in the database and retries the search daily and monthly by resetting these flags.
Yes, the workflow uses batching and a Supabase database to manage hundreds or thousands of tracks without hitting API limits.
Users can replace the Discord webhook with other services like Slack or email by updating the webhook URL in the notification node.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.