Animated data flow diagram

AI Music Classifier & Spotify Playlist Automator with Anthropic Claude

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

Spotify Google Sheets Anthropic Claude
Core AI Power
6/10
Automation Level
8/10
Integration Reach
3 systems
Setup Simplicity
5/10
Adaptability
7/10

Overview

Unlock AI-Driven Music Organization with this AI Agent

Stop manually sorting your ever-growing Spotify library! This AI Agent streamlines your music management by automatically fetching your liked tracks and playlists, enriching tracks with audio details, archiving everything in Google Sheets, and then leveraging the power of Anthropic Claude to classify and add these tracks to multiple appropriate Spotify playlists. Keep your music collection perfectly organized and discover new connections within your library, all on autopilot.

Key Features & Benefits

  • Automated Spotify Sync: Regularly fetches your Spotify liked tracks (or from your library) and your playlists.
  • Google Sheets Archiving: Saves new tracks (with audio features) and new playlists to designated Google Sheets, creating a personal, historical music database.
  • Rich Audio Feature Integration: Pulls detailed audio features (e.g., danceability, energy, tempo) for each track directly from the Spotify API, providing valuable data for classification.
  • AI-Powered Playlist Classification: Employs an Anthropic Claude model to analyze track characteristics (title, artist, audio features) against your existing playlist names and descriptions, then intelligently assigns tracks to one or more relevant Spotify playlists.
  • Bulk Playlist Updates: Adds classified tracks to your Spotify playlists in batches, handling API limits and ensuring efficient updates.
  • Deduplication Logic: Checks against already logged tracks and playlists in Google Sheets to prevent redundant processing and API calls.
  • Customizable Classification: Tailor the AI's behavior by refining your Spotify playlist descriptions (which the AI uses as context) and adjusting the prompt in the LLM node.
  • Scheduled or Manual Execution: Can be set to run on a schedule (e.g., monthly via the 'Monthly Trigger') or triggered manually.
  • Efficient Processing: Designed to process tracks in batches to optimize API usage with Spotify and Anthropic Claude.

Use Cases

  • Personal Music Curators: Automatically archive your Spotify listening history and let an AI Agent intelligently sort new tracks into custom playlists based on genre, mood, and audio features, using your playlist descriptions as a guide.
  • Music Bloggers & Reviewers: Systematically catalog discovered tracks for review, using AI to pre-sort them into thematic playlists for streamlined content creation and sharing.
  • DJs & Playlist Creators: Get AI-driven suggestions for adding tracks to multiple playlists, significantly speeding up your music library organization and curation workflow.
  • Organized Spotify Users: Effortlessly maintain a clean, well-categorized Spotify library. Ensure your playlists are always up-to-date with your latest liked songs without tedious manual effort.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • Anthropic API Key with access to a model like Claude 3.5 Sonnet.
  • Spotify OAuth2 credentials.
  • Google Sheets OAuth2 credentials.
  • A Google Sheet document prepared with two sheets: one for logging tracks (e.g., named 'tracks listing') and one for logging playlists (e.g., named 'playlists listing'). The AI will use the playlist names and descriptions from the 'playlists listing' sheet (or directly from Spotify if synced) for classification.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure all Spotify nodes ('Get Playlist', 'Get Tracks', 'Get Track details', 'Spotify') with your Spotify OAuth2 credentials.
  4. Configure all Google Sheets nodes ('Get logged tracks', 'Get logged playlists', 'Log new tracks', 'Log new playlists') with your Google Sheets OAuth2 credentials. Ensure you set the correct Google Sheet Document ID and the specific Sheet Names for tracks and playlists as per your setup.
  5. In the 'Anthropic Chat Model' node, enter your Anthropic API Key and select your desired model.
  6. Review the prompt in the 'Basic LLM Chain - AI Classification' node. It uses playlist information fetched by the 'Playlists informations' node. Ensure your Spotify playlists have descriptive names and detailed descriptions, as the AI heavily relies on these for accurate classification (see the example descriptions in the workflow's sticky notes).
  7. The 'Filter my playlist' node is set to filter playlists by owner 'Arnaud'. Change this to your Spotify username or remove/adjust the filter as needed.
  8. Adjust the 'Monthly Trigger' node if you prefer a different schedule, or disable it to run the workflow manually.
  9. (Optional) The 'Limit' nodes (Limit, Limit2) are set to process a small number of items by default (typically 1 or 10). For full runs, increase these limits or remove the nodes if you want to process all available items, but be mindful of API rate limits and costs.
  10. Activate the workflow.

Tags:

AI AgentMusic AutomationSpotifyAnthropic ClaudeGoogle SheetsProductivityAI ClassificationData ArchivingAutomation

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Request a Consultation