If no playlist

For Spotify, this automated workflow creates and maintains a "Downloads" playlist, ensuring it always contains up to 50 of your latest liked tracks. It checks for new songs, adds them to the playlist, and removes the oldest tracks when the limit is exceeded, keeping your music library fresh and organized. The workflow runs on a set schedule, freeing up space on your device while ensuring you always have access to your favorite tunes.

7/8/2025
23 nodes
Complex
schedulecomplexspotifysplitinbatchesaggregatesplitoutfilterschedule triggersticky noteautomationadvancedlogicconditionalcron
Categories:
Schedule TriggeredComplex WorkflowCreative Content & Video Automation
Integrations:
SpotifySplitInBatchesAggregateSplitOutFilterSchedule TriggerSticky Note

Target Audience

This workflow is ideal for:
- Music Enthusiasts: Users who want to keep their favorite tracks organized and easily accessible in a dedicated playlist.
- Spotify Users: Those who frequently like songs on Spotify and want to automate the process of maintaining a playlist of their liked tracks.
- Automation Lovers: Individuals who seek to streamline their music management without manual intervention.
- Developers: Tech-savvy users who are familiar with n8n and want to build upon or modify existing workflows for personal use.

Problem Solved

This workflow addresses the challenge of managing a Spotify playlist by:
- Automating Playlist Creation: It automatically creates a playlist named "Downloads" if it doesn't already exist.
- Maintaining a Limit: Users can define a limit (up to 50 tracks) for the number of songs in the playlist, ensuring it doesn't become overcrowded.
- Filtering New Tracks: The workflow checks for newly liked tracks and only adds those that are not already in the playlist, preventing duplicates.
- Removing Old Tracks: It ensures that once the limit is reached, the oldest tracks are removed, keeping the playlist fresh and relevant.

Workflow Steps

  • Schedule Trigger: The workflow is triggered on a defined schedule, allowing it to run automatically at set intervals.
    2. Set Globals: The user specifies the maximum number of songs to keep in the playlist (default is 50).
    3. Get All Playlists: It retrieves all playlists from the user's Spotify account.
    4. Check for Existing Playlist: The workflow checks if the "Downloads" playlist exists. If not, it creates one.
    5. Get Liked Tracks: It fetches all liked tracks from the user's Spotify account.
    6. Filter New Tracks: The workflow filters out tracks that are already in the "Downloads" playlist.
    7. Loop Over New Tracks: For each new track, it adds them to the "Downloads" playlist.
    8. Get Updated Playlist: It retrieves the updated "Downloads" playlist to check for tracks to remove.
    9. Remove Old Tracks: If the playlist exceeds the set limit, the oldest tracks are removed to make space for new ones.
  • Customization Guide

    Users can customize this workflow by:
    - Adjusting the Download Limit: Modify the download_limit variable in the Globals step to set a different maximum number of tracks in the playlist.
    - Changing the Playlist Name: Update the name parameter in the Create Downloads Playlist step to use a different name for the playlist.
    - Modifying the Schedule: Adjust the schedule trigger settings to change how often the workflow runs (e.g., daily, weekly).
    - Adding Additional Filters: Users can add more conditions in the filtering steps to refine which tracks get added or removed based on their preferences.